This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JamesDinhBugPython
Recipients JamesDinhBugPython
Date 2018-02-03.21:24:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517693040.31.0.467229070634.issue32760@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Python dev. team,

I would like to report below error:
1) Tittle: Running Linux shell command from python file always leads to reset config error.

2) Environment:
+ Linux distro: Both Ubuntu 16.04 64b and Fedora 25 happen this issue
+ Python:
Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2

3) Reproduce route:
These commands can be run normally from Linux terminal:
[I use buildroot for my embedded project]
./configure O=output project_name debug initramfs nofirewall
make O=output

But when I tried to call them from Python file, the configure command always lead to Restart config... - and all the new configuration values are discarded.

For your information, I tried these options:
a) 
spkConfigureCmd = ["./configure","O=output", "project_name","debug","initramfs","nofirewall"]
subprocess.check_call(spkConfigureCmd)
spkBuildCmd = ["make","O=output"]
subprocess.check_call(spkBuildCmd)

b) os.system("./configure O=output project_name debug initramfs nofirewall && make O=output")

c)
fid = open('ax2spkbuild.sh','w')
fid.write('./configure O=output project_name debug initramfs nofirewall\n')
fid.write('make O=output\n')
fid.close()
os.system('chmod +x ax2spkbuild.sh')
os.system('./ax2spkbuild.sh')

Actually I tried with another simple command like 'pwd', 'cat', 'echo' and they are working well. I wonder how come Python executes the Linux shell commands, which are slightly different to the Terminal typed commands.
History
Date User Action Args
2018-02-03 21:24:00JamesDinhBugPythonsetrecipients: + JamesDinhBugPython
2018-02-03 21:24:00JamesDinhBugPythonsetmessageid: <1517693040.31.0.467229070634.issue32760@psf.upfronthosting.co.za>
2018-02-03 21:24:00JamesDinhBugPythonlinkissue32760 messages
2018-02-03 21:24:00JamesDinhBugPythoncreate