[issue14233] argparse: "append" action fails to override default values

2012-03-09 Thread R. David Murray

R. David Murray  added the comment:

I agree with Eric.  I've run in to this error, and immediatly figured out what 
I'd done wrong based on the existing error message.

--
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-09 Thread R. David Murray

R. David Murray  added the comment:

To answer Glenn's procedural question: no this is not a bug whose fix can be 
backported.  API changes are not allowed in maintenance releases.  Doc 
improvements can be backported, though, so I'm leaving versios alone 
(alternatively someone could split this into two bugs, one for the doc fixes 
for older releases, and one for adding the new capability).

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14226] Expose dict_proxy type from descrobject.c

2012-03-09 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13785] Make concurrent.futures.Future state public

2012-03-09 Thread Juan Javier

Juan Javier  added the comment:

I'm writting an application where users can submit long running jobs and I want 
to disply a list of those jobs and the state of each one.

My idea is to use an executor and use the futures to display information about 
the jobs: not started, cancelled, running, etc.

Think of a table with these headers:

ID, Start date, Last state change date, State, Info

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14209] pkgutil.iter_zipimport_modules ignores the prefix parameter for packages

2012-03-09 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1469629] __dict__ = self in subclass of dict causes a memory leak

2012-03-09 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14205] Raise an error if a dict is modified during a lookup

2012-03-09 Thread Mark Shannon

Mark Shannon  added the comment:

Unmodified CPython (without the patch) already passes the new test in the patch.

The unmodified code already raises a Runtime error; a recursion limit exceeded 
error!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14238] python shouldn't need username in passwd database

2012-03-09 Thread Arkadiusz Miskiewicz Arkadiusz Miskiewicz

New submission from Arkadiusz Miskiewicz
Arkadiusz Miskiewicz :

I'm trying to run python from UID which doesn't have entry in passwd database. 
This fails with:

 Traceback (most recent call last):
File "/usr/share/python2.7/site.py", line 567, in 
File "/usr/share/python2.7/site.py", line 549, in main
File "/usr/share/python2.7/site.py", line 278, in addusersitepackages
File "/usr/share/python2.7/site.py", line 253, in getusersitepackages
File "/usr/share/python2.7/site.py", line 243, in getuserbase
File "/usr/share/python2.7/sysconfig.py", line 522, in get_config_var
File "/usr/share/python2.7/sysconfig.py", line 426, in get_config_vars
File "/usr/share/python2.7/sysconfig.py", line 184, in _getuserbase
File "/usr/share/python2.7/sysconfig.py", line 171, in joinuser
File "/usr/share/python2.7/posixpath.py", line 260, in expanduser
KeyError: 'getpwuid(): uid not found: 51'

--
components: Interpreter Core
messages: 155215
nosy: arekm
priority: normal
severity: normal
status: open
title: python shouldn't need username in passwd database
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14238] python shouldn't need username in passwd database

2012-03-09 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

This looks similar to a sporadic failure on the debian bigmem buildbot:

http://www.python.org/dev/buildbot/all/builders/AMD64%20debian%20bigmem%203.x/builds/168/steps/test/logs/stdio

ERROR: test_expanduser (test.test_posixpath.PosixPathTest)
--
Traceback (most recent call last):
  File 
"/var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/test_posixpath.py",
 line 305, in test_expanduser
home = pwd.getpwuid(os.getuid()).pw_dir
KeyError: 'getpwuid(): uid not found: 5025'

--
components: +Library (Lib) -Interpreter Core
keywords: +buildbot
nosy: +loewis, nadeem.vawda
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat

2012-03-09 Thread Georg Brandl

Changes by Georg Brandl :


--
nosy: +benjamin.peterson, georg.brandl
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat

2012-03-09 Thread Georg Brandl

Georg Brandl  added the comment:

I hope this can be integrated during the PyCon sprints?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14238] python shouldn't need username in passwd database

2012-03-09 Thread Georg Brandl

Georg Brandl  added the comment:

I agree -- there should be a guard here that just doesn't add user site 
directories if the lookup fails.

--
nosy: +georg.brandl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14116] Lock.__enter__() method returns True instead of self

2012-03-09 Thread Georg Brandl

Changes by Georg Brandl :


--
type: behavior -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14205] Raise an error if a dict is modified during a lookup

2012-03-09 Thread STINNER Victor

STINNER Victor  added the comment:

> Unmodified CPython (without the patch) already passes the new test in the 
> patch.

You should try Lib/test/crashers/nasty_eq_vs_dict.py, not my test.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14210] add filename completion to pdb

2012-03-09 Thread Georg Brandl

Georg Brandl  added the comment:

I agree. It should not be too hard to add complete_break() and other similar 
methods that do this to Pdb.

--
nosy: +georg.brandl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14239] Uninitialised variable in _PyObject_GenericSetAttrWithDict

2012-03-09 Thread Mark Shannon

New submission from Mark Shannon :

I get the following compiler warning (rev 2a142141e5fd)
Its not strictly an error, but an unitialised variable in such an 
important function is dangerous.

Objects/object.c: In function ‘_PyObject_GenericSetAttrWithDict’:
Objects/object.c:1144: warning: ‘descr’ may be used uninitialised in this 
function

Patch attached

--
components: Installation
files: uninitialised_descr.patch
keywords: patch
messages: 155221
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Uninitialised variable in _PyObject_GenericSetAttrWithDict
type: compile error
Added file: http://bugs.python.org/file24765/uninitialised_descr.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13903] New shared-keys dictionary implementation

2012-03-09 Thread Mark Shannon

Changes by Mark Shannon :


Added file: http://bugs.python.org/file24766/257e16e71654.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14210] add filename completion to pdb

2012-03-09 Thread Georg Brandl

Georg Brandl  added the comment:

Here's a patch for 3.3, adding completion to most commands (either completes 
locations, breakpoint numbers or expressions).  Please test!

--
assignee:  -> georg.brandl
keywords: +patch
Added file: http://bugs.python.org/file24767/pdb-completion.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12568] Add functions to get the width in columns of a character

2012-03-09 Thread Nicholas Cole

Nicholas Cole  added the comment:

Could we have an update on the status of this? I ask because if 3.3 is going to 
(finally) fix unicode for curses, it would be really nice if it were possible 
to calculate the width of what's being displayed!  It looks as if there was 
never quite agreement on the proper API

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14178] _elementtree problem deleting slices with steps != +1

2012-03-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1a721b9a4039 by Eli Bendersky in branch 'default':
Issue #14178: Problem deleting slices with steps != +1 in the _elementtree 
module.
http://hg.python.org/cpython/rev/1a721b9a4039

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14178] _elementtree problem deleting slices with steps != +1

2012-03-09 Thread Eli Bendersky

Changes by Eli Bendersky :


--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14240] lstrip problem

2012-03-09 Thread Thomas Turner

New submission from Thomas Turner :

Problem with lstrip 

>>> s = 'msgid "supplier code"'
>>>
>>> s.lstrip('msgid "')
'upplier code"'
>>>

It should come back with supplier code"
To get round the bug I did 

>>> s.lstrip('msgid ').lstrip('"')
'supplier code"'
>>>

--
components: None
messages: 155225
nosy: Thomas.Turner
priority: normal
severity: normal
status: open
title: lstrip problem
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14240] lstrip problem

2012-03-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This is expected behavior: 
http://docs.python.org/library/stdtypes.html#str.lstrip
"""The chars argument is not a prefix; rather, all combinations of its values 
are stripped"""

--
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails

2012-03-09 Thread Mark Shannon

New submission from Mark Shannon :

>>> io.UnsupportedOperation.__new__(io.UnsupportedOperation)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: ValueError.__new__(UnsupportedOperation) is not safe, use 
OSError.__new__()

Looking at the mro of io.UnsupportedOperation
(io.UnsupportedOperation, ValueError, OSError, Exception, BaseException, 
object'>)

Shows that ValueError.__new__ is getting called, but will not construct 
an instance of a subtype of OSError

Switching the order of ValueError and OSError fixes this error (patch 
attached), but doesn't fix the underlying problem.

Why doesn't io.UnsupportedOperation() fail, when
UnsupportedOperation.__new__ does?
io.UnsupportedOperation() actually calls OSError.__new__ 
via the internal tp_new slot.
In other words UnsupportedOperation->tp_new != UnsupportedOperation.__new__
This should not happen, it looks like the logic in inherit_special()
in typeobject.c may be faulty.

--
components: Interpreter Core
files: io_new.patch
keywords: patch
messages: 155227
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails
type: behavior
Added file: http://bugs.python.org/file24768/io_new.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py

2012-03-09 Thread STINNER Victor

STINNER Victor  added the comment:

ba6376dff6c4 changed dict_subscript(): _PyType_Lookup() is replaced by 
_PyObject_LookupSpecial(). 7b4b921f3335 fixed a reference introduced in this 
change.

_PyObject_Lookup() returns a borrowed reference, whereas 
_PyObject_LookupSpecial() increments the reference to the attribute. The issue 
was on borrowed reference, so the bug is already fixed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py

2012-03-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 850d7f6af1b0 by Victor Stinner in branch 'default':
Issue #14231: Lib/test/crashers/borrowed_ref_1.py was fixed by ba6376dff6c4.
http://hg.python.org/cpython/rev/850d7f6af1b0

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py

2012-03-09 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14205] Raise an error if a dict is modified during a lookup

2012-03-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a428f85de29c by Victor Stinner in branch 'default':
Issue #14205: Document the dict lookup change in What's New in Python 3.3
http://hg.python.org/cpython/rev/a428f85de29c

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14205] Raise an error if a dict is modified during a lookup

2012-03-09 Thread STINNER Victor

STINNER Victor  added the comment:

