首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SublimeREPL: OSError:[WinError 6]句柄无效

SublimeREPL: OSError:[WinError 6]句柄无效
EN

Stack Overflow用户
提问于 2018-07-28 02:39:48
回答 1查看 563关注 0票数 0

我在SublimeREPL中使用R,但无法将代码发送到R会话。下面是我正在使用的键绑定:

代码语言:javascript
复制
{ "keys": ["ctrl+enter"], "command": "repl_transfer_current", "args": {"scope": "selection"}},
{ "keys": ["ctrl+enter"], "command": "repl_transfer_current", "args": {"scope": "selection", "action":"view_write"}},

{ "keys": ["ctrl+alt+enter"], "command": "repl_transfer_current", "args": {"scope": "lines"}},
{ "keys": ["ctrl+alt+enter"], "command": "repl_transfer_current", "args": {"scope": "lines", "action":"view_write"}},

下面是Sublime的日志:

代码语言:javascript
复制
command: repl_transfer_current {"action": "view_write", "scope": "selection"}
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 1066, in run_
    return self.run(edit, **args)
  File "C:\Users\~\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\text_transfer.py", line 132, in run
    for rv in manager.find_repl(external_id):
  File "C:\Users\~\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\sublimerepl.py", line 470, in find_repl
    if not (rv.repl and rv.repl.is_alive()):
  File "C:\Users\~\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\repls\subprocess_repl.py", line 209, in is_alive
    return self.popen.poll() is None
  File "./python3.3/subprocess.py", line 930, in poll
  File "./python3.3/subprocess.py", line 1145, in _internal_poll
OSError: [WinError 6] The handle is invalid
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-07-30 22:51:55

基于this线程,我将subprocess_repl.py中的is_alive设置为返回True,而不是调用self.popen.poll(),从而解决了这个问题。

代码语言:javascript
复制
def is_alive(self):
    # return self.popen.poll() is None
    return True
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51563763

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档