[issue16398] deque.rotate() could be much faster

2013-01-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Why only 2.7 and 3.4?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16922] ElementTree.findtext() returns empty bytes object instead of empty string

2013-01-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file28675/etree_finditer_empty-3.2.patch

___
Python tracker 

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



[issue16922] ElementTree.findtext() returns empty bytes object instead of empty string

2013-01-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed. Patch updated.

--
Added file: http://bugs.python.org/file28711/etree_finditer_empty-3.2.patch

___
Python tracker 

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



[issue16850] Add "e" mode to open(): close-and-exec (O_CLOEXEC) / O_NOINHERIT

2013-01-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16899] Add support for C99 complex type (_Complex) as ctypes.c_complex

2013-01-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue11844] Update json to upstream simplejson latest release

2013-01-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16879] distutils.command.config uses fragile constant temporary file name

2013-01-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue14468] Update cloning guidelines in devguide

2013-01-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I just talked to Ezio on IRC about this.  I think it will be a lot easier to 
review and see what's going on with these changes if they are put forth in 
smaller, bite-sized pieces and committed incrementally.  It's harder to 
understand and have a dialogue about a large set of changes all at once.

I gave him some suggestions for first commits in this direction and offered to 
help more with breaking things up into smaller pieces if he needs it.  I also 
have an interest in simplifying our presentation/organization and in adding 
more information about using Mercurial more effectively (e.g. issue 16930 and 
issue 16931).

--

___
Python tracker 

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



[issue14468] Update cloning guidelines in devguide

2013-01-13 Thread Ezio Melotti

Ezio Melotti added the comment:

I added more comments on bitbucket to indicate the new parts, the ones that 
have been moved, and the ones that have been removed.  That should make reviews 
easier.

I still haven't looked at the original FAQs (in faqs.rst), and still have to 
decide what should go where.  The general idea is that committers-specific FAQs 
should go in committing.rst, and the rest should go in faqs.rst.
Another option is to keep in committing.rst only the "4 fundamental FAQs" (i.e. 
"In what branches should I commit?", "In what order should I merge my 
commits?", "How do I merge between different branches (within the same major 
version)?", "How do I port a changeset between the two major Python versions 
(2.x and 3.x)?"), and move all the other stubs (including the one about null 
merges) on faqs.rst, possibly grouping them in two different sections: 
committers and contributors.

--

___
Python tracker 

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



[issue14468] Update cloning guidelines in devguide

2013-01-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I think it could cause confusion to have FAQs spread across two different files 
because then we'll have to distinguish between two FAQs in our hyperlinks, and 
it won't be obvious which FAQ page contains which questions.

I would recommend creating a new section in our existing FAQ called something 
like "Using Mercurial with CPython," optionally subdividing that into a 
committer section and an "everyone" section.  The original section can be 
morphed into a section answering generic questions about Mercurial (not 
necessarily specific to CPython or the patch workflow).

If a question is important enough to be on the same page as the rest of 
committing.rst, it can be added as a normal section of that page (what is the 
need to give all of those sections FAQ-style titles?).

--

___
Python tracker 

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



[issue14208] No way to recover original argv with python -m

2013-01-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> For PEP 432, I'm proposing to expose this as sys._configuration.raw_argv

I think sys.raw_argv would be as good. It's not really (not only) a
configuration item.

--

___
Python tracker 

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



[issue14468] Update cloning guidelines in devguide

2013-01-13 Thread Ezio Melotti

Ezio Melotti added the comment:

I used FAQ-style titles to make easier to find the solution starting from a 
problem ("how do I do X?") and because I was planning to add more, but I can 
revert them to normal titles.
So that would result in 4 sections:
 * Active branches (was "In what branches should I commit?");
 * Merging order (was "In what order should I merge my commits?");
 * Merging between different branches (within the same major version) (was "How 
do I merge between different branches (within the same major version)?");
 * Porting changesets between the two major Python versions (2.x and 3.x) (was 
"How do I port a changeset between the two major Python versions (2.x and 
3.x)?");

At the end of committing.rst I can add a link to the "committers faqs" in 
faqs.rst, and add more FAQs there.  Everything about null merges, head merges, 
merge conflicts, long-term development branches etc. will go to faqs.rst.

--

___
Python tracker 

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



[issue16949] removal of string exceptions is already done

2013-01-13 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe:

This part of the PEP is written as if string exceptions are currently being 
removed, which is not the case.

Also, it is probably more accurate to say "they are forbidden *and* are 
removed", instead of "they are forbidden *because* they are are removed.

--
assignee: docs@python
components: Documentation
files: string-exceptions.diff
keywords: patch
messages: 179854
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: removal of string exceptions is already done
Added file: http://bugs.python.org/file28712/string-exceptions.diff

___
Python tracker 

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



[issue16949] removal of string exceptions is already done

2013-01-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue14208] No way to recover original argv with python -m

2013-01-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I'm not seeing a good justification for doing anything more, though:
> 
> - needing to access this information is an exceedingly niche use case
> - I don't see any way for raw_argv to be useful in a cross-implementation 
> manner.

I expect it to be useful in the "launch (almost) the same command in the
same way" situation.
Not that it happens often :-)

--

___
Python tracker 

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



[issue14208] No way to recover original argv with python -m

2013-01-13 Thread Nick Coghlan

