SonicParanoid crashes at the start when using Python3.6
Traceback (most recent call last):
File "/home/watanok10/src/sonic_135a3/bin/sonicparanoid", line 8, in <module>
sys.exit(main())
File "/home/watanok10/src/sonic_135a3/lib/python3.6/site-packages/sonicparanoid/sonic_paranoid.py", line 1013, in main
gccInfoTpl = check_gcc()
File "/home/watanok10/src/sonic_135a3/lib/python3.6/site-packages/sonicparanoid/sonic_paranoid.py", line 136, in check_gcc
rOut = subprocess.run("gcc -dumpversion", shell=True, capture_output=True)
File "/usr/local/lib/python3.6/subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
A simple fix for the user would to use at least python 3.7.
The error is caused by the python version being lower than 3.6 as the capture_output
parameter was introduced only in version 3.7.
possible solutions:
- Do not use
capture_output
- Drop Python versions lower than 3.7
To avoid using the capture_output
parameter do the following:
In LINE: 132 of sonic_paranoid.py, substitute
# line 132
# change the following line
rOut = subprocess.run("gcc -dumpversion", shell=True, capture_output=True)
# with this
rOut = subprocess.run("gcc -dumpversion", stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, capture_output=False)
# Do the above for all instances in which capture_output is used
Edited by Salvatore Cosentino