Sublime Forum

Decoding error when running build

#1

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

0 Likes

#2

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)

0 Likes

#3

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!

0 Likes

#4

Try this:

viewtopic.php?f=3&t=2441&p=11152&hilit=getfilesystemencoding#p11152

0 Likes

#5

[quote=“guillermooo”]Try this:

viewtopic.php?f=3&t=2441&p=11152&hilit=getfilesystemencoding#p11152[/quote]

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!

0 Likes