UnicodeEncodeError while installing new packages #117

Closed
nik-garmash opened this Issue Apr 1, 2012 · 13 comments

Comments

6 participants

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

Sh4d0Wx commented Apr 21, 2012

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 commented Apr 21, 2012

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.

Contributor

schlamar commented May 23, 2012

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

Sh4d0Wx commented May 24, 2012

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.

Contributor

schlamar commented May 24, 2012

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.

Contributor

schlamar commented May 24, 2012

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

Contributor

schlamar commented Jun 11, 2012

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

@nik-garmash nik-garmash reopened this Jun 11, 2012

Owner

wbond commented Jun 11, 2012

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.

@ghost

ghost commented Jun 16, 2012

Now works :)
Thanks for new version.

Yes, it works! Thanks!

opris commented May 9, 2013

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

Owner

wbond commented May 9, 2013

@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.

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment