Skip to content

SublimeREPL broken, due invalid handle error when calling subprocess.Popen().poll() #6091

@deathaxe

Description

@deathaxe

Description of the bug

Latest dev builds (ST4153/4154) break SublimeREPL package. I just had a hard time trying to reproduce a users error, because sending text to a REPL failed with WinError 6.

Exactly the same procedure works in ST4143. (Haven't checked 4152)

Steps to reproduce

  1. Setup a new portable ST instance (SAFE MODE is not possible as SublimeREPL needs restart)
  2. Install Package Control
  3. Install SublimeREPL
  4. Restart ST
  5. Call "SublimeREPL: Python" from command palette (python must be installed and accessible via path)
  6. Create a dummy.py with a single line print("me") and save it.
  7. With that file focused hit ctrl+,, f key sequence to send file content to the repl.

Expected behavior

  1. Content of the debug.py is executed.
  2. REPL displays result.

That's what ST4143 does.

Actual behavior

ST4153/54 however displays a WinError 6, while checking for alive interpreters.

Traceback (most recent call last):
  File "C:\Apps\Sublime Text 4153\Lib\python33\sublime_plugin.py", line 1488, in run_
    return self.run(edit, **args)
  File "C:\Apps\Sublime Text 4153\Data\Packages\SublimeREPL\text_transfer.py", line 141, in run
    for rv in manager.find_repl(external_id):
  File "C:\Apps\Sublime Text 4153\Data\Packages\SublimeREPL\sublimerepl.py", line 470, in find_repl
    if not (rv.repl and rv.repl.is_alive()):
  File "C:\Apps\Sublime Text 4153\Data\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] Das Handle ist ungültig

I can however successfully call the following in ST's console:

>>> import subprocess;p = subprocess.Popen(["python"], bufsize=0, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, stdout=subprocess.PIPE); p.poll()

Sublime Text build number

4153

Operating system & version

Windows 11

(Linux) Desktop environment and/or window manager

No response

Additional information

No response

OpenGL context information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions