Changes by A.M. Kuchling li...@amk.ca:
--
keywords: -easy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
___
Python-bugs-list mailing
Chris Rebert pyb...@rebertia.com added the comment:
Re: Nick's comments:
Besides `close_fds`, what other Popen parameters currently have suboptimal
defaults?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
Andrew Svetlov andrew.svet...@gmail.com added the comment:
If fylesystem doesn't support unicode (only Windows directly does as I know)
str filename should to be converted by `sys.getfilesystemencoding()`. `os.exec`
family already does it as well as other fs functions — but they are supports
Andrew Svetlov andrew.svet...@gmail.com added the comment:
What's about test which pass bytes to Popen?
Should it be deprecated and should Popen accept only unicode strings only — I
mean `str` type?
As I know the trend of py3k to get rid of bytes in filesystem names.
--
R. David Murray rdmur...@bitdance.com added the comment:
No, you need to be able to pass bytes to Popen, just like you do to the
os.exec[xx] functions. When the OS doesn't fully support unicode, that is
sometimes the only option. As for filenames; again, as long as the underlying
systems
Chris Rebert pyb...@rebertia.com added the comment:
The reason I'm not a fan is the fact that, with shell=True, you can use the
*executable* argument to Popen to select a non-default shell. At that point,
passing a list can make sense, even if it isn't useful for the default shell.
Modulo
Andrew Svetlov andrew.svet...@gmail.com added the comment:
After trying to make a patch I found what current test suite itself has calls
like (str, shell=False), (bytes, shell=True) and (['shell command'],
shell=True).
We can:
1. Implement Eric's suggestion with fixing/removing broken tests.
R. David Murray rdmur...@bitdance.com added the comment:
Which just goes to show that using Popen correctly is not obvious, I suppose.
Given that adding these errors *would* break backward compatibility, there
would have to be a deprecation if it was done.
Personally I don't see the point in
Andrew Svetlov andrew.svet...@gmail.com added the comment:
BTW we need to drop win9x and win2000 support, see #14470
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
Andrew Svetlov andrew.svet...@gmail.com added the comment:
I'm +1 for going though deprecation process for Popen args to make parameters
combination clean and obvious.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
Nick Coghlan ncogh...@gmail.com added the comment:
Everyone missed my other argument in favour of alternate constructor
methods: fixing the currently wrong default arguments.
There is no good reason to break working code when beginner confusion can
be better addressed by telling them to avoid
Andrew Svetlov andrew.svet...@gmail.com added the comment:
I like Eric's proposition, e.g. raising error if (list, shell=True) or (str,
shell=False)
If nobody object I can try to make initial patch for that.
--
___
Python tracker
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
___
Python-bugs-list
Eric V. Smith e...@trueblade.com added the comment:
While I still think raising those errors is a good thing, we should also look
at Nick's shell-command:
http://shell-command.readthedocs.org/en/latest/index.html
--
___
Python tracker
Andrew Svetlov andrew.svet...@gmail.com added the comment:
Nick's library is awesome and I +1 to include it into stdlib if Nick is ready
to do.
But also I like to prevent obviously bad usage of popen.
We cannot and don't want to remove popen shell=True param, so let's add raising
exception
R. David Murray rdmur...@bitdance.com added the comment:
Yes, Nick's library looks good, but that should be a separate issue, it isn't
really relevant to this one.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
Nick Coghlan ncogh...@gmail.com added the comment:
For the record, my shell access convenience API proposal is in issue 13238.
I'm not going to push that for 3.3 though - convenient shell access from Python
is currently an area with a lot of active third party development, so I think
it's
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
versions: +Python 3.3 -Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
Changes by Andrew Svetlov andrew.svet...@gmail.com:
--
nosy: +asvetlov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
___
Python-bugs-list
Changes by STINNER Victor victor.stin...@haypocalc.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
___
Changes by David Stanek dsta...@dstanek.com:
--
nosy: +dstanek
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
___
Python-bugs-list mailing
Steve Holden st...@holdenweb.com added the comment:
The test program Larry provided does not appear to function as intended on
Windows, and runs without either producing error messages or requiring
interactive input. Here's a typical output, in this case from Python 3.1 on
Vista:
R. David Murray rdmur...@bitdance.com added the comment:
See issue 8972 for motivation for accepting this proposal. Maybe I should
start working on the patch :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
Changes by Giampaolo Rodola' g.rod...@gmail.com:
--
nosy: +giampaolo.rodola
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
___
Larry Hastings la...@hastings.org added the comment:
I noticed this a while ago. And FWIW it's not just 3.x; I see this same
behavior in 2.6.
I've whipped up a test case, attached, which runs in both Python 2 and Python
3. The test runs sys.interpreter -V four times: it tries all the
Larry Hastings la...@hastings.org added the comment:
I realize we're down to the wire, but would it be too late to fix this in 2.7?
It is a genuine bug, and it won't break any correct code.
--
___
Python tracker rep...@bugs.python.org
Changes by Larry Hastings la...@hastings.org:
--
versions: +Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
___
Python-bugs-list
Larry Hastings la...@hastings.org added the comment:
Sorry for spamming updates, but here's two more things to consider.
1) What does it do on Windows? For all I know all four combinations work fine
there and we should preserve the existing functionality.
2) All four combinations work fine
R. David Murray rdmur...@bitdance.com added the comment:
Unless we go the proliferating-interfaces route, it does represent a behavior
change, and so if accepted would need to go through a deprecation cycle. And
if we did go that route, it would be a new feature. So nothing can happen in
Zsolt Cserna zsolt.cse...@morganstanley.com added the comment:
I would say that both string and list should be accepted in args, and depending
on the shell parameter, the module should create a list or a string from the
specified list/string.
We already have a list2cmdline function to convert
Larry Hastings la...@hastings.org added the comment:
Zsolt: an excellent idea! That shouldn't change the semantics of the function,
and therefore is strictly a bug fix. Which means we could potentially backport
it, yes?
Obviously we only need to change it between string / list if we're
R. David Murray rdmur...@bitdance.com added the comment:
Because we use the versions field to indicate which versions a patch will be
applied to, if it is, and I created this bug as a feature request, and as such
it is not a candidate for 2.7.
Changing list to string for shell=True is a
Eric Smith e...@trueblade.com added the comment:
I agree with David. For the issue raised here, at most I would make (list,
shell=True) and (str, shell=False) raise errors.
There's an issue (that I can't find right now) for creating functions that
convert from str-list and list-str for cases
R. David Murray rdmur...@bitdance.com added the comment:
Because the shell argument provides important functionality. Or are you
suggesting that passing a list implies shell=False and passing a string implies
shell=True? That is a possibility, but I think it would not be a good idea,
Eric Smith e...@trueblade.com added the comment:
I think the better design is to have 2 distinct APIs: Popen_shell and
Popen_exec. I'm not wild about the name Popen_exec, suggestions welcome.
Neither of these would accept a shell parameter.
For starters these could be convenience APIs that
Brian Curtin cur...@acm.org added the comment:
That seems reasonable. We already have subprocess.call, the thin wrapper around
Popen. Maybe add this as subprocess.call_shell and call_exec?
--
nosy: +brian.curtin
___
Python tracker
R. David Murray rdmur...@bitdance.com added the comment:
Hmm. I liked Eric's idea, and it would be easier to get in, but 'call' is
actually an argument against it. It would mean that in addition to PopenExec
and PopenShell we'd need call_exec and call_shell, and check_call_exec and
New submission from R. David Murray rdmur...@bitdance.com:
Currently Popen accepts either a string or a list regardless of the value of
'shell'. In the shell=False case, a string is interpreted as the command name,
no matter what it actually is. In the shell=True case, a list is interpreted
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7839
___
___
Python-bugs-list mailing
40 matches
Mail list logo