Nick Coghlan added the comment:

I'm not seeing a good justification for doing anything more, though:

- needing to access this information is an exceedingly niche use case
- I don't see any way for raw_argv to be useful in a cross-implementation 
manner.
- the exposure as sys._configuration.raw_argv is a natural consequence of the 
PEP 432 implementation (it's there to allow an embedding application to 
override the command line arguments seen by CPython)

Elevating it to part of the language standard doesn't make sense, while 
exposing it as an implementation feature of the CPython initialisation process 
seems more reasonable.

--

___
Python tracker 

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



[issue16950] the old raise syntax is not legal in Python 3

2013-01-13 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe:

There is an outdated statement that "the old form of raising exceptions *will* 
be removed in Python 3". It's ambiguous in that you don't know if such was ever 
in Python 3, and it is also time-sensitive (and now outdated).

--
assignee: docs@python
components: Documentation
messages: 179857
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: the old raise syntax is not legal in Python 3

___
Python tracker 

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



[issue16950] the old raise syntax is not legal in Python 3

2013-01-13 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
keywords: +patch
Added file: http://bugs.python.org/file28713/raise-exception.diff

___
Python tracker 

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



[issue16949] removal of string exceptions is already done

2013-01-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bf68a42a43bf by Georg Brandl in branch 'default':
Closes #16949: update wording about string exceptions.
http://hg.python.org/peps/rev/bf68a42a43bf

--
nosy: +python-dev
resolution:  -> fixed
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



[issue16950] the old raise syntax is not legal in Python 3

2013-01-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 89db18c77152 by Georg Brandl in branch 'default':
Closes #16950: update wording about raise syntax.
http://hg.python.org/peps/rev/89db18c77152

--
nosy: +python-dev
resolution:  -> fixed
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



[issue14468] Update cloning guidelines in devguide

2013-01-13 Thread Nick Coghlan

Nick Coghlan added the comment:

The combination of the last two suggestions sounds good to me.

--

___
Python tracker 

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



[issue16951] expand on meaning of 'string literals that rely on significant trailing whitespace'

2013-01-13 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe:

In PEP 8, there is:

> Don't write string literals that rely on significant trailing whitespace

It's not clear to me what this means, and therefore likely needs further 
explanation, or maybe an example.

--
assignee: docs@python
components: Documentation
messages: 179861
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: expand on meaning of 'string literals that rely on significant trailing 
whitespace'

___
Python tracker 

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



[issue16951] expand on meaning of 'string literals that rely on significant trailing whitespace'

2013-01-13 Thread Georg Brandl

Georg Brandl added the comment:

It means not write 

a = "abc"

as

a = """abc
"""

with the four spaces trailing at the end of the line.  I don't think there is a 
more concise way of putting it in the PEP.

--
nosy: +georg.brandl
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



[issue14468] Update cloning guidelines in devguide

2013-01-13 Thread Ezio Melotti

Ezio Melotti added the comment:

I made a separate repo to implement this and divided the previous commits in 
smaller ones: https://bitbucket.org/ezio_melotti/devguide-14468
If this is OK, I'll start regrouping the FAQs in faqs.rst and then move there 
the section about long-term development of features.

--

___
Python tracker 

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



[issue11844] Update json to upstream simplejson latest release

2013-01-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Which simplejson features or fixes exactly are missing from the json module?

--
nosy: +pitrou

___
Python tracker 

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



[issue11159] Sax parser crashes if given unicode file name

2013-01-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file28268/sax_unicode_fn-2.7.patch

___
Python tracker 

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



[issue11159] Sax parser crashes if given unicode file name

2013-01-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file28268/sax_unicode_fn-2.7.patch

___
Python tracker 

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



[issue11844] Update json to upstream simplejson latest release

2013-01-13 Thread Ezio Melotti

Ezio Melotti added the comment:

Is there any reason why the two codebases are maintained separately instead of 
being kept in sync? (and what's the reason for simplejson to be still 
maintained?  faster release cycles? compatibility with older Python versions?)

--

___
Python tracker 

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



[issue11159] Sax parser crashes if given unicode file name

2013-01-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ported tests for nonascii System-Id on 3.x.

If no one objects I'll commit this next week.

--
Added file: http://bugs.python.org/file28714/sax_unicode_fn-3.x.patch

___
Python tracker 

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2013-01-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated (tostring() and tostringlist() refet to write() about 
short_empty_elements parameter). Perhaps descriptions of encoding and method 
parameters should not be repeated too?

> Why do you force short_empty_elements to be keyword only?

Because sequences of parameters in XMLGenerator(), ElementTree.write(), 
ElementTree.tostring() are different and this can confuse. Also it will be 
easer to deprecate or rename keyword-only parameter in future (in favor of 
general fabric for example). I think that all optional, non-basic and very 
rarely used parameters should by keyword-only.

--
Added file: http://bugs.python.org/file28715/etree_short_empty_elements_2.patch

___
Python tracker 

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



[issue11844] Update json to upstream simplejson latest release

2013-01-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue16535. I doubt that json should support decimals in this manner, 
with special boolean parameter instead of general fabric function. Current 
simlejson has too many special parameters.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16535] json encoder unable to handle decimal

2013-01-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Decimal numbers should simply be serializable by default. It doesn't make sense 
to add a specialized option.

