Home Download Buy Blog Forum Support

Build System Traceback

Build System Traceback

Postby schmiidt on Thu Jul 14, 2011 10:01 am

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

Code: Select all
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?
schmiidt
 
Posts: 20
Joined: Wed Oct 07, 2009 12:50 pm

Re: Build System Traceback

Postby guillermooo on Thu Jul 14, 2011 10:15 am

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.
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am

Re: Build System Traceback

Postby schmiidt on Thu Jul 14, 2011 7:51 pm

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 ;-)

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.
schmiidt
 
Posts: 20
Joined: Wed Oct 07, 2009 12:50 pm

Re: Build System Traceback

Postby guillermooo on Thu Jul 14, 2011 8:08 pm

Code: Select all
        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.
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am

Re: Build System Traceback

Postby schmiidt on Fri Jul 15, 2011 9:19 am

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?
schmiidt
 
Posts: 20
Joined: Wed Oct 07, 2009 12:50 pm

Re: Build System Traceback

Postby guillermooo on Fri Jul 15, 2011 9:52 am

I would suspect the script isn't decoding the data properly when first read, but I haven't finished reading my Unicode book yet. :D 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?
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am

Re: Build System Traceback

Postby schmiidt on Fri Jul 15, 2011 10:45 am

You are right, I don't need them. I'm building for the first time from within Sublime 2, yeeha ;-)
schmiidt
 
Posts: 20
Joined: Wed Oct 07, 2009 12:50 pm

Re: Build System Traceback

Postby sadhomer on Thu Aug 11, 2011 9:48 am

Multibyte character set (MBCS)
Code: Select all
        for k, v in proc_env.iteritems():
            try:
                proc_env[k] = os.path.expandvars(v.decode(sys.getfilesystemencoding())).encode(sys.getfilesystemencoding())
sadhomer
 
Posts: 1
Joined: Tue Aug 09, 2011 12:51 pm

Re: Build System Traceback

Postby murphyslaw on Thu Mar 01, 2012 7:28 pm

Thank you!

That line just fixed an issue for me I had with the package "Shell-Turtlestein".
murphyslaw
 
Posts: 1
Joined: Thu Mar 01, 2012 7:25 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 21 guests