Breakpoints in subprocesses do not work. Misconfiguration or a bug?
Dear Sir or Madam,
I have a project, where Starter.py calls subprocess.Popen for the DirectSubprocess.py. The breakpoints in Starter.py work, in DirectSubprocess they do not work.
I have enabled "attach to subprocess automatically ..."
I am using v 3.4.1.
PYCHARM_DEBUG=1 gives the following output:
I have a project, where Starter.py calls subprocess.Popen for the DirectSubprocess.py. The breakpoints in Starter.py work, in DirectSubprocess they do not work.
I have enabled "attach to subprocess automatically ..."
I am using v 3.4.1.
import subprocess dir_sub_path = "./DirectSubprocess.py" direct_sub = subprocess.Popen(dir_sub_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = direct_sub.communicate() print(stdout)
PYCHARM_DEBUG=1 gives the following output:
/opt/python-2.7/bin/python /export/home/zakharov/pycharm/pycharm-community-3.4.1/helpers/pydev/pydevd.py --multiproc --client 127.0.0.1 --port 57987 --file /export/home/zakharov/try/pycharm_sub/Starter.py
Started in multiproc mode
('Connecting to ', '127.0.0.1', ':', '57987')
('Connected.',)
received >>99 -1 34288
<<
Received command: ??? 99 -1 34288
Received port 34288
pydev debugger: process 36165 is connecting
('Connecting to ', '127.0.0.1', ':', '34288')
('Connected.',)
received >>501 1 0.1 UNIX
<<
Received command: CMD_VERSION 501 1 0.1 UNIX
Connected to pydev debugger (build 135.1057)
sending cmd --> CMD_VERSION 501 1 @@BUILD_NUMBER@@
received >>111 3 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 47 None None
<<
Received command: CMD_SET_BREAK 111 3 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 47 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/Starter.py - line:47 - func_name:None
received >>111 5 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 44 None None
111 7 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 43 None None
111 9 python-line /export/home/zakharov/try/pycharm_sub/Indirect subprocess.py 46 None None
111 11 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 46 None None
122 13 BaseException 0 1
101 15
<<
Received command: CMD_SET_BREAK 111 5 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 44 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/Starter.py - line:44 - func_name:None
Received command: CMD_SET_BREAK 111 7 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 43 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/DirectSubprocess.py - line:43 - func_name:None
Received command: CMD_SET_BREAK 111 9 python-line /export/home/zakharov/try/pycharm_sub/Indirect subprocess.py 46 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/Indirect subprocess.py - line:46 - func_name:None
Received command: CMD_SET_BREAK 111 11 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 46 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/DirectSubprocess.py - line:46 - func_name:None
Received command: CMD_ADD_EXCEPTION_BREAK 122 13 BaseException 0 1
Exceptions to hook on terminate: {u'BaseException': <pydevd_breakpoints.ExceptionBreakpoint instance at 0x21c1440>}
Received command: CMD_RUN 101 15
sending cmd --> CMD_THREAD_CREATE 103 2 <xml><thread name="pydevd.reader" id="-1"/></xml>
sending cmd --> CMD_THREAD_CREATE 103 4 <xml><thread name="pydevd.writer" id="-1"/></xml>
sending cmd --> CMD_THREAD_CREATE 103 6 <xml><thread name="MainThread" id="pid36165_seq1" /></xml>
sending cmd --> CMD_THREAD_SUSPEND 105 8 <xml><thread id="pid36165_seq1" stop_reason="111" message="None"><frame id="15409936" name="<module>" file="/export/home/zakharov/try/pycharm_sub/Starter.py" line="44">"</frame><frame id="36008320" name="run" file="/export/home/zakharov/pycharm/pycharm-community-3.4.1/helpers/pydev/pydevd.py" line="1226">"</frame><frame id="15477888" name="<module>" file="/export/home/zakharov/pycharm/pycharm-community-3.4.1/helpers/pydev/pydevd.py" line="1733">"</frame></thread></xml>
Starter starting
received >>114 17 pid36165_seq1 15409936 FRAME
<<
Received command: CMD_GET_FRAME 114 17 pid36165_seq1 15409936 FRAME
('processing internal command ', '<pydevd_comm.InternalGetFrame instance at 0x21c1488>')
sending cmd --> CMD_GET_FRAME 114 17 <xml><var name="__builtins__" type="module" value="module: <module '__builtin__' (built-in)>" isContainer="True" /> <var name="__doc__" type="str" value="str: Script docstring goes here " /> <var name="__file__" type="str" value="str: /export/home/zakharov/try/pycharm_sub/Starter.py" /> <var name="__name__" type="str" value="str: __main__" /> <var name="__package__" type="NoneType" value="NoneType: None" /> <var name="dir_sub_path" type="str" value="str: ./DirectSubprocess.py" /> <var name="os" type="module" value="module: <module 'os' from '/opt/python-2.7/lib/python2.7/os.pyc'>" isContainer="True" /> <var name="subprocess" type="module" value="module: <module 'subprocess' from '/opt/python-2.7/lib/python2.7/subprocess.pyc'>" isContainer="True" /> </xml>
received >>111 19 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 47 None None
<<
Received command: CMD_SET_BREAK 111 19 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 47 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/Starter.py - line:47 - func_name:None
received >>106 21 pid36165_seq1
<<
Received command: CMD_THREAD_RUN 106 21 pid36165_seq1
('processing internal command ', '<pydevd_comm.InternalRunThread instance at 0x21c1d88>')
('Connecting to ', '127.0.0.1', ':', '57987')
('Connected.',)
received >>99 -1 39720
<<
Received command: ??? 99 -1 39720
('Connecting to ', '127.0.0.1', ':', '39720')
('Connected.',)
received >>501 1 0.1 UNIX
<<
Received command: CMD_VERSION 501 1 0.1 UNIX
sending cmd --> CMD_VERSION 501 1 @@BUILD_NUMBER@@
received >>111 23 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 47 None None
<<
received >>111 3 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 47 None None
<<
Received command: CMD_SET_BREAK 111 23 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 47 None None
Received command: CMD_SET_BREAK 111 3 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 47 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/Starter.py - line:47 - func_name:None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/Starter.py - line:47 - func_name:None
received >>111 25 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 44 None None
111 27 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 43 None None
111 29 python-line /export/home/zakharov/try/pycharm_sub/Indirect subprocess.py 46 None None
111 31 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 46 None None
122 33 BaseException 0 1
<<
Received command: CMD_SET_BREAK 111 25 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 44 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/Starter.py - line:44 - func_name:None
Received command: CMD_SET_BREAK 111 27 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 43 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/DirectSubprocess.py - line:43 - func_name:None
Received command: CMD_SET_BREAK 111 29 python-line /export/home/zakharov/try/pycharm_sub/Indirect subprocess.py 46 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/Indirect subprocess.py - line:46 - func_name:None
Received command: CMD_SET_BREAK 111 31 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 46 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/DirectSubprocess.py - line:46 - func_name:None
Received command: CMD_ADD_EXCEPTION_BREAK 122 33 BaseException 0 1
Exceptions to hook on terminate: {u'BaseException': <pydevd_breakpoints.ExceptionBreakpoint instance at 0x21c1758>}
sending cmd --> CMD_THREAD_RUN 106 10 pid36165_seq1 None
received >>111 5 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 44 None None
111 7 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 43 None None
111 9 python-line /export/home/zakharov/try/pycharm_sub/Indirect subprocess.py 46 None None
111 11 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 46 None None
122 13 BaseException 0 1
101 15
<<
Received command: CMD_SET_BREAK 111 5 python-line /export/home/zakharov/try/pycharm_sub/Starter.py 44 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/Starter.py - line:44 - func_name:None
Received command: CMD_SET_BREAK 111 7 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 43 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/DirectSubprocess.py - line:43 - func_name:None
Received command: CMD_SET_BREAK 111 9 python-line /export/home/zakharov/try/pycharm_sub/Indirect subprocess.py 46 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/Indirect subprocess.py - line:46 - func_name:None
Received command: CMD_SET_BREAK 111 11 python-line /export/home/zakharov/try/pycharm_sub/DirectSubprocess.py 46 None None
Added breakpoint:/export/home/zakharov/try/pycharm_sub/DirectSubprocess.py - line:46 - func_name:None
Received command: CMD_ADD_EXCEPTION_BREAK 122 13 BaseException 0 1
Exceptions to hook on terminate: {u'BaseException': <pydevd_breakpoints.ExceptionBreakpoint instance at 0x21c3f38>}
Received command: CMD_RUN 101 15
sending cmd --> CMD_THREAD_CREATE 103 12 <xml><thread name="pydevd.reader" id="-1"/></xml>
sending cmd --> CMD_THREAD_CREATE 103 14 <xml><thread name="pydevd.writer" id="-1"/></xml>
sending cmd --> CMD_THREAD_SUSPEND 105 12 <xml><thread id="pid36165_seq1" stop_reason="111" message="None"><frame id="15409936" name="<module>" file="/export/home/zakharov/try/pycharm_sub/Starter.py" line="47">"</frame><frame id="36008320" name="run" file="/export/home/zakharov/pycharm/pycharm-community-3.4.1/helpers/pydev/pydevd.py" line="1226">"</frame><frame id="15477888" name="<module>" file="/export/home/zakharov/pycharm/pycharm-community-3.4.1/helpers/pydev/pydevd.py" line="1733">"</frame></thread></xml>
received >>114 35 pid36165_seq1 15409936 FRAME
<<
Received command: CMD_GET_FRAME 114 35 pid36165_seq1 15409936 FRAME
('processing internal command ', '<pydevd_comm.InternalGetFrame instance at 0x21c13b0>')
sending cmd --> CMD_GET_FRAME 114 35 <xml><var name="__builtins__" type="module" value="module: <module '__builtin__' (built-in)>" isContainer="True" /> <var name="__doc__" type="str" value="str: Script docstring goes here " /> <var name="__file__" type="str" value="str: /export/home/zakharov/try/pycharm_sub/Starter.py" /> <var name="__name__" type="str" value="str: __main__" /> <var name="__package__" type="NoneType" value="NoneType: None" /> <var name="dir_sub_path" type="str" value="str: ./DirectSubprocess.py" /> <var name="direct_sub" type="Popen" value="Popen: <subprocess.Popen object at 0x21c2510>" isContainer="True" /> <var name="os" type="module" value="module: <module 'os' from '/opt/python-2.7/lib/python2.7/os.pyc'>" isContainer="True" /> <var name="stderr" type="str" value="str: Patching args: ['./DirectSubprocess.py'] Process is not python, returning. Patching args: ['./DirectSubprocess.py'] Process is not python, returning. " /> <var name="stdout" type="str" value="str: Direct subprocess starting 4950 Indirect subprocess starting 4950 Indirect subprocess done Direct Subprocess done " /> <var name="subprocess" type="module" value="module: <module 'subprocess' from '/opt/python-2.7/lib/python2.7/subprocess.pyc'>" isContainer="True" /> </xml>
Please sign in to leave a comment.