Guido> Given all this I think we should keep it as you have committed
Guido> and add it to the docs and whatsnew.

I updated What's New in Python 3.3 document. I also wrote an email to 
python-dev to notify all developers of this change. Let's close the issue.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14205] Raise an error if a dict is modified during a lookup

2012-03-09 Thread Mark Shannon

Mark Shannon  added the comment:

STINNER Victor wrote:
> STINNER Victor  added the comment:
> 
> Guido> Given all this I think we should keep it as you have committed
> Guido> and add it to the docs and whatsnew.
> 
> I updated What's New in Python 3.3 document. I also wrote an email to 
> python-dev to notify all developers of this change. Let's close the issue.
> 

The tests still need to fixed

test_mutating_lookuptest doesn't fail on the unmodified version of cpython.
Lib/test/crashers/nasty_eq_vs_dict.py has been removed, but
no equivalent test has been added to Lib/test/test_dict.py

There should be at least one failing test for this issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14218] include rendered output in addition to markup

2012-03-09 Thread Ezio Melotti

Ezio Melotti  added the comment:

My opinion is that in general you should worry about the semantic of the 
role/directive you are using, rather than its aspect while rendered.
Some entries (especially some directives) might benefit from a rendered 
example, but I don't think it's necessary to add the output to each 
role/directive.

Another idea that we were discussing on IRC (and IIRC on another issue that I 
can't find anymore), was to add at the top a table like:

arguments   *arg*
strong text **strong**
code snippets   ``print('hello world')``
True/False/None ``True``
functions   :func:`sorted`
methods :meth:`list.sort`
...


This will allow people that are searching for the right markup to find quickly 
what role they should use.

I also agree with Éric that you should always build the doc anyway to check for 
errors.  Sometimes it happens that I have to experiment a bit if I'm using some 
uncommon role/directive, but that doesn't happen often, and building the doc a 
few times is not a problem for me in these cases.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14228] SIGINT (Ctrl-C) not caught at startup

2012-03-09 Thread telmich

telmich  added the comment:

The problem is *NOT* in the parent: The problem is in the *CHILD* that is being 
called from the shell that is throwing a traceback, which I cannot prevent in 
the python code.

Please run the script yourself and try to get around the problem, you'll notice 
it's not possible currently in python 3.2.2.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14228] SIGINT (Ctrl-C) not caught at startup

2012-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> The problem is *NOT* in the parent: The problem is in the *CHILD* that
> is being called from the shell that is throwing a traceback, which I
> cannot prevent in the python code.

Python does not (at least, should not) run differently as a child or as
a parent. As a matter of fact, any uncaught exception will indeed print
a traceback (which is very useful for e.g. debug purposes). If you don't
want such tracebacks, you can capture stderr in the calling process.

Also, it would be better if you explained your actual case, rather than
complain about specific behaviour.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails

2012-03-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12568] Add functions to get the width in columns of a character

2012-03-09 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Nicholas: I consider this issue fixed. There already *is* any API to compute 
the width of a character. Closing this as "works for me".

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14228] SIGINT (Ctrl-C) not caught at startup

2012-03-09 Thread telmich

telmich  added the comment:

You are right, there is no different behaviour as parent or child in general.

I used this example python => shell => python, because it is actually being 
used like this in cdist (first link in the first post).

The problem arises there, because python is called many (some thousand) times, 
depending on the configuration, thus you see the problem very often.

This is indeed a general problem, but you cannot easily trigger it in one 
python process, because the race condition is hard to trigger manually.

Thus the provided use case (running python 1000 times from shell scripts) is 
very realistic in a typical cdist run.

For demonstration, you can run ./shellpart.sh directly, press ctrl-c and see 
that you'll get a traceback, although all possible code is protected from the 
exception.

