package_control icon indicating copy to clipboard operation
package_control copied to clipboard

UnicodeEncodeError while installing new packages

Open mykolaharmash opened this issue 14 years ago • 13 comments

Sublime give me a massage "Package successfully installed" when I'm installing new package, but in console i see

Exception in thread Thread-3: Traceback (most recent call last): File ".\threading.py", line 532, in bootstrap_inner File ".\Package Control.py", line 1871, in run File ".\Package Control.py", line 1339, in install_package File ".\Package Control.py", line 1007, in download_url File ".\Package Control.py", line 602, in download File ".\urllib2.py", line 126, in urlopen File ".\urllib2.py", line 391, in open File ".\urllib2.py", line 409, in _open File ".\urllib2.py", line 369, in _call_chain File ".\Package Control.py", line 92, in https_open File ".\urllib2.py", line 1133, in do_open File ".\httplib.py", line 910, in request File ".\httplib.py", line 947, in _send_request File ".\httplib.py", line 904, in endheaders File ".\httplib.py", line 776, in _send_output File ".\httplib.py", line 735, in send File ".\Package Control.py", line 71, in connect File ".\ssl.py", line 350, in wrap_socket File ".\ssl.py", line 113, in __init UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-15: ordinal not in range(128)

And thare's no new packages in packages directory. I use Windows 7 32bit, Sublime Text 2 Build 2190

mykolaharmash avatar Apr 01 '12 11:04 mykolaharmash

At first i had the problem with install packages window not showing up, after updating settings in user preferences, now this exact same thing happens to me. Says it has been successfully installed but when I open the console, i see this error.

// Win XP SP3

Sh4d0Wx avatar Apr 21 '12 22:04 Sh4d0Wx

With "repository_channels" set to "https://sublime.wbond.net/repositories.json" it doesnt fetch any packages, when changed to http:// it works. But there is another problem, now it lists the packages but when i install them, it says they have been successfully installed but i get another error in the console and they are not actually installed and not listed in the "Package control: List packages" option.

This is the error from the console:

Exception in thread Thread-8: Traceback (most recent call last): File ".\threading.py", line 532, in __bootstrap_inner File ".\Package Control.py", line 1871, in run File ".\Package Control.py", line 1339, in install_package File ".\Package Control.py", line 1007, in download_url File ".\Package Control.py", line 602, in download File ".\urllib2.py", line 126, in urlopen File ".\urllib2.py", line 391, in open File ".\urllib2.py", line 409, in _open File ".\urllib2.py", line 369, in _call_chain File ".\Package Control.py", line 92, in https_open File ".\urllib2.py", line 1133, in do_open File ".\httplib.py", line 910, in request File ".\httplib.py", line 947, in _send_request File ".\httplib.py", line 904, in endheaders File ".\httplib.py", line 776, in _send_output File ".\httplib.py", line 735, in send File ".\Package Control.py", line 71, in connect File ".\ssl.py", line 350, in wrap_socket File ".\ssl.py", line 113, in __init UnicodeEncodeError: 'ascii' codec can't encode character u'\u0161' in position 36: ordinal not in range(128)

// Win XP SP3, i tried latest dev build 2195, latest stable build 2181 but same thing happens.

Sh4d0Wx avatar Apr 21 '12 22:04 Sh4d0Wx

Are you behind a proxy? If yes, see #93 for details and #116 for a fix.

schlamar avatar May 23 '12 18:05 schlamar

I already fixed it, the problem was that path to my C:....\sublime text\packages had non-ascii characters in the user name (like C:\Users\čšžýúá etc.). So the quick fix for this is just to download the portable version and extract it somewhere else (I did E:\Sublime text) That way all the packages and stuff were loaded from that folder and not from application data folder, which caused the error.

Sh4d0Wx avatar May 24 '12 08:05 Sh4d0Wx

Ah, I see. The cause of this error is that sublime.packages_path() returns an Unicode string, which is in general no good idea on Windows. I think this issue should be forwarded to ST.

schlamar avatar May 24 '12 09:05 schlamar

However, you can fix it with sublime.packages_path().encode(sys.getfilesystemencoding())

schlamar avatar May 24 '12 09:05 schlamar

I don't think this issue is already fixed, you should reopen it.

schlamar avatar Jun 11 '12 06:06 schlamar

There is a testing version of Package Control available which should hopefully resolve this issue thanks to @ms4py. To test it, please:

  1. In Sublime Text, click the Preferences > Browse Packages… menu entry
  2. Browse up a folder and then into the Installed Packages folder
  3. Download http://sublime.wbond.net/testing/Package%20Control.sublime-package and copy it into the Installed Packages directory
  4. Restart Sublime Text

Please post back here with your results.

wbond avatar Jun 11 '12 12:06 wbond

Now works :) Thanks for new version.

ghost avatar Jun 16 '12 20:06 ghost

Yes, it works! Thanks!

mykolaharmash avatar Jun 16 '12 21:06 mykolaharmash

who can help me .....i tried istalling zen coding,and now my sublime text dosen't work...what should i do???please help

opris avatar May 09 '13 12:05 opris

@opris If your issues is with Sublime Text itself not starting, you should probably revert (http://www.sublimetext.com/docs/2/revert.html). If you have an issue with package control, please open a new issue.

wbond avatar May 09 '13 15:05 wbond

I have the same issue while installing new packages. Exception in thread Thread-13: Traceback (most recent call last): File ".\threading.py", line 532, in __bootstrap_inner File ".\package_control\package_installer.py", line 244, in run File ".\package_control\package_manager.py", line 477, in install_package File ".\ntpath.py", line 108, in join UnicodeDecodeError: 'ascii' codec can't decode byte 0xcf in position 9: ordinal not in range(128) The solution up cannot help me...

//win8 x64, and i download the portable version 2.0.2.

However, I try as #605 says, it works...

xiaochengzhong avatar Sep 24 '13 17:09 xiaochengzhong