Home > Article > Development Tools > Solve the problem that sublime ctrl b suddenly cannot be used
Sublime Text 2 ?ctrl b If the run is blank, press ctrl ` to display the error, as shown below, reproduced Article solution? Article reference:
http://eric.themoritzfamily.com/python-encodings-and-unicode.html http://desert3.iteye.com/blog/757508 https: //github.com/misfo/Shell-T
py is editing environment variables, but the character set in the environment variables does lack the ascii character set
My solution ( Refer to article 6 above):
Find the location of the configuration file directory (you can refer to my other blog post to modify the default configuration file location of sublime Text)
Packages\Default\exec .py, open and edit
and find lines 41-42:
for k, v in proc_env.iteritems(): ?proc_env[k] = os.path.expandvars(v).encode(sys.getfilesystemencoding())
Two modification options:
1. Delete decisively! (You read that right, that’s it)
2. Perform exception handling on it to avoid stopping the program when it makes an error, like this:
?? ? 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
Then you try to use python or other After compiling the program, you will find that everything is normal!
For more technical articles related to sublime, please visit the sublime column.
The above is the detailed content of Solve the problem that sublime ctrl b suddenly cannot be used. For more information, please follow other related articles on the PHP Chinese website!