But (in that's the point) it is possible in user code to catch this exception.

I should probably rephrase the title to

"It is impossible to catch sigint on startup in python code"

Hope this makes things more clear.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py

2012-03-09 Thread Armin Rigo

Armin Rigo  added the comment:

I will attempt a last time to mention that the docstrings in borrowed_ref_*.py 
used to say they were *examples*.

That means: (1) find any internal or external C function that returns a 
borrowed reference; (2) find all callers and write down all the places that 
don't immediately either Py_INCREF() the returned value or immediately forget 
about it; (3) for each such place, either come up painfully with a complicated 
explanation of why it's safe in all possible cases, or in doubt, just fix it by 
adding Py_INCREF()/Py_DECREF().

What I did in writing these two borrowed_ref_*.py was to do instead (3') spend 
a few hours figuring out how to exploit the issue until we get a segfault.  I 
did it for two examples, but what I'm definitely not going to do is spend N 
times a few hours for a large number N.  If python-dev people just fix the two 
examples, remove the crashers, and just forget about the issue, then well, the 
point is missed, but I'm not going to fight it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14232] obmalloc: mmap() returns MAP_FAILED on error, not 0

2012-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ha, good catch. Indeed, under Linux MMAP_FAILED seems to be ((void *) -1).

--
stage:  -> commit review
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14218] include rendered output in addition to markup

2012-03-09 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe  added the comment:

> Ezio Melotti  added the comment:
> Another idea that we were discussing on IRC (and IIRC on another issue that I 
> can't find anymore), was to add at the top a table like:
> 
> arguments       *arg*
> strong text     **strong**
> code snippets   ``print('hello world')``
> True/False/None ``True``
> functions       :func:`sorted`
> methods         :meth:`list.sort`
> ...
> 
>
> This will allow people that are searching for the right markup to find 
> quickly what role they should use.

That would be a good idea. A quick ref check without all the prose.

> I also agree with Éric that you should always build the doc anyway to check 
> for errors.  Sometimes it happens that I have to experiment a bit if I'm 
> using some uncommon role/directive, but that doesn't happen often, and 
> building the doc a few times is not a problem for me in these cases.

I also agree. I'm just thinking someone who reads that doc should be
able to see the output without building anything. That is, reading the
doc doesn't necessarily mean you want to apply what you just learned
"right now". There's also "just in case" or "curiosity" learning.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14218] include rendered output in addition to markup

2012-03-09 Thread Ezio Melotti

Ezio Melotti  added the comment:

> I also agree. I'm just thinking someone who reads that doc should be
> able to see the output without building anything.

Indeed I wasn't thinking about this use case, but IME people learn most of they 
know about rst "on the field" (i.e. by imitating what they see in the doc page 
they are working on), and then go check the devguide to expand their knowledge 
and make sure they are using the markup correctly.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14210] add filename completion to pdb

2012-03-09 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe  added the comment:

Thanks for the work.

I see that completion now works for user-defined variables, but:

* completing with 'b' doesn't work at all
* completing with 'break' only completes the first directory that gets the TAB 
key
* also, 'break' doesn't complete when I do another try to do auto-completion 
(works only on first try)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14228] It is impossible to catch sigint on startup in python code

2012-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, I see. Would an option to disable the default SIGINT handlers (and let the 
OS kill the process) be an acceptable solution to your use case?

Keep in mind that letting the OS kill the process will bypass any destructors 
at the Python level, so for example some buffered file data may not be flushed 
properly, etc.

By the way, if I'm not mistaken, the problem is only with SIGINT, right?

--
components: +Interpreter Core
title: SIGINT (Ctrl-C) not caught at startup -> It is impossible to catch 
sigint on startup in python code
type: crash -> enhancement
versions: +Python 3.3 -Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14229] On KeyboardInterrupt, the exit code should mirror the signal number

2012-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Another problem with my suggestion is that C exit() ANDs the status with 255 
before transmitting it to the parent.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com




[issue14229] On KeyboardInterrupt, the exit code should mirror the signal number

2012-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

(faulthandler works around that problem by restoring the previous signal 
handler and calling raise(), apparently)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com




[issue14238] python shouldn't need username in passwd database

2012-03-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
keywords: +easy
nosy: +eric.araujo
versions: +Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13903] New shared-keys dictionary implementation

2012-03-09 Thread Jim Jewett

Jim Jewett  added the comment:

>> As of Feb 28, 2012, the PEP mentions an additional
>> optimization of storing the values in an array indexed
>> by (effectively) key insertion order, rather than key
>> position. ("Alternative Implementation")

>> It states that this would reduce memory usage for the
>> values array by 1/3.  1/3 is a worst-case measurement;
>> average is 1/2.  (At savings of less than 1/3, the keys
>> would resize, to initial savings of 2/3.  And yes, that
>> means in practice, the average savings would be greater
>> than half, because the frequency of dicts of size N
>> decreases with N.)

> I presume you mean to allocate a values array of
> size == actual keys rather than size == usable keys.

Actually, I meant size==maximum(keys in use for this dict), 
so that for objects with a potentially complex lifecycle, 
those instances that had not yet needed the new attributes
would not need to allocate space for them.  

But I see now that just allocating space for each of the 
potential keys is indeed simpler.  And I suppose that a
class which won't eventually need all the attributes for 
every instance is an unusual case. 

So to get beneath 2/3 without lots of reallocation 
probably requires knowing when the key set is likely
to be complete, and that is indeed more complex than
the current changes.  (That said, you have left code
in for immutable keys, so there may be cases where 
this isn't so hard after all.)

> Making the  values array smaller than the the number 
> of usable keys causes a number of issues:

> 1. The values_size will need to be kept in the dict,
> not in the keys, 

That was indeed true for my proposal.  If you just allocate
2/3, then you don't need to store the value, unless you 
want to be lazy about reallocating when the keys grow. 
Even then, there are few enough potential sizes to fit
the information in a byte, or we could get the info for
free *if* the dict were already timestamped or versioned.

>> It states that the keys table would need an additional
>> "values_size" field, but in the absence of dummies, this
>> is just ma_used.

I was mixing two structures in my mind.  The current key 
count (which is sufficient for a new values array) is 
actually USABLE_FRACTION(dk_size) - dk_free.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14210] add filename completion to pdb