--
components: +Library (Lib)
type: behavior -> enhancement

___
Python tracker 

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



[issue13659] Add a help() viewer for IDLE's Shell.

2013-01-13 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Patch LGTM.

--

___
Python tracker 

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



[issue2226] Small _abcoll Bugs / Oddities

2013-01-13 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Bump.

--
nosy: +ramchandra.apte

___
Python tracker 

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



[issue16922] ElementTree.findtext() returns empty bytes object instead of empty string

2013-01-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 849eb27baf1c by Eli Bendersky in branch '3.2':
Issue #16922: fixed findtext() to return empty Unicode string instead of empty 
bytes object when there's no text.
http://hg.python.org/cpython/rev/849eb27baf1c

New changeset 6323e5f1ed81 by Eli Bendersky in branch '3.3':
Issue #16922: fixed findtext() to return empty Unicode string instead of empty 
bytes object when there's no text.
http://hg.python.org/cpython/rev/6323e5f1ed81

New changeset c38423931724 by Eli Bendersky in branch 'default':
Issue #16922: fixed findtext() to return empty Unicode string instead of empty 
bytes object when there's no text.
http://hg.python.org/cpython/rev/c38423931724

--
nosy: +python-dev

___
Python tracker 

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



[issue16922] ElementTree.findtext() returns empty bytes object instead of empty string

2013-01-13 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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2013-01-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 58168d69b496 by Eli Bendersky in branch 'default':
Close #14377: Add a new parameter to ElementTree.write and some module-level
http://hg.python.org/cpython/rev/58168d69b496

--
nosy: +python-dev
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



[issue16915] mode of socket.makefile is more limited than documentation suggests

2013-01-13 Thread Antoon Pardon

Antoon Pardon added the comment:

I think one could argue for allowing mode "r+" instead of "wb". Because "w" 
suggest truncation, which doesn't make sense on sockets either.

But in the end I agree that allowing 'r', 'w', 'b' and 't' is probably the best 
compromise available.

--

___
Python tracker 

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2013-01-13 Thread Éric Araujo

Éric Araujo added the comment:

I don’t think a space before the slash should be added.  (It was common in the 
days of XHTML 1 because of an SGML parsing hack.)

--
nosy: +eric.araujo

___
Python tracker 

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



[issue16951] expand on meaning of 'string literals that rely on significant trailing whitespace'

2013-01-13 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe added the comment:

> I don't think there is a more concise way of putting it in the PEP.

Is it not more important to be clear than to be concise? Can't you put
this info that PEP, or at least a link to this issue?

--

___
Python tracker 

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



[issue16952] test_kqueue failure on NetBSD/OpenBSD

2013-01-13 Thread Charles-François Natali

New submission from Charles-François Natali:

test_kqueue fails on both NetBSD and OpenBSD:
http://buildbot.python.org/all/builders/AMD64 NetBSD 5.1.2 [SB] 
2.7/builds/206/steps/test/logs/stdio
http://buildbot.python.org/all/builders/x86 OpenBSD 5.1 [SB] 
2.7/builds/153/steps/test/logs/stdio

"""
==
FAIL: test_queue_event (test.test_kqueue.TestKQueue)
--
Traceback (most recent call last):
  File 
"/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/test/test_kqueue.py",
 line 129, in test_queue_event
(server.fileno(), select.KQ_FILTER_WRITE, flags)])
AssertionError: Lists differ: [(10L, 1, 5L), (11L, 1, 5L)] != [(10, 1, 0), (11, 
1, 0)]

First differing element 0:
(10L, 1, 5L)
(10, 1, 0)

- [(10L, 1, 5L), (11L, 1, 5L)]
? - ^^  - ^^

+ [(10, 1, 0), (11, 1, 0)]
?  ^ 
"""

The test assumes that the input flags (EV_ADD, EV_ENABLE...) will be returned 
in the output events. It's apparently not the case on OpenBSD and NetBSD (and 
probably on OS-X neither, because this check is disabled on this platform), and 
I can't see anything in the kqueue man pages hinting to this behavior (only 
specific flags will be set on output, like EV_ERROR). Knowing which flag was 
specified is not really useful actually.

The patch attached just removes this check (we keep checking the file 
descriptors and filter, of course).

--
components: Tests
files: kqueue_flags.diff
keywords: needs review, patch
messages: 179877
nosy: neologix
priority: normal
severity: normal
stage: patch review
status: open
title: test_kqueue failure on NetBSD/OpenBSD
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file28716/kqueue_flags.diff

___
Python tracker 

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2013-01-13 Thread Eli Bendersky

Eli Bendersky added the comment:

On Sun, Jan 13, 2013 at 6:09 AM, Éric Araujo  wrote:

>
> Éric Araujo added the comment:
>
> I don’t think a space before the slash should be added.  (It was common in
> the days of XHTML 1 because of an SGML parsing hack.)
>

Ok, will fix.

--

___
Python tracker 

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



[issue16951] expand on meaning of 'string literals that rely on significant trailing whitespace'

2013-01-13 Thread Ezio Melotti

Ezio Melotti added the comment:

I think the sentence is already clear enough --- editors often remove trailing 
spaces, so if they are significant (e.g. if they are in a string literal) they 
are at risk.  This is actually more a general advice than a styling guideline, 
so I'm not even sure it belongs to the PEP 8.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue16945] rewrite CGIHTTPRequestHandler to always use subprocess

