[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2013-11-06 Thread A.M. Kuchling
Changes by A.M. Kuchling : -- keywords: -easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-05-13 Thread Chris Rebert
Chris Rebert added the comment: Re: Nick's comments: Besides `close_fds`, what other Popen parameters currently have suboptimal defaults? -- ___ Python tracker ___

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-08 Thread Andrew Svetlov
Andrew Svetlov 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 bytes also. Mayby depreca

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-05 Thread R. David Murray
R. David Murray 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 use bytes filenames we n

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-05 Thread Andrew Svetlov
Andrew Svetlov 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. -- ___

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-01 Thread Nick Coghlan
Nick Coghlan 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 calling the Popen co

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: I'm +1 for going though deprecation process for Popen args to make parameters combination clean and obvious. -- ___ Python tracker ___

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: BTW we need to drop win9x and win2000 support, see #14470 -- ___ Python tracker ___ ___ Python-bugs-

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-01 Thread R. David Murray
R. David Murray 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 adding new class metho

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-01 Thread Andrew Svetlov
Andrew Svetlov 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. 2. Add Pope.shell and Pop

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-03-31 Thread Chris Rebert
Chris Rebert 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 Windows, at tha

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-03-31 Thread Nick Coghlan
Nick Coghlan 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 worthwhile continuing

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-03-31 Thread R. David Murray
R. David Murray 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 ___ _

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-03-31 Thread Andrew Svetlov
Andrew Svetlov 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 for useless parameters comb

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-03-31 Thread Eric V. Smith
Eric V. Smith 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

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-03-31 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-03-31 Thread Andrew Svetlov
Andrew Svetlov 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 __

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2011-10-17 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo versions: +Python 3.3 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2011-10-17 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2011-03-23 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2011-03-03 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-07-31 Thread David Stanek
Changes by David Stanek : -- nosy: +dstanek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-07-23 Thread Steve Holden
Steve Holden 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: C:\Users\sholden\Documents\issu

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-13 Thread R. David Murray
R. David Murray added the comment: See issue 8972 for motivation for accepting this proposal. Maybe I should start working on the patch :) -- ___ Python tracker ___ ___

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-09 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Eric Smith
Eric Smith 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 such as this. shl

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread R. David Murray
R. David Murray 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 behavior change (currently

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Larry Hastings
Larry Hastings 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 going to have this pro

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Zsolt Cserna
Zsolt Cserna 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 a list to string, we would on

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread R. David Murray
R. David Murray 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 2.7, since it is already

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Larry Hastings
Larry Hastings 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 if you call a progra

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Larry Hastings
Changes by Larry Hastings : -- versions: +Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Larry Hastings
Larry Hastings 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 ___

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-06-08 Thread Larry Hastings
Larry Hastings 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 combinations of shell=

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-02-28 Thread R. David Murray
R. David Murray 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 check_call_shell. Proliferati

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-02-28 Thread Brian Curtin
Brian Curtin 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

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-02-28 Thread Eric Smith
Eric Smith 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 just call Popen with

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-02-28 Thread R. David Murray
R. David Murray 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, because people will 'acciden

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-02-02 Thread Eric Smith
Changes by Eric Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2010-02-02 Thread R. David Murray
New submission from R. David Murray : 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 as args[0] being the