2012-03-09 Thread Georg Brandl

Georg Brandl  added the comment:

> I see that completion now works for user-defined variables, but:

> * completing with 'b' doesn't work at all

Right, that needs to be added for every shortcut.

> * completing with 'break' only completes the first directory that gets the 
> TAB key
> * also, 'break' doesn't complete when I do another try to do auto-completion 
> (works only on first try)

Indeed.  That should be fixed with this new version of the patch.

--
Added file: http://bugs.python.org/file24769/pdb-completion-v2.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14239] Uninitialised variable in _PyObject_GenericSetAttrWithDict

2012-03-09 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13903] New shared-keys dictionary implementation

2012-03-09 Thread Jim Jewett

Jim Jewett  added the comment:

On Fri, Mar 9, 2012 at 12:13 PM, Jim Jewett

> So to get beneath 2/3 without lots of reallocation
> probably requires knowing when the key set is likely
> to be complete, and that is indeed more complex than
> the current changes.  (That said, you have left code
> in for immutable keys, so there may be cases where
> this isn't so hard after all.)

On second thought, avoiding reallocation doesn't have
to be perfect -- just good enough to work on average.

For a *normal* class, the keyset won't change after
the first instance has completed its __init__.

Which of course again leads to autoslots and a
normally NULL extra_dict.  And having done that,
it makes sense to combine the (normal) instance
dict with the type dict to simplify the lookup chain,
but ... that is probably too aggressive for the 3.3
schedule.  One silver lining to your patch plus hash
randomization is that that 3.4 should have a
pretty free hand with regards to internal details.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14210] add filename completion to pdb

2012-03-09 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe  added the comment:

Works much better, but there are still some issues:

* using relative path completes, but I get something like "'../prog.py' not 
found from sys.path"
* using "~/" to try to complete the HOME directory doesn't work... it completes 
the root directory

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14210] add filename completion to pdb

2012-03-09 Thread Georg Brandl

Georg Brandl  added the comment:

> * using relative path completes, but I get something like "'../prog.py' not 
> found from sys.path"

That has nothing to do with the completion.

> * using "~/" to try to complete the HOME directory doesn't work... it 
> completes the root directory

Since break doesn't accept "~", I don't see why it should complete it.  Keep in 
mind it's not a shell :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14236] In help(re) are insufficient details

2012-03-09 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14210] add filename completion to pdb

2012-03-09 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe  added the comment:

> Georg Brandl  added the comment:
>> * using relative path completes, but I get something like "'../prog.py' not 
>> found from sys.path"
> That has nothing to do with the completion.

If I give it an absolute path it works, hence the complaint.

>> * using "~/" to try to complete the HOME directory doesn't work... it 
>> completes the root directory
> Since break doesn't accept "~", I don't see why it should complete it.  Keep 
> in mind it's not a shell :)

Fair enough. Perhaps the completion should not be when encountering
that character?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14210] add filename completion to pdb

2012-03-09 Thread Georg Brandl

Georg Brandl  added the comment:

>>> * using relative path completes, but I get something like "'../prog.py' not 
>>> found from sys.path"
>> That has nothing to do with the completion.
> If I give it an absolute path it works, hence the complaint.

But that has to do with how relative paths are handled, not with how they are 
entered: they are taken relative to sys.path[0]. I don't know why, and if that 
is the useful thing to do, but it's for another issue.

>>> * using "~/" to try to complete the HOME directory doesn't work... it 
>>> completes the root directory
>> Since break doesn't accept "~", I don't see why it should complete it.  Keep 
>> in mind it's not a shell :)
> Fair enough. Perhaps the completion should not be when encountering
that character?

That should be easy to do, yes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14237] Special sequences \A and \Z don't work in character set []

2012-03-09 Thread Matthew Barnett

Matthew Barnett  added the comment:

Within a character set \A and \Z should behave like, say, \C; in other words, 
they should be the literals "A" and "Z".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14210] add filename completion to pdb

2012-03-09 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe  added the comment:

> But that has to do with how relative paths are handled, not with how they are 
> entered: they are taken relative to sys.path[0]. I don't know why, and if 
> that is the useful thing to do, but it's for another issue.

Perhaps refuse to complete all relative paths as well?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14210] add filename completion to pdb

2012-03-09 Thread Georg Brandl

Georg Brandl  added the comment:

Nope, don't think so. They are accepted and handled (albeit strangely) after 
all.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue211481] os.stat() doesn't return st_rdev

2012-03-09 Thread Марк Коренберг

Марк Коренберг  added the comment:

Okay, it returns that field, but still not print one in repr(). Please fix.

--
nosy: +mmarkk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14239] Uninitialised variable in _PyObject_GenericSetAttrWithDict

2012-03-09 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Fixed in differently in 46e600fa8d05 Thanks anyway.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat

2012-03-09 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Since this has been approved upstream and the Python change is minimal, I think 
this can just be applied.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14239] Uninitialised variable in _PyObject_GenericSetAttrWithDict

2012-03-09 Thread Jim Jewett

Jim Jewett  added the comment:

So the risk is that descr may be given garbage memory that just happens to look 
like an object with 1 reference, so that it really does a decref and tries to 
re-deallocate whatever was there before.

I would rather see the change at the top of the function; just initialize descr 
to NULL when it is declared, and let the compiler figure out that it can skip 
the zeroing on some (most) paths.

--
nosy: +Jim.Jewett

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue211481] os.stat() doesn't return st_rdev

2012-03-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Марк, issue11698 already track this.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11698] Improve repr for structseq objects to show named, but unindexed fields

2012-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

+1. Also, the repr() should show the float values of st_mtime and friends, 
rather than truncated integers.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat

2012-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Note sure I understand: XML_SetHashSalt() takes a parser argument, but the hash 
secret is global?

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat

2012-03-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

No, the salt is stored on the parser. See the line:

+#define hash_secret_salt (parser->m_hash_secret_salt)

Yes, expat code is confusing.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12151] test_logging fails sometimes

2012-03-09 Thread Vinay Sajip

Vinay Sajip  added the comment:

After an increase to a delay in the test(1.01 -> 1.1 seconds) the problem seems 
to have disappeared. So closing for now, since this error appears not to have 
occurred over a period of a few days.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12328] multiprocessing's overlapped PipeConnection on Windows

2012-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

One of our buildbots seems to have recurring issues with the timeout issues. I 
don't know if the machine is very loaded:


==
FAIL: test_wait_integer (test.test_multiprocessing.TestWait)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_multiprocessing.py",
 line 2617, in test_wait_integer
self.assertLess(delta, expected + 2)
AssertionError: 8.592355012893677 not less than 7

==
FAIL: test_wait_timeout (test.test_multiprocessing.TestWait)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_multiprocessing.py",
 line 2590, in test_wait_timeout
self.assertLess(delta, expected + 0.5)
AssertionError: 1.532202959060669 not less than 1.5


http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14205] Raise an error if a dict is modified during a lookup

2012-03-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 70fbb02d588c by Victor Stinner in branch 'default':
Issue #14205: Fix test_dict.test_mutating_lookup()
http://hg.python.org/cpython/rev/70fbb02d588c

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14214] test_concurrent_futures hangs

2012-03-09 Thread Miki Tebeka

Miki Tebeka  added the comment:

Of course now the tests pass and I can't reproduce it. Sorry.
You can close the issue or wait to see if someone else has the same problem.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2377] Replace __import__ w/ importlib.__import__

2012-03-09 Thread Brett Cannon

Brett Cannon  added the comment:

Two things I realized yesterday that need to be implemented (and some 
double-checking and/or opinion would be nice) while I wait for a full patch 
review.

One is ``python -v`` support. sys.flags has a verbose attribute that can be 
used to properly guard printing imported modules. It might be tricky, though, 
if sys.stderr is not set up properly during very early imports. I guess at 
worst I expose some sprintf() in imp just for this case (ugh).

Two is getting __import__() for situations where another import is triggered 
(e.g. fromlist stuff). I think the proper semantics is 
``globals['__builtins__']['__import__'] if '__builtins__' in globals else  
builtins.__import__``. Now where this gets tricky is that doing this means 
importlib.__import__(), when used directly from the importlib module, would 
sometimes use its implementation, and in other cases use builtins.__import__(). 
So either importlib.__import__() gets forked from builtins.__import__() so that 
it always uses importlib internally or simply don't worry about it and just 
have importlib.__import__() use builtins.__import__() when the need to trigger 
another import comes up. What do people think should happen?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9949] os.path.realpath on Windows does not follow symbolic links

2012-03-09 Thread Dave Burton

Dave Burton  added the comment:

This is a patch for the os.path.realpath() bug under Windows,  
http://bugs.python.org/issue9949  "os.path.realpath on Windows does not follow 
symbolic links"

ntpath.diff fixes the realpath() function to resolve symbolic links to their 
targets (tested under Windows 7).

Note: I tried to make the equivalent patch for Python 2.7, but it didn't work 
because the "from nt import _getfinalpathname" fails.

--
nosy: +ncdave4life
Added file: http://bugs.python.org/file24770/ntpath_fix_issue9949.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2377] Replace __import__ w/ importlib.__import__

2012-03-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> One is ``python -v`` support. sys.flags has a verbose attribute that
> can be used to properly guard printing imported modules. It might be
> tricky, though, if sys.stderr is not set up properly during very early
> imports.

Might or might not. You should try, there's a fallback stderr at
interpreter startup.

