Textmate 的 Python 执行行/选择已损坏
我已经使用 python 的 textmate 几个星期了,除了命令“以 Python 方式执行行/选择”之外,一切似乎都工作正常。它根本不起作用。尝试测试,即使
print "Hello World"
我
Traceback (most recent call last):
File "/tmp/temp_textmate.QrxfR3", line 19, in <module>
stdout.write(exc)
TypeError: argument 1 must be string or read-only character buffer, not list
尝试重新安装 textmate,但仍然遇到相同的错误。有什么想法吗????
我的 textmate 版本是版本 1.5.10 (1623)
谢谢,
阿尔贝托
I've been using textmate for python for a couple of weeks now, everything seems to be working fine apart from the command "Execute line/selection as Python". It does not work at all. Trying to test even
print "Hello World"
I get
Traceback (most recent call last):
File "/tmp/temp_textmate.QrxfR3", line 19, in <module>
stdout.write(exc)
TypeError: argument 1 must be string or read-only character buffer, not list
I tried to re-install textmate but still getting the same error. Any idea?????
my version of textmate is Version 1.5.10 (1623)
thanks,
Alberto
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里发生了两件事。第一个是“以 Python 方式执行行/选择”命令被破坏。您看到的异常是尝试检索调用堆栈时“以 Python 形式执行行/选择”实现中的错误造成的。为什么会发生这种情况有点装腔作势,我目前正在调查这一点。第二个问题是“以 Python 方式执行行/选择”的实现调用了 eval,它期望执行一个表达式,而不是一个语句,这会导致引发异常。
此答案假设您使用的是 Python 2.x。
There are two things going on here. The first is that the command "Execute line/selection as Python" is broken. The exception you're seeing is a consequence of a bug in the implementation of "Execute line/selection as Python" when trying to retrieve the call stack. Why this is happening is something of a poser, which I'm currently looking into. The second issue is that the implementation of "Execute line/selection as Python" calls
eval
which expects an expression to be executed, not a statement, which causes the exception to be raised.This answer assumes that you are using Python 2.x.