jupyter/terminado

Python 3.8 and get_pid : failure

SnarkBoojum opened this issue · 1 comments

The terminado package for Debian fails with Python 3.8.6 ; you'll see here the full log, but here is the end:

ERROR: test_max_terminals (terminado.tests.basic_test.NamedTermTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/tornado/testing.py", line 98, in __call__
    result = self.orig_method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/tornado/testing.py", line 594, in post_coroutine
    return self.io_loop.run_sync(
  File "/usr/lib/python3/dist-packages/tornado/ioloop.py", line 532, in run_sync
    return future_cell[0].result()
  File "/usr/lib/python3/dist-packages/tornado/gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "/tmp/autopkgtest-lxc.lx8y8pgy/downtmp/build.JHO/src/terminado/tests/basic_test.py", line 216, in test_max_terminals
    pids = yield self.get_pids(tms)
  File "/usr/lib/python3/dist-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/usr/lib/python3/dist-packages/tornado/gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "/tmp/autopkgtest-lxc.lx8y8pgy/downtmp/build.JHO/src/terminado/tests/basic_test.py", line 127, in get_pids
    pid = yield tm.get_pid()
  File "/usr/lib/python3/dist-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/usr/lib/python3/dist-packages/tornado/gen.py", line 748, in run
    yielded = self.gen.send(value)
  File "/tmp/autopkgtest-lxc.lx8y8pgy/downtmp/build.JHO/src/terminado/tests/basic_test.py", line 98, in get_pid
    pid = int(stdout.split('\n')[1])
ValueError: invalid literal for int() with base 10: '\x1b[?2004l\r3257\r'

Looking at that function get_pid, it looks like it expects something special when os.name=='nt', and something quite trivial otherwise, but that's not what it actually gets. I'll try to dig around to understand the issue better.

I got around the error patching trivially, but it's obviously not a proper fix :
fix_975241.txt