【问题标题】:SublimeREPL: OSError: [WinError 6] The handle is invalidSublimeREPL: OSError: [WinError 6] 句柄无效
【发布时间】:2018-07-27 18:39:48
【问题描述】:

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

{ "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 的日志:

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

【问题讨论】:

    标签: r sublimetext3 sublimerepl


    【解决方案1】:

    基于this线程,我通过在subprocess_repl.py中设置is_alive返回True而不是调用self.popen.poll()来解决问题。

    def is_alive(self):
        # return self.popen.poll() is None
        return True
    

    【讨论】:

      猜你喜欢
      • 2022-08-23
      • 1970-01-01
      • 1970-01-01
      • 2021-11-24
      • 1970-01-01
      • 1970-01-01
      • 2017-02-27
      • 1970-01-01
      • 2018-05-12
      相关资源
      最近更新 更多