2013-01-13 Thread Charles-François Natali

Changes by Charles-François Natali :


--
nosy: +orsenthil

___
Python tracker 

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



[issue16953] select module compile errors with broken poll()

2013-01-13 Thread Jeffrey Armstrong

New submission from Jeffrey Armstrong:

On a platform with a broken poll() function (as detected during configure), 
Modules/selectmodule.c fails to compile.  The error occurs at two points:

./Modules/selectmodule.c:2100: `select_poll' undeclared here (not in a function)
./Modules/selectmodule.c:2100: initializer element is not constant
./Modules/selectmodule.c:2100: (near initialization for 
`select_methods[1].ml_meth')
./Modules/selectmodule.c:2100: `poll_doc' undeclared here (not in a function)
./Modules/selectmodule.c:2100: initializer element is not constant
./Modules/selectmodule.c:2100: (near initialization for 
`select_methods[1].ml_doc')
./Modules/selectmodule.c: In function `PyInit_select':
./Modules/selectmodule.c:2159: `poll_Type' undeclared (first use in this 
function)
./Modules/selectmodule.c:2159: (Each undeclared identifier is reported only once
./Modules/selectmodule.c:2159: for each function it appears in.)

The problem is occurring because both "select_poll" and "poll_Type" are 
undeclared if HAVE_BROKEN_POLL is declared.  The fix would be on two lines:

selectmodule.c:2099
#ifdef(HAVE_POLL)
should be:
#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)

selectmodule.c:2149
#if defined(HAVE_POLL)
should be:
#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)

Making these two minor changes allows selectmodule.c to compile fine in the 
case where the platform has a "broken" poll().

This bug was found on m68k-atari-mint compiling using gcc 2.95.3

--
components: Build
messages: 179880
nosy: Jeffrey.Armstrong
priority: normal
severity: normal
status: open
title: select module compile errors with broken poll()
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



[issue16954] Add docstrings for ElementTree module

2013-01-13 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Perhaps almost all Doxygen comments in ElementTree module should be converted 
to docstrings.

--
assignee: docs@python
components: Documentation, XML
messages: 179881
nosy: docs@python, eli.bendersky, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Add docstrings for ElementTree module
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue16953] select module compile errors with broken poll()

2013-01-13 Thread Jeffrey Armstrong

Changes by Jeffrey Armstrong :


--
type:  -> compile error

___
Python tracker 

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



[issue1633941] for line in sys.stdin: doesn't notice EOF the first time

2013-01-13 Thread Jaroslav Henner

Changes by Jaroslav Henner :


--
nosy: +jary

___
Python tracker 

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



[issue14208] No way to recover original argv with python -m

2013-01-13 Thread Daniel Shahaf

Daniel Shahaf added the comment:

Antoine Pitrou wrote on Sun, Jan 13, 2013 at 10:19:20 +:
> 
> Antoine Pitrou added the comment:
> 
> > I'm not seeing a good justification for doing anything more, though:
> > 
> > - needing to access this information is an exceedingly niche use case
> > - I don't see any way for raw_argv to be useful in a cross-implementation 
> > manner.
> 
> I expect it to be useful in the "launch (almost) the same command in the
> same way" situation.
> Not that it happens often :-)

What about the "launch a different command with the same interpreter
flags" use-case?  For example, having 'python -E foo.py --foooptions'
want to execute 'python -E bar.py'.

Perhaps it'll be cleaner to expose in state_argv ['python', '-E']; in
sys.argv ['foo.py', '--foooptions']; and have scripts that want to exec
themselves use an idiomatic os.execv(sys.executable, sys.state_argv + sys.argv).

--

___
Python tracker 

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



[issue16580] Add examples to int.to_bytes and int.from_bytes

2013-01-13 Thread Ramchandra Apte

Changes by Ramchandra Apte :


--
title: Add examples to int.to_bytres and int.from_bytes -> Add examples to 
int.to_bytes and int.from_bytes

___
Python tracker 

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



[issue16954] Add docstrings for ElementTree module

2013-01-13 Thread Eli Bendersky

Eli Bendersky added the comment:

Definitely. And this is one of those issues where I can wholeheartedly say that 
patches are welcome :-)

Even incremental patching will be OK (i.e. patches documenting single methods 
or groups of methods).

Incidentally, while replacing the comment by docstring for issue #14377, I 
noticed an argument (default_namespace) that wasn't documented anywhere, 
including the ReST docs. So such a transition can have more benefits than seems 
on the surface.

--
keywords: +easy

___
Python tracker 

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



[issue16920] multiprocessing.connection listener gets MemoryError onrecv

2013-01-13 Thread John Brearley

John Brearley added the comment:

Hi Richard: Thanks for the update. Yes, the multiprocessing.communication.Client
works much better. The residual issue left here is wether Python is vulnerable
to a DOS attack. If someone used regular sockets deliberately, they could crash
multiprocessing server code deliberately. Any chance of doing a real message
length check against the embedded message length check?

Might not hurt for documentation to state that raw sockets are not supported,
that you must use the client.

Regards, John Brearley 
613-259-5622 (H)

--
title: multiprocessing.connection listener gets MemoryError on recv -> 
multiprocessing.connection listener gets MemoryError onrecv

___
Python tracker 

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



