rohanrhu / gdb-frontend

☕ GDBFrontend is an easy, flexible and extensible gui debugger. Try it on https://debugme.dev
https://oguzhaneroglu.com/projects/gdb-frontend/
GNU General Public License v3.0
2.79k stars 98 forks source link

Failure with Python 3.6: unexpected keyword argument 'capture_output' #41

Closed chipbuster closed 2 years ago

chipbuster commented 2 years ago

Hey there! I'm running gdbfrontend v0.10.0-beta on a system with Python 3.6. When attempting to run the gdbfrontend command, it crashes with the following output:

GDBFrontend v0.10.0-beta
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/u/theksong/.local/lib/python3.6/site-packages/gdbfrontend/__main__.py", line 22, in <module>
    spec.loader.exec_module(run)
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/u/theksong/.local/lib/python3.6/site-packages/gdbfrontend/run.py", line 308, in <module>
    proc = subprocess.run([gdb_executable, "--configuration"], capture_output=True)
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
Sending SIGKILL to PGID: 28463.
Stopped GDBFrontend.

I believe the issue is at run.py:308. The capture_output argument is not supported by subprocess in Python 3.6.. Replacing it with the following line (which I lifted from stackoverflow) gets rid of the error for me:

proc = subprocess.run([gdb_executable, "--configuration"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

I can open a PR for this if you'd like, but since it's only one line I figured it might be easier for you to deal with it.

rohanrhu commented 2 years ago

Hi, fixed. Thank you for reporting 🙂 Is there another issue with Python 3.6? I'm gonna release v0.10.1-beta if it is ok.

rohanrhu commented 2 years ago

I released a new version with this fix. Thank you again 🙂

rohanrhu commented 2 years ago

If you see another issue and know how to fix, please feel free to send a PR.