Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-12 Thread Paul Moore
On 12 June 2014 05:34, Florian Bruhin m...@the-compiler.org wrote: Do the lookup in PATH yourself, it's not like that's rocket science. Am I missing something here? I routinely do subprocess.check_call(['hg', 'update']) or whatever, and it finds the hg executable fine. Paul

Re: [Python-Dev] Issue #21205: add __qualname__ to generators

2014-06-12 Thread Victor Stinner
2014-06-11 18:17 GMT+02:00 Antoine Pitrou anto...@python.org: Le 11/06/2014 10:28, Victor Stinner a écrit : (...) Issues describing the problem, I attached a patch implementing my ideas: http://bugs.python.org/issue21205 Would you be ok with these (minor) incompatible changes? +1 from me.

[Python-Dev] close() questions

2014-06-12 Thread Serhiy Storchaka
11.06.14 05:28, Antoine Pitrou написав(ла): close() should indeed be idempotent on all bundled IO class implementations (otherwise it's a bug), and so should it preferably on third-party IO class implementations. There are some questions about close(). 1. If object owns several resources,

Re: [Python-Dev] Issue #21205: add __qualname__ to generators

2014-06-12 Thread Yury Selivanov
Hello Victor, On 2014-06-11, 10:28 AM, Victor Stinner wrote: Hi, I'm working on asyncio and it's difficult to debug code because @asyncio.coroutine decorator removes the name of the function if the function is not a generator (if it doesn't use yield from). I propose to add new gi_name and

[Python-Dev] Backwards Incompatibility in logging module in 3.4?

2014-06-12 Thread Don Spaulding
Hi there, I just started testing a project of mine on Python 3.4.0b1. I ran into a change that broke compatibility with the logging module in 3.3. The basic test is: $ py34/bin/python -c 'import logging; print(logging.getLevelName(debug.upper()))' Level DEBUG $ py33/bin/python -c

Re: [Python-Dev] Backwards Incompatibility in logging module in 3.4?

2014-06-12 Thread Nick Coghlan
On 13 Jun 2014 08:59, Don Spaulding donspauldin...@gmail.com wrote: Hi there, I just started testing a project of mine on Python 3.4.0b1. I ran into a change that broke compatibility with the logging module in 3.3. The basic test is: $ py34/bin/python -c 'import logging;

Re: [Python-Dev] Backwards Incompatibility in logging module in 3.4?

2014-06-12 Thread Victor Stinner
Hi, 2014-06-13 0:38 GMT+02:00 Don Spaulding donspauldin...@gmail.com: Is this a bug or an intentional break? If it's the latter, shouldn't this at least be mentioned in the What's new in Python 3.4 document? IMO the change is intentional. The previous behaviour was not really expected.

Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-12 Thread Ryan Gonzalez
SHELLS ARE NOT CROSS-PLATFORM Seriously, there are going to be differences. If you really must: escape = lambda s: s.replace('^', '^^') if os.name == 'nt' else s Viola. On Wed, Jun 11, 2014 at 5:53 PM, anatoly techtonik techto...@gmail.com wrote: On Thu, Jun 12, 2014 at 1:30 AM, Chris

Re: [Python-Dev] Why does IOBase.__del__ call .close?

2014-06-12 Thread Nikolaus Rath
Benjamin Peterson benja...@python.org writes: On Wed, Jun 11, 2014, at 17:11, Nikolaus Rath wrote: MRAB pyt...@mrabarnett.plus.com writes: On 2014-06-11 02:30, Nikolaus Rath wrote: Hello, I recently noticed (after some rather protacted debugging) that the io.IOBase class comes with a

Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-12 Thread Nikolaus Rath
R. David Murray rdmur...@bitdance.com writes: Also notice that using a list with shell=True is using the API incorrectly. It wouldn't even work on Linux, so that torpedoes the cross-platform concern already :) This kind of confusion is why I opened http://bugs.python.org/issue7839. Can

Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-12 Thread Chris Angelico
On Fri, Jun 13, 2014 at 12:11 PM, Nikolaus Rath nikol...@rath.org wrote: Can someone describe an use case where shell=True actually makes sense at all? It seems to me that whenever you need a shell, the argument's that you pass to it will be shell specific. So instead of e.g. Popen('for i

Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-12 Thread Nick Coghlan
On 13 Jun 2014 12:12, Nikolaus Rath nikol...@rath.org wrote: R. David Murray rdmur...@bitdance.com writes: Also notice that using a list with shell=True is using the API incorrectly. It wouldn't even work on Linux, so that torpedoes the cross-platform concern already :) This kind of

Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-12 Thread Florian Bruhin
* Nikolaus Rath nikol...@rath.org [2014-06-12 19:11:07 -0700]: R. David Murray rdmur...@bitdance.com writes: Also notice that using a list with shell=True is using the API incorrectly. It wouldn't even work on Linux, so that torpedoes the cross-platform concern already :) This kind of

Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-12 Thread Greg Ewing
Nikolaus Rath wrote: you almost certainly want to do Popen(['/bin/sh', 'for i in `seq 42`; do echo $i; done'], shell=False) because if your shell happens to be tcsh or cmd.exe, things are going to break. On Unix, the C library's system() and popen() functions always use /bin/sh, NOT the

Re: [Python-Dev] Why does IOBase.__del__ call .close?

2014-06-12 Thread Benjamin Peterson
On Thu, Jun 12, 2014, at 18:06, Nikolaus Rath wrote: Consider this simple example: $ cat test.py import io import warnings class StridedStream(io.IOBase): def __init__(self, name, stride=2): super().__init__() self.fh = open(name, 'rb') self.stride =