Skip to content
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

subprocess.Popen with wildcard arguments #46690

Closed
pbrandt mannequin opened this issue Mar 20, 2008 · 2 comments
Closed

subprocess.Popen with wildcard arguments #46690

pbrandt mannequin opened this issue Mar 20, 2008 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@pbrandt
Copy link
Mannequin

pbrandt mannequin commented Mar 20, 2008

BPO 2438
Nosy @smontanaro

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-03-21.01:10:54.611>
created_at = <Date 2008-03-20.20:38:31.815>
labels = ['type-bug', 'library']
title = 'subprocess.Popen with wildcard arguments'
updated_at = <Date 2008-03-21.01:10:54.535>
user = 'https://bugs.python.org/pbrandt'

bugs.python.org fields:

activity = <Date 2008-03-21.01:10:54.535>
actor = 'skip.montanaro'
assignee = 'none'
closed = True
closed_date = <Date 2008-03-21.01:10:54.611>
closer = 'skip.montanaro'
components = ['Library (Lib)']
creation = <Date 2008-03-20.20:38:31.815>
creator = 'pbrandt'
dependencies = []
files = []
hgrepos = []
issue_num = 2438
keywords = []
message_count = 2.0
messages = ['64204', '64228']
nosy_count = 2.0
nosy_names = ['skip.montanaro', 'pbrandt']
pr_nums = []
priority = 'normal'
resolution = 'works for me'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue2438'
versions = ['Python 2.4']

@pbrandt
Copy link
Mannequin Author

pbrandt mannequin commented Mar 20, 2008

When using wildcards as arguments to the processes being spawned by
Popen, it seems to interpret them as hard literals.

IE, when doing something like:
>>> import subprocess
>>> output = subprocess.Popen(['ls', '*'],
stdout=subprocess.PIPE).communicate()[0]
ls: *: No such file or directory
>>>

@pbrandt pbrandt mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Mar 20, 2008
@smontanaro
Copy link
Contributor

The default for Popen objects is to not use the shell, thus
no expansion. Set shell=True in the Popen call:

>> import subprocess
>> output = subprocess.Popen(['ls', '*'])
>> ls: *: No such file or directory

>> output = subprocess.Popen(['ls', '*'], shell=True)
>> configure.out svn-stat.out svn-update.out

Skip

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant