Home Download Buy Blog Forum Support

Installing Sublime Text on a russian Windows 7

Installing Sublime Text on a russian Windows 7

Postby noncom on Sat Sep 01, 2012 5:31 am

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:

Code: Select all
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:
Code: Select all
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.
noncom
 
Posts: 4
Joined: Sat Sep 01, 2012 5:14 am

Re: Installing Sublime Text on a russian Windows 7

Postby xeno.by on Sat Sep 01, 2012 10:23 am

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?
xeno.by
 
Posts: 104
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: Installing Sublime Text on a russian Windows 7

Postby noncom on Sat Sep 01, 2012 2:15 pm

xeno.by wrote: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?


Sure, thanks! I will look for it and hope that it will come out-of-the-box with the next release!
noncom
 
Posts: 4
Joined: Sat Sep 01, 2012 5:14 am

Re: Installing Sublime Text on a russian Windows 7

Postby noncom on Sun Sep 02, 2012 4:11 pm

xeno.by wrote: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?

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: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=8585&p=35274&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:
Code: Select all
Running [u'coffee.cmd', u'-c', u'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)

obviously, the problem is at the line that encodes the thing:
Code: Select all
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..
noncom
 
Posts: 4
Joined: Sat Sep 01, 2012 5:14 am

Re: Installing Sublime Text on a russian Windows 7

Postby xeno.by on Sun Sep 02, 2012 8:19 pm

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.
xeno.by
 
Posts: 104
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland

Re: Installing Sublime Text on a russian Windows 7

Postby noncom on Tue Sep 04, 2012 7:50 am

xeno.by wrote: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.

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 :roll:

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..?
noncom
 
Posts: 4
Joined: Sat Sep 01, 2012 5:14 am

Re: Installing Sublime Text on a russian Windows 7

Postby madnomad on Tue Sep 04, 2012 8:59 am

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:
http://www.sublimetext.com/forum/viewtopic.php?f=3&t=8817
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.
madnomad
 
Posts: 18
Joined: Tue Aug 14, 2012 8:34 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 9 guests