[issue16955] multiprocessing.connection poll() always returns false

2013-01-13 Thread John Brearley

New submission from John Brearley:

In the attached multiprocessing.connection simple client script, the poll() 
method is always returning false. If I force the temp variable to 1, the 
recv()method happily gets the incoming data. I had hoped to use the poll() 
method to implement a timeout error, to avoid the blocking nature of the client.

--
files: socket_client_mp.py
messages: 179885
nosy: jbrearley
priority: normal
severity: normal
status: open
title: multiprocessing.connection poll() always returns false
versions: Python 3.3
Added file: http://bugs.python.org/file28717/socket_client_mp.py

___
Python tracker 

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



[issue6975] symlinks incorrectly resolved on POSIX platforms

2013-01-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't really understand your algorithm. Why do you need a stack? It should be 
simply iterative:
- if the symlink is relative, prepend the symlink target to the rest
- if the symlink is absolute, discard the current path and prepend the symlink 
target to the rest

Here is how pathlib does it:
https://bitbucket.org/pitrou/pathlib/src/67a2524b057f1af5b3cba26370b1353e73cdda16/pathlib.py?at=default#cl-227

--

___
Python tracker 

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



[issue16535] json encoder unable to handle decimal

2013-01-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16956] Allow signed line number deltas in the code object's line number table

2013-01-13 Thread Mark Shannon

New submission from Mark Shannon:

The restriction that line numbers must be monotonically increasing w.r.t 
bytecode offset in the co_lnotab array prevents a number of beneficial 
transformations in the bytecode compiler.

This patch allows negative line number deltas and uses this capability to 
generate code for 'while' loops in standard text book fashion, putting the test 
*after* the body.

--
hgrepos: 172
messages: 179887
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Allow signed line number deltas in the code object's  line number table

___
Python tracker 

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



[issue16956] Allow signed line number deltas in the code object's line number table

2013-01-13 Thread Mark Shannon

Changes by Mark Shannon :


--
keywords: +patch
Added file: http://bugs.python.org/file28718/dd04caae6647.diff

___
Python tracker 

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



[issue16500] Add an 'atfork' module

2013-01-13 Thread Georg Brandl

Georg Brandl added the comment:

Might make sense to put this in atexit.atfork() to avoid small-module inflation?

--
nosy: +georg.brandl

___
Python tracker 

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



[issue444582] Finding programs in PATH, adding shutil.which

2013-01-13 Thread Thomas Kluyver

Thomas Kluyver added the comment:

The 'short circuit' appears to do what I'd consider the wrong thing when an 
executable file of the same name exists in the working directory. i.e. 
which('setup.py') can return 'setup.py', even though running 'setup.py' in a 
shell doesn't work (you need ./setup.py).

This is on UNIX-y systems, I see from the comments that the cwd is implicitly 
on the path in Windows.

Is this in scope for which() to deal with? Should I open a bug for it? 
Apologies if it's been discussed already.

--
nosy: +takluyver

___
Python tracker 

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



[issue16920] multiprocessing.connection listener gets MemoryError onrecv

2013-01-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> If someone used regular sockets deliberately, they could crash
> multiprocessing server code deliberately. Any chance of doing a real message
> length check against the embedded message length check?

You can do

message = conn.recv_bytes(maxlength)

if you want a length check -- OSError will be raised if the message is too long.

But Listener() and Client() are *not* replacements for the normal socket API 
and I would not really advise using them for communication over a network.  
They are mostly used internally by multiprocessing -- and then only with digest 
authentication.

All processes in the same program inherit the same randomly generated 
authentication key -- current_process().authkey.  If you create a listener by 
doing

listener = Listener(address, authenticate=True)

then other processes from the same program can connect by doing

conn = Client(address, authenticate=True)

Without knowing the correct authentication key it is not possible to connect 
and do a DOS like you describe.

--

___
Python tracker 

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



[issue444582] Finding programs in PATH, adding shutil.which

2013-01-13 Thread Brian Curtin

Brian Curtin added the comment:

Please open a separate issue.

--

___
Python tracker 

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



[issue2128] sys.argv is wrong for unicode strings

2013-01-13 Thread Michael Herrmann

Michael Herrmann added the comment:

Hi,

is it correct that this bug no longer appears in Python 2.7.3? I checked the 
changelogs of 2.7, but couldn't find anything.

Thanks!
Michael

--
nosy: +mherrmann.at

___
Python tracker 

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



[issue1159051] Handle corrupted gzip files with unexpected EOF

2013-01-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2013-01-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think Éric means different spaces, spaces in empty tags ( vs 
). I don't know what the standard says about this. It should a 
separated issue.

As for line continuations in docs, in all cases where they are occurred, a 
space used before a backslash for readability. I have reverted this change in 
50606131a987.

--

___
Python tracker 

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



[issue16955] multiprocessing.connection poll() always returns false

2013-01-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Thanks for the report.

It seems to only affect Windows, and only when using sockets rather than pipes.

Till this is fixed you could use

temp = bool(multiprocessing.connection.wait([cl], 1))

instead of

temp = cl.poll(1)


As I mentioned on the other issue, I would not advise use of Listener() and 
Client() without using authentication -- you are probably better off using raw 
sockets and select().

--
nosy: +sbt

___
Python tracker 

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



[issue10527] multiprocessing.Pipe problem: "handle out of range in select()"

