Sublime Forum

Installing Sublime Text on a russian Windows 7

#1

I had to install Sublime Text 2.0.1 on a Winsows system under a user with a cyrillic name. After I launch the editor, the console output is this:

startup cache, total files: 96 cache hits: 96 startup time: 3.18737 (package setup was not run) loaded 837 snippets Exception in thread Thread-1: Traceback (most recent call last): File ".\threading.py", line 532, in __bootstrap_inner File ".\Package Control.py", line 2378, in run File ".\Package Control.py", line 1686, in record_usage 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-16: ordinal not in range(128)
As one of the consequences of that - I can install the Package Manager, but using its “install package” command fails silently (or maybe with the same error trace), so it is a pretty severe thing. Maybe it brings more complications but I have not explored any further.

So… this is not a deadly problem - another user account with a latin name can be created, but this is an inconvinience… especially with all those user settings and such.

UPDATE:
Same machine, but now user with only latin symbols in his name: Package Manager works fine, however, when I try to build a CoffeeScript source, I get this:

Writing file /C/programming/_projects_/hw.coffee with encoding UTF-8 Running coffee.cmd -c C:\programming\_projects_\hw.coffee Traceback (most recent call last): File ".\sublime_plugin.py", line 337, in run_ File ".\exec.py", line 154, in run File ".\exec.py", line 45, in __init__ UnicodeDecodeError: 'ascii' codec can't decode byte 0xca in position 0: ordinal not in range(128)
I did not have this problem on a machine with english Windows 7.

0 Likes

#2

This very problem with the builder was already brought up one of these days. The solution was to patch Default/exec.py. Unfortunately I don’t have time to look for the answer right now, maybe you could take a look yourself?

0 Likes

#3

Sure, thanks! I will look for it and hope that it will come out-of-the-box with the next release!

0 Likes

#4

I have examined all that. The proposed solution does not quite work out for me. The problem has more than that. I have been loking here: https://forum.sublimetext.com/t/sublime-text-2-build-system-encoding-issue/6769/1&hilit=Default%2Fexec.py#p35274.

Here what I get after applying the proposed solution, I can’t unserstand what to change in the code to make it work:

Running Traceback (most recent call last): File ".\sublime_plugin.py", line 337, in run_ File ".\exec.py", line 154, in run File ".\exec.py", line 45, in __init__ UnicodeDecodeError: 'ascii' codec can't decode byte 0xca in position 0: ordinal not in range(128)
obviously, the problem is at the line that encodes the thing:

proc_env[k] = os.path.expandvars(v).encode(sys.getfilesystemencoding())

but I do not program on python so I do not know waht to do…

0 Likes

#5

Could you post your exec.py as a gist please? Also, why does the error say “error encoding”, whereas the line you showed calls enclode? My knowledge of Python is poor, but I’ll try to help.

0 Likes

#6

Thanks for the try! Here it is, the gist: https://gist.github.com/3617036. I am not sure why is the error and what it means, so I was just guessing and might be wrong :unamused:

The additional info that I can provide is that 0xCA, which is 202 in dec, is the capital letter “K” in russian ascii… if that even matters (http://yurika.ru/wp-content/uploads/2012/06/kodirovka.gif) and the capital “K” can be the first letter of “Computer” (Компьютер) or the username “Kristina” (Кристина). But this my try is already under a specially created user with a fully latin name (Fowler). So not sure what’s wrong… maybe here is someone who programs python much and can give a hint…?

0 Likes

#7

There must be some non-ascii letters in your environment PATH.
If you can’t change that, then you’ll have to fix exec.py to stop crashes. As described in these topics:
https://forum.sublimetext.com/t/build-system-not-working-in-windows/6957/1
although I think that decode/encode dance doesn’t do much beyond stopping exec.py from crashing, because Python doesn’t really support unicode strings in expandvars.

0 Likes