New issue 3003: Unable to launch pdb from subprocess reader thread
https://bitbucket.org/pypy/pypy/issues/3003/unable-to-launch-pdb-from-subprocess

Andrew Lawrence:

While attempting to debug SpawnCmdLineTest.test_basic_script I placed a call to 
pdb inside the readerthread in subprocess.py

def _readerthread(self, fh, buffer):
            import pdb; pdb.set_trace()
            buffer.append(fh.read())
            fh.close()

When running the test both reader threads used to communicate with the 
subprocess raised the following exception:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\pypy\lib-python\3\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:\pypy\lib-python\3\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "C:\pypy\lib-python\3\subprocess.py", line 1083, in _readerthread
    buffer.append(fh.read())
  File "C:\pypy\lib-python\3\bdb.py", line 48, in trace_dispatch
    return self.dispatch_line(frame)
  File "C:\pypy\lib-python\3\bdb.py", line 66, in dispatch_line
    self.user_line(frame)
  File "C:\pypy\lib-python\3\pdb.py", line 261, in user_line
    self.interaction(frame, None)
  File "C:\pypy\lib-python\3\pdb.py", line 344, in interaction
    signal.signal(signal.SIGINT, Pdb._previous_sigint_handler)
  File "C:\pypy\lib-python\3\signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread or with __pypy__.thread.enable_sign
als()


_______________________________________________
pypy-issue mailing list
pypy-issue@python.org
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to