2013-01-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

The commits did not have the intended effect.

They just define a _poll() function (and only on Windows) and it is not 
referenced anywhere else.

I will look in to fixing this -- on 2.7 and 3.2 this will need to be done in 
the C code.

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

___
Python tracker 

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



[issue16398] deque.rotate() could be much faster

2013-01-13 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Jesús, I backported this to 2.7 because it was affecting intended usability of 
multiple parts of the API.  The current code had the egregious and unintended 
side-effect of touching every data element during a rotate -- this resulted in 
a huge number of unnecessary cache line misses and was blowing useful data out 
of cache.

IMO, a performance bug is different from a micro-optimization, especially if it 
is affecting the intended uses for part of an API.

Serhiy, you're welcome to backport to 3.3 if you desire.

--

___
Python tracker 

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



[issue16500] Add an 'atfork' module

2013-01-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16935] unittest should understand SkipTest at import time during test discovery

2013-01-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-13 Thread Thomas Kluyver

New submission from Thomas Kluyver:

There's a 'short circuit' in shutil.which(), described as 'If we're given a 
full path which matches the mode and it exists, we're done here.'

It also matches if an executable file of the same name is present in the 
working directory, although on most Unix-y systems you need ./ to execute such 
files in a shell (i.e. ./foo, not just foo).

This could fool code calling which() into thinking that a program is installed, 
when it is not.

If we consider this a bug, one simple fix would be to only allow the short 
circuit with an absolute path, so the line

if _access_check(cmd, mode):

would become

if os.path.isabs(cmd) and _access_check(cmd, mode):

--
components: Library (Lib)
messages: 179897
nosy: takluyver
priority: normal
severity: normal
status: open
title: shutil.which() shouldn't look in working directory on unix-y systems
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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2013-01-13 Thread Eli Bendersky

Eli Bendersky added the comment:

OK, thanks.

--

___
Python tracker 

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



[issue15651] PEP 3121, 384 refactoring applied to elementtree module

2013-01-13 Thread Eli Bendersky

Eli Bendersky added the comment:

I looked at the patch a bit more in depth and must admit that I'm reluctant to 
apply it. It's a very large patch with very little documentation about what 
steps are taken and why, and I just don't see the motivation. 

The way I see it, PEP 384 is great for compatibility of third-party extensions 
and embeddings of Python, but much less critical for a module that's always 
distributed as part of stdlib and thus is kept in exact sync with the ABI of 
the Python version it comes with. Correct me if I'm wrong.

That said, I won't object to some refactoring if it improves the code. But when 
such large changes are proposed, I really prefer to see small, incremental 
patches that replace just a part of the code. Such patches should come with an 
explanation of why the change is made (i.e. which part of PEP 384 does it 
adhere to).

--

___
Python tracker 

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



[issue16955] multiprocessing.connection poll() always returns false

2013-01-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e1c81ab5ad97 by Richard Oudkerk in branch '3.3':
Issue #16955: Fix the poll() method for multiprocessing's socket
http://hg.python.org/cpython/rev/e1c81ab5ad97

New changeset d904a741afde by Richard Oudkerk in branch 'default':
Issue #16955: Fix the poll() method for multiprocessing's socket
http://hg.python.org/cpython/rev/d904a741afde

--
nosy: +python-dev

___
Python tracker 

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



[issue16955] multiprocessing.connection poll() always returns false

2013-01-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

This should be fixed now.

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue10527] multiprocessing.Pipe problem: "handle out of range in select()"

2013-01-13 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

What do you mean? The intent was to use poll() instead of select() anywhere 
available in order to avoid running out of fds.
The change didn't affect Windows because as of right now select() is the only 
thing available.

--

___
Python tracker 

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



[issue16935] unittest should understand SkipTest at import time during test discovery

2013-01-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Without the proposed enhancement, you could also combine Éric's approach with 
the original patch by doing something like:

try:
support.import_module(module)
except SkipTest:
module = None

def setUpModule():
if module is None:
raise SkipTest()

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue16935] unittest should understand SkipTest at import time during test discovery

2013-01-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Should be: "module = support.import_module('module')"

--

___
Python tracker 

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



[issue8145] Documentation about sqlite3 isolation_level

2013-01-13 Thread R. David Murray

R. David Murray added the comment:

Here is a revised patch.  I am leaving out the changes relating to the 
transaction manager.  It turns out that the transaction manager doesn't do 
anything useful even if isolation_level is not None.  I'm going to open a new 
issue to discuss the best way to fix it, and any documentation changes relating 
to any leftover brokenness will be part of that issue.

--
Added file: http://bugs.python.org/file28719/sqlite_transaction_doc.patch

___
Python tracker 

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



[issue8145] Documentation about sqlite3 isolation_level

2013-01-13 Thread R. David Murray

R. David Murray added the comment:

I misspoke, the transaction manager does do something useful in non-None 
isolation level.  I'm still going to open a bug about isolation_level None.

--

___
Python tracker 

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



[issue10527] multiprocessing.Pipe problem: "handle out of range in select()"

2013-01-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> What do you mean? The intent was to use poll() instead of select() 
> anywhere available in order to avoid running out of fds.
> The change didn't affect Windows because as of right now select() is 
> the only thing available.

The change *only* effects Windows.  Currently the code goes

