Skip to content

Conversation

@pxinwr
Copy link
Contributor

@pxinwrpxinwr commented Jul 30, 2020

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

@pxinwrpxinwrforce-pushed the fix-issue-31904-shell branch from bcc5ef8 to e37c536CompareNovember 24, 2020 08:11
@pxinwrpxinwr changed the title bpo-41442: add unix_shell requirement checking for test_posix.PosixTester.test_getgroupsbpo-31904: disable os.popen and impacted test cases on VxWorksNov 24, 2020
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change a temporary workaround until subprocess is fixed on VxWorks, or is this skip supposed to be a temporary workaround?

If it's a temporary workaround, I am not sure if it's a good idea to document the skip.

Lib/os.py Outdated
"popen", "extsep"]
"extsep"]

VXWORKS = (sys.platform == 'vxworks')
Copy link
Member

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.

Copy link
ContributorAuthor

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:
Copy link
Member

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':.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed accordingly.

@pxinwr
Copy link
ContributorAuthor

pxinwr commented Dec 10, 2020

Is this change a temporary workaround until subprocess is fixed on VxWorks, or is this skip supposed to be a temporary workaround?

If it's a temporary workaround, I am not sure if it's a good idea to document the skip.

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.

@vstinnervstinner merged commit e1e3c2d into python:masterDec 15, 2020
@vstinner
Copy link
Member

Merged, thanks.

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
@pxinwrpxinwr deleted the fix-issue-31904-shell branch May 7, 2021 07:42
@kuhlenoughkuhlenoughmannequin mentioned this pull request Jan 12, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pxinwr@vstinner@ZackerySpytz@the-knights-who-say-ni@bedevere-bot