Linux under Sublime compile times unicodedecodeerror: Error

Source: Internet
Author: User
Tags sublime text

Article reference: http://eric.themoritzfamily.com/python-encodings-and-unicode.html

http://desert3.iteye.com/blog/757508

Https://github.com/misfo/Shell-Turtlestein/issues/6

http://www.sublimetext.com/forum/viewtopic.php?f=3&t=2610

Https://github.com/uipoet/sublime-jshint/issues/24

Http://www.sublimetext.com/forum/viewtopic.php?f=3&t=2441&start=0&hilit=getfilesystemencoding (*)

The complete error is:

Traceback (most recent):
File ". \sublime_plugin.py", line 325, in Run_
File ". \exec.py", line 145, in run
File ". \exec.py", line __init__
Unicodedecodeerror: ' ASCII ' codec can ' t decode byte 0xc0 in position 9:ordinal not in range (128)

Many of these articles have duplicate content, I mainly look at the back of the mark * of the article;

The cause of this problem is that exec.py in the Packages\default directory under the profile directory is editing the environment variable, but the character set in the environment variable does not have the ASCII character set

My solution (6th above):

Locate the Profile directory location (refer to my other blog post to modify the default profile location for sublime Text )

One of the packages\default\exec.py, open edit

Find 第41-42 Line:

For K, V in Proc_env.iteritems ():

Proc_env[k] = Os.path.expandvars (v). Encode (sys. Getfilesystemencoding())

Two modification scenarios:

1, decisively deleted! (You read it right, that's it)

2, the exception handling it, to avoid it when the error stops the program to run like this:

      for K, V in Proc_env.iteritems ():
            Try:
    &NBSP ;           PROC_ENV[K] = Os.path.expandvars (v). Encode (Sys.               & nbsp Print "VARIABLE:", K, ":", v

Then you are trying to compile the Pyhon or other programs, you will find that the cut is normal!


Linux under Sublime compile times unicodedecodeerror: Error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.