if set console_encoding , cause exception.
exception as below. when i click a file of svn. the sublime console show this error. have try set console_encoding to gbk or gb2312 even utf_8.
Exception in thread Thread-17:
Traceback (most recent call last):
File "./threading.py", line 901, in _bootstrap_inner
File "Modific in D:\SmallTools\Sublime3\Data\Installed Packages\Modific.sublime-package", line 172, in run
File "./subprocess.py", line 824, in __init__
File "./subprocess.py", line 1071, in _execute_child
File "./subprocess.py", line 632, in list2cmdline
TypeError: Type str doesn't support the buffer API
@clijiac , could you provide more info?
- File content, so I can reproduce the issue
- Sublime Text version
- Can you reproduce this on all SVN files? What about Git? Can you narrow down the environment in which the issue occurs?
- even a new empty txt file .
- sublime 3 3095
- all file in the project folder(have .svn in it). even not svn file .when load and save will show this exception, I just new a empty txt in the folder and open it ..still
- seems git also have this issue
I'll try to take a look at this issue next week.
do not know much about python and sublime plugin. but I have done some reasearch. hope this may help you:) change code from line 165. add some print to see info
print(self.console_encoding)
print(self.command)
if self.console_encoding:
self.command = [s.encode(self.console_encoding) for s in self.command]
print(self.command)
print(self.command,self.stdout,shell,subprocess.STDOUT,subprocess.PIPE,subprocess)
proc = subprocess.Popen(self.command,
stdout=self.stdout, stderr=subprocess.STDOUT,
stdin=subprocess.PIPE,
shell=shell, universal_newlines=False)
print(self.stdin,proc.communicate(self.stdin))
here is the output with console_encoding
Modific: run command: svn diff --internal-diff addsportleague.js gb2312 ['svn', 'diff', '--internal-diff', 'addsportleague.js'] [b'svn', b'diff', b'--internal-diff', b'addsportleague.js'] [b'svn', b'diff', b'--internal-diff', b'addsportleague.js'] -1 True -2 -1 <module 'subprocess' from 'D:\\SmallTools\\Sublime3\\python3.3.zip\\subprocess.pyo'> Exception in thread Thread-131: Traceback (most recent call last): File "./threading.py", line 901, in _bootstrap_inner File "D:\SmallTools\Sublime3\Data\Packages\Modific\Modific.py", line 176, in run shell=shell, universal_newlines=False) File "./subprocess.py", line 824, in __init__ File "./subprocess.py", line 1071, in _execute_child File "./subprocess.py", line 632, in list2cmdline TypeError: Type str doesn't support the buffer APIhere is the output without console_encoding ,delete some diff info of my project code .this condition looks good
['svn', 'diff', '--internal-diff', 'addsportleague.js'] ['svn', 'diff', '--internal-diff', 'addsportleague.js'] ['svn', 'diff', '--internal-diff', 'addsportleague.js'] -1 True -2 -1 <module 'subprocess' from 'D:\\SmallTools\\Sublime3\\python3.3.zip\\subprocess.pyo'> None (b"Index: addsportleague.js\r\n===================================================================\r\n--- addsportleague.js\t(revision 0)\ ===================================================================
I looked into it, but could not figure out what may cause that issue.
Why do you need to set console_encoding? What happens if you don't set it?