Sublime Forum

Build system not working in windows

#1

Hello,

I cannot get any build system to work. I’ve tryed Python and it does not work. Created a PHP one and still nothing.

The error I get has to do with encoding conflicts.

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 0xe1 in position 1081: ordinal not in range(128)

Does anyone know how to solve this? Very annoying!!!

I’m using Windows 7 Ultimate in Portuguese and none of my files have any glyphs or accents.

Thanks.

0 Likes

Installing Sublime Text on a russian Windows 7
#2

What about filename or anywhere in environment PATH variable?

0 Likes

#3

Solved!

The trick is to change line 45 of exec.py to:

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

I saw this at this topic: viewtopic.php?f=3&t=2441&p=11152&hilit=getfilesystemencoding#p11152

Great tip from the user sadhomer.

Indeed it had to do with encoding of PATH variables, there was ONE stupid variable with an accent.

Bloody different encodings!!!

Thanks for the help anyway, I will spread the word, it seems to be a common problem for other users as well.

0 Likes

#4

Oh boy you just saved me with this line of code ! This is absolutely terrific, thank you so much !

0 Likes

#5

I also had an issue with the encoding of the direct path to items. This solved it:

clean_arg_list = ] for arg in arg_list: if type(arg) == unicode: clean_arg_list.append(arg.encode(sys.getfilesystemencoding())) arg_list = clean_arg_list
I inserted it right after this bloc (line 45):

proc_env = os.environ.copy() proc_env.update(env) for k, v in proc_env.iteritems(): #proc_env[k] = os.path.expandvars(v).encode(sys.getfilesystemencoding()) proc_env[k] = os.path.expandvars(v.decode(sys.getfilesystemencoding())).encode(sys.getfilesystemencoding())

0 Likes