> Two is getting __import__() for situations where another import is
> triggered (e.g. fromlist stuff). I think the proper semantics is
> ``globals['__builtins__']['__import__'] if '__builtins__' in globals
> else  builtins.__import__``. Now where this gets tricky is that doing
> this means importlib.__import__(), when used directly from the
> importlib module, would sometimes use its implementation, and in other
> cases use builtins.__import__(). So either importlib.__import__() gets
> forked from builtins.__import__() so that it always uses importlib
> internally or simply don't worry about it and just have
> importlib.__import__() use builtins.__import__() when the need to
> trigger another import comes up. What do people think should happen?

I don't think I have understood anything :) It probably doesn't help,
but I think the __import__ signature is generally crazy, though.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14232] obmalloc: mmap() returns MAP_FAILED on error, not 0

2012-03-09 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset ba8f85e16dd9 by Victor Stinner in branch 'default':
Close #14232: catch mmap() failure in new_arena() of obmalloc
http://hg.python.org/cpython/rev/ba8f85e16dd9

--
nosy: +python-dev
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-09 Thread Glenn Linderman

Glenn Linderman  added the comment:

Sad.  That means all the documentation of workarounds needs to be written, even 
figured out in the first place.  Steven's code, while being a nice 
implementation when proper arguments are provided, produces inappropriate 
errors, because only the positional, or only the optional, parameters are 
printed when errors occur.

So it would probably take a third parser, with all the parameters defined, to 
exist, to allow easiest generation of the usage message, but I'm not quite sure 
how to catch the error printing, and redirect it to the third parser.

So, I tried the classes in t17.py; they are not complete; 
CompatibleArgumentParser should pass through all the other APIs, and I'm not 
sure if all the extension semantics can be appropriately passed through when 
there are three classes and two objects involved.  But this is sort of a 
proof-of-concept wrapper for achieving intermixed optional and positional 
arguments, and still get proper error messages.

--
Added file: http://bugs.python.org/file24771/t18.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14237] Special sequences \A and \Z don't work in character set []

2012-03-09 Thread py.user

py.user  added the comment:

Martin v. Löwis wrote:
> What behavior would you expect?

I expected similar work

>>> re.search(r'[\s]a', ' a').group()
' a'
>>> re.search(r'[\s]a', 'ba').group()
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'NoneType' object has no attribute 'group'
>>> 
>>> 
>>> re.search(r'[^\s]a', ' a').group()
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'NoneType' object has no attribute 'group'
>>> re.search(r'[^\s]a', 'ba').group()
'ba'
>>>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14242] Make subprocess.Popen aware of $SHELL

2012-03-09 Thread Dan Colish

New submission from Dan Colish :

The hardcoding of /bin/sh in the Popen _execute_child method can be a point of 
frustration when so many users are used to their chosen environment shell. The 
module can easily support the re-use of the defined $SHELL variable. I've 
attached a patch which gives one way of doing this. Before I get into writing 
tests for this, I wanted to float the idea of adding this feature.

--
components: Library (Lib)
files: popen_shell.diff
keywords: patch
messages: 155274
nosy: dcolish
priority: normal
severity: normal
status: open
title: Make subprocess.Popen aware of $SHELL
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file24772/popen_shell.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails

2012-03-09 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage:  -> patch review
versions: +Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14218] include rendered output in addition to markup

2012-03-09 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

It is not unusual and perhaps common for markup documentation to give rendered 
output for example input. This is similar to what we do in the tutorial and 
elsewhere with interactive examples:
>>> 2 + 2 # input code
4 # output of running the code

This may be fairly easy. Since the page is a rendered page, I presume some 
quoting mechanism is used to keep example text as is without being rendered. If 
so, all that should be needed is the same marked up text in a second box 
directive but without the quoting, so that it is rendered.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14237] Special sequences \A and \Z don't work in character set []

2012-03-09 Thread Matthew Barnett

Matthew Barnett  added the comment:

\s matches a character, whereas \A and \Z don't. Within a character set \s 
makes sense, but \A and \Z don't, so they should be treated as literals.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-09 Thread Glenn Linderman

Glenn Linderman  added the comment:

Of course, if a "real" solution can only be shipped in 3.3, it may want to use 
a different API than parse_args to avoid the parameter, parse_intermixed_args, 
perhaps. But my t18.py uses the name parse_args, but just always does the 
intermixed parsing, so that is something to be aware of if building on that 
code at all, for the real solution or for sample code for older versions.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14243] NamedTemporaryFile usability request

2012-03-09 Thread Dave Abrahams

New submission from Dave Abrahams :

NamedTemporaryFile is too hard to use portably when you need to open the file 
by name after writing it.  To do that, you need to close the file first (on 
Windows), which means you have to pass delete=False, which in turn means that 
you get no help in cleaning up the actual file resource, which as you can see 
from the code in tempfile.py is devilishly hard to do correctly.  The fact that 
it's different on posix (you can open the file for reading by name without 
closing it first) makes this problem worse. What we really need for this 
use-case is a way to say, "delete on __del__ but not on close()."

