rails-partial icon indicating copy to clipboard operation
rails-partial copied to clipboard

Partial from Code not working

Open tehPlayer opened this issue 10 years ago • 3 comments

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 550, in run_
    return self.run(edit, **args)
  File "RailsPartial in /Users/marcinadamczyk/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 36, in run
  File "RailsPartial in /Users/marcinadamczyk/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 47, in get_selected_text
  File "RailsPartial in /Users/marcinadamczyk/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 96, in create_partial_file
UnicodeEncodeError: 'ascii' codec can't encode character '\xa3' in position 981: ordinal not in range(128)

After selecting code, pressing ALT+P, typing in name of new partial, it creates a partial, but empty. It doesnt remove code from original file, just creates the file.

tehPlayer avatar Oct 30 '15 10:10 tehPlayer

Thanks for bringing this to my attention!

What type of file are you using this in? Also, what is the code being selected? Anything out of the ordinary?

wesf90 avatar Nov 01 '15 03:11 wesf90

I found an error. If I select £ I get this error.

purchase less than £5,000

tehPlayer avatar Nov 02 '15 08:11 tehPlayer

I have the same issue. If I select any accentuation chars (like Anúncios) it doesn't work (exact behavior as described by OP).

The error in the log is: Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 568, in run_ return self.run(edit, **args) File "RailsPartial in /Users/feliperaul/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 36, in run File "RailsPartial in /Users/feliperaul/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 47, in get_selected_text File "RailsPartial in /Users/feliperaul/Library/Application Support/Sublime Text 3/Installed Packages/Rails Partial.sublime-package", line 96, in create_partial_file UnicodeEncodeError: 'ascii' codec can't encode character '\xfa' in position 112: ordinal not in range(128)

If I select any other code it works fine.

feliperaul avatar Jun 23 '16 02:06 feliperaul