New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-31904: disable os.popen and impacted test cases on VxWorks #21687
Conversation
Lib/os.py
Outdated
| "popen", "extsep"] | ||
| "extsep"] | ||
|
|
||
| VXWORKS = (sys.platform == 'vxworks') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is only at a single place: you can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
Lib/os.py
Outdated
| return None | ||
| if name == 'nt': | ||
| return returncode | ||
| if not VXWORKS: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest: if sys.platform != 'vxworks':.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed accordingly.
os.popen() runs cmd in shell, i.e. shell=True was set when calling subprocess.Popen(). VxWorks has no user space shell provided so that we can't create a new shell and run commands inside. For the subprocess module, VxWorks can't support features needing shell to run. So when I created this PR, I don't intend to be a temporary workaround. |
Co-authored-by: Victor Stinner <vstinner@python.org>
|
Merged, thanks. |
VxWorks has no user space shell provided so it can't support os.popen(). Disable it on VxWorks and impacted test cases.
https://bugs.python.org/issue41442