if sys.platform != 'win32':
...
else:
if hasattr(select, 'poll'):
def _poll(fds, timeout):
...
else:
def _poll(fds, timeout):
...

So _poll() is only defined when sys.platform == 'win32'.

Furthermore, the _poll() function is never used anywhere: ConnectionBase.poll() 
uses Connection._poll(), which uses wait(), which uses select().

--

___
Python tracker 

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



[issue10527] multiprocessing.Pipe problem: "handle out of range in select()"

2013-01-13 Thread Richard Oudkerk

Richard Oudkerk added the comment:

It looks like the change to multiprocessing/connection.py committed does not 
match the one uploaded as issue10527-3.patch

changeset 81174:e971a70984b8
 1.1 --- a/Lib/multiprocessing/connection.py
 1.2 +++ b/Lib/multiprocessing/connection.py
 1.3 @@ -509,6 +509,27 @@ if sys.platform != 'win32':
 1.4  return c1, c2
 1.5  
 1.6  else:
 1.7 +if hasattr(select, 'poll'):
 1.8 +def _poll(fds, timeout):
 1.9 +if timeout is not None:
1.10 +timeout = int(timeout) * 1000  # timeout is in 
milliseconds
1.11 +fd_map = {}
1.12 +pollster = select.poll()
1.13 +for fd in fds:
1.14 +pollster.register(fd, select.POLLIN)
1.15 +if hasattr(fd, 'fileno'):
1.16 +fd_map[fd.fileno()] = fd
1.17 +else:
1.18 +fd_map[fd] = fd
1.19 +ls = []
1.20 +for fd, event in pollster.poll(timeout):
1.21 +if event & select.POLLNVAL:
1.22 +raise ValueError('invalid file descriptor %i' % 
fd)
1.23 +ls.append(fd_map[fd])
1.24 +return ls
1.25 +else:
1.26 +def _poll(fds, timeout):
1.27 +return select.select(fds, [], [], timeout)[0]
1.28  
1.29  def Pipe(duplex=True):
1.30  '''

issue10527-3.patch:
diff --git a/Lib/multiprocessing/connection.py 
b/Lib/multiprocessing/connection.py
--- a/Lib/multiprocessing/connection.py
+++ b/Lib/multiprocessing/connection.py
@@ -861,6 +861,27 @@
 return [o for o in object_list if o in ready_objects]
 
 else:
+if hasattr(select, 'poll'):
+def _poll(fds, timeout):
+if timeout is not None:
+timeout = int(timeout) * 1000  # timeout is in milliseconds
+fd_map = {}
+pollster = select.poll()
+for fd in fds:
+pollster.register(fd, select.POLLIN)
+if hasattr(fd, 'fileno'):
+fd_map[fd.fileno()] = fd
+else:
+fd_map[fd] = fd
+ls = []
+for fd, event in pollster.poll(timeout):
+if event & select.POLLNVAL:
+raise ValueError('invalid file descriptor %i' % fd)
+ls.append(fd_map[fd])
+return ls
+else:
+def _poll(fds, timeout):
+return select.select(fds, [], [], timeout)[0]
 
 def wait(object_list, timeout=None):
 '''
