r - SublimeREPL: OSError: [WinError 6] 句柄无效
问题描述
我在 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
解决方案
基于这个线程,我通过设置返回 True 而不是is_alive
调用.subprocess_repl.py
self.popen.poll()
def is_alive(self):
# return self.popen.poll() is None
return True
推荐阅读
- highcharts - Highcharts - 有没有办法为某些元素禁用样式模式?
- sql - 如何使用 PIVOT 按日期排列数据
- grafana - 如何在没有 gpcc 和 gpperfmon 的情况下收集 greenplum 监视器指标
- java - 如何测量 Kamon 在 Prometheus 上的 WSClient 请求的处理时间?
- android-studio - 使用 Android Studio/Intellij 在 Find Usage 搜索中隐藏自动生成的 Hilt 类
- python - django / 将多个模型传递给我的 ListView
- debian - 将 debian 包上传到启动板 ppa 时添加了更改日志
- reactjs - 如何在变量中呈现 html 标签(或新行)?
- python - 删除 .ppm 文件的元组括号
- amazon-s3 - delta 0.8.0 与 minio S3 存储桶写入异常和有关架构实施的问题