Home Download Buy Blog Forum Support

Decoding error when running build

Decoding error when running build

Postby haruki_zaemon on Wed Aug 03, 2011 3:00 pm

I have a prompt, PS1, environment variable containing a unicode character (\u2192). This is causing ST2 to barf with a decode error:

Traceback (most recent call last):
File "./sublime_plugin.py", line 230, in run_
File "./exec.py", line 145, in run
File "./exec.py", line 42, in __init__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 109: ordinal not in range(128)

The offending line appears to be inside code that is attempting to expand path variables in ALL environment variables as such:

os.path.expandvars(v).encode(sys.getfilesystemencoding())

which ends up executing the equivalent of:

os.path.expandvars("➜").encode("utf-8")

which goes boom!

Cheers,
Simon
haruki_zaemon
 
Posts: 4
Joined: Wed Aug 03, 2011 2:28 am

Re: Decoding error when running build

Postby haruki_zaemon on Wed Aug 03, 2011 3:34 pm

To follow up. Changing the line to:

os.path.expandvars(path).encode(sys.getfilesystemencoding())

gets a little further on before crapping out with a different error:

Traceback (most recent call last):
File "./sublime_plugin.py", line 230, in run_
File "./exec.py", line 145, in run
File "./exec.py", line 45, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
raise child_exception
UnicodeEncodeError: 'ascii' codec can't encode character u'\u279c' in position 109: ordinal not in range(128)
haruki_zaemon
 
Posts: 4
Joined: Wed Aug 03, 2011 2:28 am

Re: Decoding error when running build

Postby jfsantos on Thu Sep 01, 2011 6:41 pm

I have found a similar error under Windows, when trying to build with any build system available.

Here goes the traceback:

Traceback (most recent call last):
File ".\sublime_plugin.py", line 257, in run_
File ".\exec.py", line 145, in run
File ".\exec.py", line 42, in __init__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 649: ordinal not in range(128)

I cannot use build systems under Sublime Text since I updated to Build 2111. Please, help!
jfsantos
 
Posts: 2
Joined: Thu Sep 01, 2011 6:39 pm

Re: Decoding error when running build

Postby guillermooo on Thu Sep 01, 2011 9:52 pm

guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Decoding error when running build

Postby jfsantos on Fri Sep 02, 2011 4:24 pm



I could not find a file named exec.py at the described location, but found an environment variable that hat Unicode characters. Removing it fixes temporarily the issue, but I would like to make a more permanent fix.

Thanks!
jfsantos
 
Posts: 2
Joined: Thu Sep 01, 2011 6:39 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 10 guests