fabioz/PyDev.Debugger — pull request #26 by alangpierce (2014-12-27 09:16:22+00:00)
Title: Fix debugging across Popen in POSIX Python 3

I was writing some Python 3 code (in PyCharm on Mac OS) that was using
subprocess.Popen, and I noticed that breakpoints weren't triggering in the child
process, even though I had "Attach to subprocess automatically" enabled. It
turns out that subprocess.Popen was changed in Python 3 to use a new
_posixsubprocess.fork_exec function instead of os.fork/os.exec, so the monkey
patching code wasn't changing the args to make it run inside pydevd.

The fix was to add _posixsubprocess.fork_exec as another function that we patch
(if it exists).

To test this, I overwrote the file
/Applications/PyCharm.app/Contents/helpers/pydev/pydev_monkey.py with the
modified file and re-ran the debugging session, and it properly attached to the
child process. I also ran all of the unit tests in the repo.