Sublime Forum

Build System Traceback

#1

I get the following traceback whenever I try to use the Build System in Sublime 2.

Running make 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 0xe6 in position 15: ordinal not in range(128)

How can I debug this issue?

0 Likes

Python environment problem
#2

What’s the version you’re using and what’s the path to your home dir?

You can simply look at exec.py in Packages/Default.

0 Likes

#3

Right now, I’m using build 2081. I’m running Windows XP on one machine and Vista on another machine. I get the same traceback on both machines.

The path to my home dir is “HOMEPATH=\Documents and Settings\asu” on my daughter’s PC that I have hijacked during our holiday :wink:

I know very little about python (and unicode for that matter), but sys.getfilesystemencoding() returns ‘mbcs’ on my daugther’s system. How do I debug the python script that causes the traceback? I have tried to use a printf-approach, but I see no output.

Sorry for being such an incompetent Sublime user.

0 Likes

#4

for k, v in proc_env.iteritems(): try: proc_env[k] = os.path.expandvars(v).encode(sys.getfilesystemencoding()) except UnicodeDecodeError: print "Encoding error..." print "VARIABLE: ", k, " : ", v

Replace line 41 in exec.py with something like the above (untested) and check the “print” output in the Python console (CTRL+` or View > Show Console). exec.py has been broken before due to encoding issues.

0 Likes

#5

Thank you very much.

Now I see the offending environment variables (COMMONPROGRAMFILES on one machine and CHROME_RESTART on another machine). Their values do indeed contain non-ascii character codes. How do I avoid that non-ascii character codes sneak into the environment? It seems a little hard to avoid, so should the script be able to handle non-ascii character codes?

0 Likes

#6

I would suspect the script isn’t decoding the data properly when first read, but I haven’t finished reading my Unicode book yet. :smiley: I suppose it can be fixed, but I can’t look into it now… As a workaround, you can skip those two for now, I don’t think you need them for any build system to work?

0 Likes

#7

You are right, I don’t need them. I’m building for the first time from within Sublime 2, yeeha :wink:

0 Likes

#8

Multibyte character set (MBCS)

        for k, v in proc_env.iteritems():
            try:
                proc_env[k] = os.path.expandvars(v.decode(sys.getfilesystemencoding())).encode(sys.getfilesystemencoding())
0 Likes

#9

Thank you!

That line just fixed an issue for me I had with the package “Shell-Turtlestein”.

0 Likes