@@ -870,12 +891,12 @@
 '''
 if timeout is not None:
 if timeout <= 0:
-return select.select(object_list, [], [], 0)[0]
+return _poll(object_list, 0)
 else:
 deadline = time.time() + timeout
 while True:
 try:
-return select.select(object_list, [], [], timeout)[0]
+return _poll(object_list, timeout)
 except OSError as e:
 if e.errno != errno.EINTR:
 raise

--

___
Python tracker 

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



[issue16958] The sqlite3 context manager does not work with isolation_level=None

2013-01-13 Thread R. David Murray

New submission from R. David Murray:

Its operation is also not particularly intuitive if isolation_level is not 
None, so its documentation needs some clarification.

Currently the transaction manager does nothing on enter, and does a commit or 
rollback on exit, depending on whether or not there was an exception inside the 
with block.  With isolation_level set to None, the sqlite3 library is in 
autocommit mode, so changes will get committed immediately inside the with, 
which is simply broken.

If isolation_level is not None, then the behavior of the transaction manager 
depends heavily on what happens inside the with block.  If the with block 
contains only the defined DQL statements (insert, update, delete, replace) and 
select statements, then things will work as expected.  However, if another 
statement (such as a CREATE TABLE or a PRAGMA) is included in the with block, 
an intermediate commit will be done and a new transaction started.

I propose to do two things to fix this issue: explain the above in the 
transactions manager docs, and have the context manager check to see if we are 
in isolation_level None, and if so, issue a begin (and then document that as 
well).

One question is, can the fix be backported?  It will change the behavior of 
code that doesn't throw an error, but most such code won't be doing what the 
author expected (run the with block inside a transaction...in pure autocommit 
mode the transaction manager is a no-op).  One place code could break is if 
someone figured out this issue and worked around it by explicitly starting a 
transaction before (or after) entering the with block.  In this case they would 
now get an error that a transaction cannot be started inside another.  I would 
think this is unlikely...the more obvious workaround would be to write a custom 
transaction manager, so I suspect that that is what is actually in the field.  
But that's a (hopeful :) guess.

A fix for this problem would be to use 'savepoint' instead of 'begin' if the 
sqlite3 version supports it (it is apparently supported as of 3.6.8).

So, I'd like to see the fix, conditionally using SAVEPOINT, (once it written 
and tested) applied to all active python versions, but am open to the argument 
that it shouldn't be.

--
components: Extension Modules, Library (Lib)
keywords: easy
messages: 179909
nosy: ghaering, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: The sqlite3 context manager does not work with isolation_level=None
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue8145] Documentation about sqlite3 isolation_level

2013-01-13 Thread R. David Murray

R. David Murray added the comment:

Opened issue 16958 for the transaction manager problem.

--

___
Python tracker 

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



[issue16958] The sqlite3 context manager does not work with isolation_level=None

2013-01-13 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +nagylzs

___
Python tracker 

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



[issue10527] multiprocessing.Pipe problem: "handle out of range in select()"

2013-01-13 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Damn, you're right. I must have messed up something while porting the patch 
from 3.2 all the way up to 3.4 as the merge produced some conflicts.

--

___
Python tracker 

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



[issue16958] The sqlite3 context manager does not work with isolation_level=None

2013-01-13 Thread Martin v . Löwis

Martin v. Löwis added the comment:

"changes will get committed immediately inside the with, which is simply broken"

What do you mean by that?
A. Changes ought to be committed immediately, but are not; it is broken, and 
changes must be committed immediately.
- or -
B. What actually happens is that changes are committed immediately, and sqlite 
is incorrect in doing so.

Your discussion suggests B; in this case, I disagree that there is a bug. In 
auto-commit mode, it should really auto-commit, regardless of context managers. 
The context manager documentation doesn't claim otherwise.

--
nosy: +loewis

___
Python tracker 

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



[issue16958] The sqlite3 context manager does not work with isolation_level=None

2013-01-13 Thread R. David Murray

R. David Murray added the comment:

B, yes.

So you would view the connection context manager acting as an actual 
transaction manager as a new feature?  Would you be OK with adding that feature 
to the existing context manager in 3.4 (since currently the context manager is 
a noop in autocommit mode), or do you think we need to create a new context 
manager for this?  Or do we do as the issue that sparked this (issue 8145) 
suggested, and just document how to create your own?

--

___
Python tracker 

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



[issue10527] multiprocessing.Pipe problem: "handle out of range in select()"

2013-01-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 831f49cc00fc by Giampaolo Rodola' in branch 'default':
fix for previous commit related to issue 10527 which didn't have the intended 
effect as per http://bugs.python.org/issue10527#msg179895
http://hg.python.org/cpython/rev/831f49cc00fc

--

___
Python tracker 

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



[issue10527] multiprocessing.Pipe problem: "handle out of range in select()"

2013-01-13 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

3.3 and 3.4 branches should now be fixed.
2.7 and 3.2 still need to be fixed and the code from connections.py removed.
Sorry for the mess up.

--
assignee: giampaolo.rodola -> 

___
Python tracker 

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



[issue16954] Add docstrings for ElementTree module

2013-01-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue11159] Sax parser crashes if given unicode file name

2013-01-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue16959] rlcompleter doesn't work if __main__ can't be imported

2013-01-13 Thread Aaron Meurer

New submission from Aaron Meurer:

The rlcompleter module does not work if __main__ cannot be imported, even 
though it can be used without it.  For example, on the App Engine, __main__ is 
not usable.  

If one creates the example app described at 
https://developers.google.com/appengine/docs/python/gettingstartedpython27/helloworld,
 and adds "import rlcompleter" to the top of helloworld.py, you get the 
following error in the AppEngine

Traceback (most recent call last):
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py",
 line 196, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py",
 line 255, in _LoadHandler
handler = __import__(path[0])
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 692, in Decorate
return func(self, *args, **kwargs)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 1766, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 692, in Decorate
return func(self, *args, **kwargs)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 1630, in FindAndLoadModule
description)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 692, in Decorate
return func(self, *args, **kwargs)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 1577, in LoadModuleRestricted
description)
  File "/Users/aaronmeurer/Desktop/helloworld/helloworld.py", line 2, in 

import rlcompleter
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 692, in Decorate
return func(self, *args, **kwargs)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 1766, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 692, in Decorate
return func(self, *args, **kwargs)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 1630, in FindAndLoadModule
description)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 692, in Decorate
return func(self, *args, **kwargs)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 1577, in LoadModuleRestricted
description)
  File "/sw/lib/python2.7/rlcompleter.py", line 43, in 
import __main__
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 692, in Decorate
return func(self, *args, **kwargs)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 1766, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py",
 line 692, in Decorate
return func(self, *args, **kwarg

[issue16959] rlcompleter doesn't work if __main__ can't be imported

2013-01-13 Thread Aaron Meurer

Aaron Meurer added the comment:

For completion, here's the corresponding App Engine issue I opened: 
http://code.google.com/p/googleappengine/issues/detail?id=8665.

--

___
Python tracker 

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



[issue11159] Sax parser crashes if given unicode file name

2013-01-13 Thread Christian Heimes

Christian Heimes added the comment:

I don't think that the file system encoding is the correct answer here. AFAIR 
expat uses UTF-8 encoded strings. Python 3.x uses PyArg_ParseTupleAndKeywords() 
with "s" which converts PyUnicode to PyBytes with the utf-8 codec.

--
nosy: +christian.heimes

___
Python tracker 

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