当我尝试使用SublimeREPL将Sublime Text 3中的代码提交给python3解释器(我使用的是3.2.3)时,我收到以下错误:
>>> x = -9
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' does not support the buffer interface
>>>
(我在Ubuntu 12.04; Sublime Text 3 Build 3047。)
如果我使用python-2.x解释器
,则不会出现错误其他人遇到了同样的问题并在SublimeREPL github中打开了一个问题,但它被标记为不可重复。谁能指出我正确的方向摆脱这个?
我是Sublime Text的新手,所以也许我正在做一些其他愚蠢的事情。这是我用来启动python3的菜单命令(我试过缓冲和非缓冲):
{"command": "repl_open",
"caption": "Python3",
"id": "repl_python3",
"mnemonic": "p",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["python3", "-i", "-u"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
}
}