--
components: Library (Lib)
messages: 155278
nosy: dabrahams
priority: normal
severity: normal
status: open
title: NamedTemporaryFile usability request
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14238] python shouldn't need username in passwd database

2012-03-09 Thread Éric Araujo

Éric Araujo  added the comment:

> there should be a guard here that just doesn't add user site directories if 
> the lookup fails.
Agreed too.  site is easy to fix (I can do it or review a patch), but we also 
need to fix sysconfig; I think the right thing to do would be not to have a 
config var named 'userbase' when run from a UID without passwd entry.  This 
implies that the functions listed under 
http://docs.python.org/library/sysconfig#installation-paths would also need to 
omit *user schemes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14187] add "annotation" entry to Glossary

2012-03-09 Thread Éric Araujo

Éric Araujo  added the comment:

I think too that function annotations don’t need to be in the glossary; 
documenting them in the language reference section that talks about defining 
functions should be enough.  What do you think, Chris?

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14186] Link to PEP 3107 in "def" part of Language Reference

2012-03-09 Thread Éric Araujo

Éric Araujo  added the comment:

Sure.  Don’t know if we should use a seealso section or just a regular link.

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14219] start the Class tutorial in a more gentle manner

2012-03-09 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14235] test_cmd.py does not correctly call reload()

2012-03-09 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the report and patch.  This begs the question: why does the current 
buggy code not cause a test failure?

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14236] re: Docstring for \s and \S don’t mention Unicode

2012-03-09 Thread Éric Araujo

Éric Araujo  added the comment:

Please open another report for your second bug.  Thanks.

--
nosy: +eric.araujo
title: In help(re) are insufficient details -> re: Docstring for \s and \S 
don’t mention Unicode
versions: +Python 2.7, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14241] io.UnsupportedOperation.__new__(io.UnsupportedOperation) fails

2012-03-09 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14186] Link to PEP 3107 in "def" part of Language Reference

2012-03-09 Thread Chris Rebert

Chris Rebert  added the comment:

My suggestion was a seealso to parallel those in the "The with Statement" and 
"Class definitions" sections of the same page.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13532] In IDLE, sys.stdout.write and sys.stderr can write any pickleable object

2012-03-09 Thread Ramchandra Apte

Ramchandra Apte  added the comment:

What is the status of this bug?
It has been about two months since the last message.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14244] No information about behaviour with groups in pattern in the docstring for re.split

2012-03-09 Thread Ramchandra Apte

New submission from Ramchandra Apte :

help(re.split)

"split(pattern, string, maxsplit=0, flags=0)
Split the source string by the occurrences of the pattern,
returning a list containing the resulting substrings."


No info is given about behaviour with groups in pattern.
Created because of http://bugs.python.org/issue14236#msg155283.

--
assignee: docs@python
components: Documentation
messages: 155286
nosy: docs@python, ramchandra.apte
priority: normal
severity: normal
status: open
title: No information about behaviour with groups in pattern in the docstring 
for re.split

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14236] re: Docstring for \s and \S don’t mention Unicode

2012-03-09 Thread Ramchandra Apte

Ramchandra Apte  added the comment:

Done so see issue14244 .

--
nosy: +ramchandra.apte

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14244] No information about behaviour with groups in pattern in the docstring for re.split

2012-03-09 Thread Ramchandra Apte

Ramchandra Apte  added the comment:

Oops. The link in the last sentence doesn't work.
It should be see msg155283 .

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error

2012-03-09 Thread Tim Lesher

Tim Lesher  added the comment:

Victor: would you object to ysj.ray's solution? 

I don't think it was an option when we last looked at this issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com




[issue14244] No information about behaviour with groups in pattern in the docstring for re.split

2012-03-09 Thread py.user

Changes by py.user :


--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett, py.user
versions: +Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14243] NamedTemporaryFile usability request

2012-03-09 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14169] compiler.compile fails on "if" statement in attached file

2012-03-09 Thread Jim Jewett

Jim Jewett  added the comment:

If I understood correctly, that *is* the minimal case, which suggests some sort 
of size problem. 

That said, I could not duplicate on 2.6.2, nor with py_compile.compiler in 
3.2.2; I am not currently sufficiently motivated to install another version 
just for this.

--
nosy: +Jim.Jewett

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13532] In IDLE, sys.stdout.write and sys.stderr can write any pickleable object

2012-03-09 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Many issues take a while, depending on volunteers time and choice of priority.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14229] On KeyboardInterrupt, the exit code should mirror the signal number

2012-03-09 Thread Ross Lagerwall

Changes by Ross Lagerwall :


--
nosy: +rosslagerwall

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14235] test_cmd.py does not correctly call reload()

2012-03-09 Thread Josh Watson

Josh Watson  added the comment:

That particular function only gets called by running `./python 
Lib/test/test_cmd.py -c`, and not through regrtest.py, so I suspect that's why 
it wasn't noticed before. I just happened to be exploring test files and ran 
into an unhandled exception when I tried running it with the -c flag, haha.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >