[issue18943] argparse: default args in mutually exclusive groups

2013-09-07 Thread Armin Rigo

Armin Rigo added the comment:

Getting consistently one behavior or the other would be much better imho; I 
think it's wrong-ish to have the behavior depend uncontrollably on 
implementation details.  But I agree that it's slightly messy to declare which 
of the two possible fixes is the "right" one.  I'm slightly in favor of the 
more permissive solution ("--bar 42" equivalent to no arguments at all if 42 is 
the default) only because the other solution might break someone's existing 
code.  If I had no such backward-compatibility issue in mind, I'd vote for the 
other solution (you can't specify "--bar" with any value, because you already 
specified "--foo").

--

___
Python tracker 

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



[issue18900] Add the random.distrib module

2013-09-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> committed/rejected
status: pending -> closed

___
Python tracker 

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



[issue18957] PYTHONFAULTHANDLER enables faulthandler when the variable is empty

2013-09-07 Thread STINNER Victor

New submission from STINNER Victor:

Most Python environment variables (PYTHON*) only enable something when their 
value is non-empty. The PYTHONFAULTHANDLER enables the faulthandler even if the 
value is empty. As the author of the module, I think that it is a bug and 
should be fixed (even in Python 3.3).

--
messages: 197142
nosy: haypo
priority: normal
severity: normal
status: open
title: PYTHONFAULTHANDLER enables faulthandler when the variable is empty
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue18954] Grammatically incorrect sentences in Python/fileutils.c

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 98f82b124c7d by Victor Stinner in branch 'default':
Close #18954: Fix some typo in fileutils.c comments
http://hg.python.org/cpython/rev/98f82b124c7d

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

___
Python tracker 

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



[issue18954] Grammatically incorrect sentences in Python/fileutils.c

2013-09-07 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for the report! Don't hesitate to report other grammar issues ;-)

--

___
Python tracker 

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



[issue18957] PYTHONFAULTHANDLER enables faulthandler when the variable is empty

2013-09-07 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Do you mean something like *this*?

this -> the patch, pythonfaulthandler_env_var.patch.

--
keywords: +patch
nosy: +vajrasky
Added file: http://bugs.python.org/file31641/pythonfaulthandler_env_var.patch

___
Python tracker 

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



[issue18955] Confusing documentation in Lib/importlib/util.py

2013-09-07 Thread Vajrasky Kok

Vajrasky Kok added the comment:

That would help.

--

___
Python tracker 

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



[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-07 Thread Vajrasky Kok

Vajrasky Kok added the comment:

I noticed in CPython source code, when we print the type of the object, we use 
"%.200s" not "%s". For example, in Modules/posixmodule.c:

"uid should be integer, not %.200s",

So the newest path was created to conform with this tradition.

Another thing I noticed, there are two ways to get the type of object:

1. src->ob_type->tp_name
2. Py_TYPE(src)->tp_name

Both are widely used. So I am not sure which is the best way. I leave it alone 
this issue.

--
Added file: 
http://bugs.python.org/file31642/fix_error_message_reader_csv_alternative_1_v7.patch

___
Python tracker 

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



[issue18894] In unittest.TestResult.failures remove deprecated fail* methods

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c391c30fee99 by Ezio Melotti in branch '2.7':
#18894: remove mention of deprecated fail* methods.
http://hg.python.org/cpython/rev/c391c30fee99

New changeset c3a2c0504960 by Ezio Melotti in branch '3.3':
#18894: remove mention of deprecated fail* methods.
http://hg.python.org/cpython/rev/c3a2c0504960

New changeset 5fbb01033a08 by Ezio Melotti in branch 'default':
#18894: merge with 3.3.
http://hg.python.org/cpython/rev/5fbb01033a08

--
nosy: +python-dev

___
Python tracker 

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



[issue18894] In unittest.TestResult.failures remove deprecated fail* methods

2013-09-07 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patch!

--
assignee: docs@python -> ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 2.7

___
Python tracker 

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



[issue18895] In unittest.TestResult.addError split the sentence

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 523cfc78847c by Ezio Melotti in branch '2.7':
#18895: split a sentence in unittest docs.
http://hg.python.org/cpython/rev/523cfc78847c

New changeset dd669daad7de by Ezio Melotti in branch '3.3':
#18895: split a sentence in unittest docs.
http://hg.python.org/cpython/rev/dd669daad7de

New changeset 1043cc2cb0ff by Ezio Melotti in branch 'default':
#18895: merge with 3.3.
http://hg.python.org/cpython/rev/1043cc2cb0ff

--
nosy: +python-dev

___
Python tracker 

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



[issue18895] In unittest.TestResult.addError split the sentence

2013-09-07 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patch!

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 2.7

___
Python tracker 

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



[issue18904] Unnecessary test in file descriptor inheritance test

2013-09-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee:  -> haypo
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue18918] help('FILES') finds no documentation

2013-09-07 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
nosy: +ezio.melotti
stage:  -> needs patch

___
Python tracker 

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



[issue18958] Exception('No JSON object could be decoded') when parsing a valid JSON

2013-09-07 Thread Adrián Chaves Fernández

New submission from Adrián Chaves Fernández:

Calling json.load() with a file object or json.loads() with a string containing 
the attached JSON code raises an exception with the message 'No JSON object 
could be decoded'.

I’ve pasted the JSON code into http://jsonlint.com/ and it reports it as valid 
JSON.

This JSON code comes from the 0 A.D. game 
(https://github.com/0ad/0ad/blob/master/binaries/data/mods/public/civs/maur.json),
 and the game successfully parses it as well (with whatever they use for that). 
Yet it fails with json.load() and json.loads().

Note also that the rest of the JSON files of the same game folder 
(https://github.com/0ad/0ad/tree/master/binaries/data/mods/public/civs) do work 
with json.load() and json.loads().

--
components: Extension Modules
files: input.json
messages: 197152
nosy: Gallaecio
priority: normal
severity: normal
status: open
title: Exception('No JSON object could be decoded') when parsing a valid JSON
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file31643/input.json

___
Python tracker 

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



[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-07 Thread Ezio Melotti

Ezio Melotti added the comment:

Do you want to submit a patch to add tests for these cases?

--
nosy: +ezio.melotti
stage:  -> test needed

___
Python tracker 

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



[issue18959] Create a "Superseded modules" section in standard library ToC

2013-09-07 Thread Nick Coghlan

New submission from Nick Coghlan:

As discussed at the language summit earlier this year [1], it isn't alway easy 
to tell when glancing through the standard library docs which modules are 
merely hanging around because removing them would break backwards compatibility.

However, after reviewing the current ToC, we currently appear to only have two 
genuinely superseded modules: optparse (superseded by argparse) and imp 
(superseded by importlib).

Other cases where different modules touch on the same area are high level/low 
level splits (e.g. select vs selectors), or ones where the alternate modules 
are offering compatibility with different styles of API (e.g. etree vs DOM for 
XML, getopt vs argparse).

In future, asyncore/asynchat will hopefully be superseded by the PEP 3156 code 
(as "concurrent.events" or similar) and would also be moved under the new 
heading.

Marking as "easy" since the mechanics of the patch should be pretty simple: 
create a new heading and move the references to optparse and imp from their 
current locations.

[1] 
http://python-notes.boredomandlaziness.org/en/latest/conferences/pyconus2013/20130313-language-summit.html#legacy-modules

(I thought I had already created a bug for this, but can't find it, so I've 
created this new one. If I did already create an issue, we can close it as a 
duplicate and keep this one.)

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 197154
nosy: docs@python, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Create a "Superseded modules" section in standard library ToC
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue18958] Exception('No JSON object could be decoded') when parsing a valid JSON

2013-09-07 Thread Vajrasky Kok

Vajrasky Kok added the comment:

>>> a = open('/tmp/input.json')
>>> b = a.read()
>>> b[0]
'\ufeff'
>>> import json
>>> json.loads(b[1:])
loads just fine
>>> json.loads(b)
chokes.


Whether python json module should handle '\ufeff' gracefully or not, I am not 
sure. Let me investigate it.

--
nosy: +vajrasky

___
Python tracker 

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



[issue18960] First line can be executed twice

2013-09-07 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

When run in Python 3 followed script:

print('first')
#coding=iso8859-1
print('second')

it prints the 'first' string twice.

Besides this weird behavior I think PEP-0263 should specify that if a magic 
comment is second line in the file then first line should be a comment too.

--
components: Interpreter Core
files: double_first_line.py
messages: 197156
nosy: loewis, serhiy.storchaka
priority: normal
severity: normal
status: open
title: First line can be executed twice
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31644/double_first_line.py

___
Python tracker 

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



[issue18960] First line can be executed twice

2013-09-07 Thread Ezio Melotti

Ezio Melotti added the comment:

> I think PEP-0263 should specify that if a magic comment is
> second line in the file then first line should be a comment too.

+1

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue18958] Exception('No JSON object could be decoded') when parsing a valid JSON

2013-09-07 Thread Vajrasky Kok

Vajrasky Kok added the comment:

The U+FEFF character is related with Byte order mark.

Reference:
http://en.wikipedia.org/wiki/Byte_Order_Mark

--

___
Python tracker 

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



[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-07 Thread Vlad Shcherbina

Vlad Shcherbina added the comment:

Probably yes, I'm just not sure when I'll get the time.

--

___
Python tracker 

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



[issue18960] First line can be executed twice

2013-09-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue18958] Exception('No JSON object could be decoded') when parsing a valid JSON

2013-09-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Use the utf-8-sig encoding.

See also issue17909.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue18945] Name collision handling in tempfile is not covered by tests

2013-09-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +georg.brandl, ncoghlan

___
Python tracker 

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



[issue18943] argparse: default args in mutually exclusive groups

2013-09-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> The patch isn't a good unittest case because it produces an Error, not 
> a Failure.

Please let's not be pedantic about what a "good unittest" is.

--
nosy: +pitrou

___
Python tracker 

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



[issue18929] inspect.classify_class_attrs ignores metaclass

2013-09-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Of course it is causing tests to fail. You are changing behaviour of an 
existing API. Please find another solution.

--
nosy: +pitrou

___
Python tracker 

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



[issue18959] Create a "Superseded modules" section in standard library ToC

2013-09-07 Thread Hynek Schlawack

Changes by Hynek Schlawack :


--
nosy: +hynek

___
Python tracker 

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



[issue18958] Exception('No JSON object could be decoded') when parsing a valid JSON

2013-09-07 Thread Adrián Chaves Fernández

Adrián Chaves Fernández added the comment:

I’ll veave how to address this up to you. Thanks a lot for finding out that the 
cause was the BOM, I’ve just removed it from the file and now everything works 
as expected.

--

___
Python tracker 

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



[issue18958] Exception('No JSON object could be decoded') when parsing a valid JSON

2013-09-07 Thread Nick Coghlan

Nick Coghlan added the comment:

Switching to a docs bug - this won't be fixed in 2.7, but it should probably be 
documented as a limitation.

--
assignee:  -> docs@python
components: +Documentation -Extension Modules
nosy: +docs@python, ncoghlan
stage:  -> needs patch

___
Python tracker 

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



[issue18873] "Encoding" detected in non-comment lines

2013-09-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The tokenize module, 2to3, IDLE, and the Tools/scripts/findnocoding.py script 
affected by this bug. Proposed patch fixes this in all places and adds tests 
for tokenize and 2to3.

--
components: +Demos and Tools, IDLE, Library (Lib)
nosy: +georg.brandl, kbk, loewis, meador.inge, roger.serwy, terry.reedy
stage: needs patch -> patch review
Added file: 
http://bugs.python.org/file31645/detect_encoding_in_comments_only.patch

___
Python tracker 

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



[issue18873] "Encoding" detected in non-comment lines

2013-09-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And here is a patch which fixes the regular expression in PEP 263.

--
Added file: http://bugs.python.org/file31646/pep0263_regex.diff

___
Python tracker 

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



[issue18873] "Encoding" detected in non-comment lines

2013-09-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue18821] Add .lastitem attribute to takewhile instances

2013-09-07 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Hello. Here's a basic patch with tests which accomplishes your request. 
Currently, it defaults to None if no item failed, but probably it can be set 
only when something fails the predicate (and the user will check using 
hasattr(t, 'last') ).

--
keywords: +patch
nosy: +Claudiu.Popa
Added file: http://bugs.python.org/file31647/itertools_takewhile.patch

___
Python tracker 

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



[issue5907] repr of time.struct_time type does not eval

2013-09-07 Thread R. David Murray

R. David Murray added the comment:

It is very surprising that evaling the repr doesn't work, since struct_time is 
documented to have a named tuple interface, and evaling the repr for a 
namedtuple works.  So hopefully fixing issue 1820 will also fix this.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue18961] Non-UTF8 encoding line

2013-09-07 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a file which is accepted by Python interpreter but is rejected by the 
tokenize module.

$ ./python nonutf8_coding_line.py 
$ ./python -m tokenize nonutf8_coding_line.py 
nonutf8_coding_line.py: error: invalid or missing encoding declaration for 
'nonutf8_coding_line.py'

Python itself checks that a line is UTF-8 encoded only if not found a magic 
comment. The tokenize module checks it before searching (issue14629).

--
components: Interpreter Core, Library (Lib)
files: nonutf8_coding_line.py
messages: 197169
nosy: Arfrever, benjamin.peterson, brett.cannon, eric.snow, loewis, 
serhiy.storchaka
priority: normal
severity: normal
status: open
title: Non-UTF8 encoding line
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31648/nonutf8_coding_line.py

___
Python tracker 

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



[issue18961] Non-UTF8 encoding line

2013-09-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +meador.inge

___
Python tracker 

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



[issue18952] Fix test.support.open_urlresource (support package regression)

2013-09-07 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue18952] Fix test.support.open_urlresource (support package regression)

2013-09-07 Thread Nick Coghlan

Nick Coghlan added the comment:

I was going to go with the "move the directory" solution, but realised that 
would mean existing checkouts end up downloading the data files again, and also 
with a stale copy of the data cluttering them up.

So adjusting the support module for the different relative path seems like the 
better option - I'll apply that one tomorrow (well, technically, later today...)

--

___
Python tracker 

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



[issue18821] Add .lastitem attribute to takewhile instances

2013-09-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oscar, did you considered itertools.groupby()? Perhaps it better meets your 
needs.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

When specify an empty string error message is confusing too:

$ ./python -c 'import csv; reader = csv.reader("foo", delimiter="")'
Traceback (most recent call last):
  File "", line 1, in 
TypeError: delimiter must be set

--
assignee: serhiy.storchaka -> 

___
Python tracker 

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



[issue18903] IDLE file-completion is case-sensitive in Windows

2013-09-07 Thread Westley Martínez

Westley Martínez added the comment:

I believe HFS is case-preserving as well, but it also can be configured to be 
case-sensitive.  I'm not a Mac owner though so don't take my word for it.

--

___
Python tracker 

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



[issue18905] pydoc -p 0 says the server is available at localhost:0

2013-09-07 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue18962] Add special case for single iterator in heapq.merge function

2013-09-07 Thread Wouter Bolsterlee

New submission from Wouter Bolsterlee:

The heapq.merge() function merges multiple sorted iterables into a single 
sorted output.  The function uses a heap queue that is repeatedly looped over 
until it has generated all output.

If only a single iterable is passed to heapq.merge(), the heap will have len(h) 
== 1, which means the looping and heap manipulation just degrades to a 
convoluted "yield from iterables[0]". This negatively impacts performance. The 
attached patch adds a short-circuit for this single input case.

The behaviour of the function remains unchanged:

>>> list(merge_before([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
[0, 1, 2, 3, 4, 5, 5, 7, 8, 10, 15, 20, 25]
>>> list(merge_after([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
[0, 1, 2, 3, 4, 5, 5, 7, 8, 10, 15, 20, 25]

For multiple inputs, there is no measurable performance difference (measured
using IPython's %timeit). Without patch:

>>> %timeit list(merge_before([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
10 loops, best of 3: 13.7 µs per loop
>>> %timeit list(merge_before([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
10 loops, best of 3: 13.4 µs per loop
>>> %timeit list(merge_before([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
10 loops, best of 3: 13.5 µs per loop

With patch:

>>> %timeit list(merge_after([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
10 loops, best of 3: 13.7 µs per loop
>>> %timeit list(merge_after([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
10 loops, best of 3: 13.6 µs per loop
>>> %timeit list(merge_after([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
10 loops, best of 3: 13.6 µs per loop
>>> %timeit list(merge_after([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
10 loops, best of 3: 13.8 µs per loop

The real performance gain is of course when only a single iterable is passed. 
Without patch:

>>> %timeit for x in merge_before(range(1)): pass
100 loops, best of 3: 2.65 ms per loop
>>> %timeit for x in merge_before(range(1)): pass
100 loops, best of 3: 2.52 ms per loop
>>> %timeit for x in merge_before(range(1)): pass
100 loops, best of 3: 2.51 ms per loop

With patch:

>>> %timeit for x in merge_after(range(1)): pass
1000 loops, best of 3: 604 µs per loop
>>> %timeit for x in merge_after(range(1)): pass
1000 loops, best of 3: 609 µs per loop
>>> %timeit for x in merge_after(range(1)): pass
1000 loops, best of 3: 603 µs per loop

This is a ~4x speedup for an input consisting of 1 items. Compared to plain 
iteration:

>>> %timeit for x in range(1): pass
1000 loops, best of 3: 263 µs per loop
>>> %timeit for x in range(1): pass
1000 loops, best of 3: 268 µs per loop
>>> %timeit for x in range(1): pass
1000 loops, best of 3: 273 µs per loop

Without the patch, heapq.merge() is ~10x as slow as plain iteration. With the 
patch, this is reduced to ~2.5x.

(Note: all testing done using Python 3.3.2 on a 64bit Linux machine.)

--
components: Library (Lib)
files: heapq-merge-single-input-optimization.patch
keywords: patch
messages: 197174
nosy: wbolster
priority: normal
severity: normal
status: open
title: Add special case for single iterator in heapq.merge function
type: performance
versions: Python 3.3
Added file: 
http://bugs.python.org/file31649/heapq-merge-single-input-optimization.patch

___
Python tracker 

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



[issue18553] os.isatty() is not Unix only

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d5c5ac33b9a1 by Senthil Kumaran in branch '2.7':
os.isatty is not Unix only. Correct the wrong documentation.
http://hg.python.org/cpython/rev/d5c5ac33b9a1

--
nosy: +python-dev

___
Python tracker 

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



[issue18553] os.isatty() is not Unix only

2013-09-07 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I have corrected the documentation. Thanks for raising this issue, anatoly 
techtonik.

--
nosy: +orsenthil
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Tim Peters

Tim Peters added the comment:

New patch threadstate_join_5.patch adds more testing of is_alive().

An inelegance I don't care about (but someone might):  if join() is called with 
a timeout, and the Python part of the thread ends before the timeout expires 
(_stopped gets set), then a _non_-blocking attempt to acquire _tstate_lock is 
made, and join() returns regardless of the outcome.  So, with a timeout, it's 
possible for join() to return before the C part of the thread is done even if 
the timeout isn't yet exhausted.

That's unlikely, and I don't see that it makes any difference.  Anyone doing a 
join() with a timeout has to be aware that they have no idea whether the thread 
is done when join() returns, and do another join() or check is_alive() later.

I'd rather not complicate the code to wait longer for _tstate_lock in this case.

--
Added file: http://bugs.python.org/file31650/threadstate_join_5.patch

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Anyone doing a join() with a timeout has to be aware that they have no 
> idea whether the thread is done when join() returns, and do another
> join() or check is_alive() later.

Agreed.

--

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I like threadstate_join_5.patch, but I got the following failure when running 
the test suite:

==
FAIL: test_is_alive_after_fork (test.test_threading.ThreadTests)
--
Traceback (most recent call last):
  File "/home/antoine/cpython/default/Lib/test/test_threading.py", line 478, in 
test_is_alive_after_fork
self.assertEqual(0, status)
AssertionError: 0 != 256

--

___
Python tracker 

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



[issue18800] Document Fraction's numerator and denominator properties

2013-09-07 Thread Senthil Kumaran

Senthil Kumaran added the comment:

How does this simple patch sound?

--
keywords: +patch
nosy: +orsenthil
Added file: http://bugs.python.org/file31651/18800.patch

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Tim Peters

Tim Peters added the comment:

Ah!  I'm running on Windows, where all fork() tests are skipped.  Can you fix 
it?  My prejudice is that anyone mixing threads with fork() should be shot for 
the good of humanity <0.7 wink>.

--

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Yes, the fix is to reinitialize the lock (in the surviving thread) or yank it 
(in the other threads). Patch attached.

--
Added file: http://bugs.python.org/file31652/threadstate_join_6.patch

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Tim Peters

Tim Peters added the comment:

Cool!  What could possibly go wrong?  ;-)

--

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, do you think the patch is finally ready? If so, I'm gonna commit (unless 
you'd rather do it yourself).

--

___
Python tracker 

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



[issue1065986] Fix pydoc crashing on unicode strings

2013-09-07 Thread Akira Kitada

Changes by Akira Kitada :


--
nosy: +akitada

___
Python tracker 

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



[issue18206] license url in site.py should always use X.Y.Z form of version number

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a723adeb1f47 by Senthil Kumaran in branch '3.3':
Fix License URL display and add test to check for license url presence.
http://hg.python.org/cpython/rev/a723adeb1f47

New changeset 12aaf64feca2 by Senthil Kumaran in branch 'default':
merge from 3.3
http://hg.python.org/cpython/rev/12aaf64feca2

--
nosy: +python-dev

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Tim Peters

Tim Peters added the comment:

If would be nice if Tamas could test it in his application, since we're not 
actually testing Py_EndInterpreter.  But, ya, commit it!  If it doesn't work 
for Tamas, we can start over again ;-)

--

___
Python tracker 

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



[issue18206] license url in site.py should always use X.Y.Z form of version number

2013-09-07 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Fixed in the 3.3 and 3.4.

3.3 - changeset a723adeb1f47
3.4 - changeset 12aaf64feca2
3.4 - (Fixed a merge conflict) changeset 6ecdf2b3192b

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

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ah, we *can* add a test for the race condition. Patch attached :-)

--
Added file: http://bugs.python.org/file31653/subinterp_test.patch

___
Python tracker 

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



[issue18963] test_selectors test_above_fd_setsize cases fail on OS X due to infinite hard limit

2013-09-07 Thread Ned Deily

New submission from Ned Deily:

==
ERROR: test_above_fd_setsize (test.test_selectors.PollSelectorTestCase)
--
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/support/__init__.py",
 line 485, in wrapper
return func(*args, **kw)
  File 
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_selectors.py",
 line 312, in test_above_fd_setsize
resource.setrlimit(resource.RLIMIT_NOFILE, (hard, hard))
ValueError: current limit exceeds maximum limit

==
ERROR: test_above_fd_setsize (test.test_selectors.KqueueSelectorTestCase)
--
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/support/__init__.py",
 line 485, in wrapper
return func(*args, **kw)
  File 
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_selectors.py",
 line 312, in test_above_fd_setsize
resource.setrlimit(resource.RLIMIT_NOFILE, (hard, hard))
ValueError: current limit exceeds maximum limit

--
Ran 58 tests in 8.080s

FAILED (errors=2, skipped=12)

Looking at the OS X man page for setrlimit(2), it appears the test's strategy 
of trying to set the soft RLIMIT_NOFILE to the hard RLIMIT_NOFILE ceiling will 
fail on OS X (at least) if the hard limit is infinite:

>>> import resource
>>> resource.getrlimit(resource.RLIMIT_NOFILE)
(2560, 9223372036854775807)

>From the man page:
COMPATIBILITY
 setrlimit() now returns with errno set to EINVAL in places that 
historically
 succeeded.  It no longer accepts "rlim_cur = RLIM_INFINITY" for 
RLIM_NOFILE.
 Use "rlim_cur = min(OPEN_MAX, rlim_max)".

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/setrlimit.2.html

--
components: Tests
messages: 197189
nosy: ned.deily, neologix
priority: normal
severity: normal
stage: needs patch
status: open
title: test_selectors test_above_fd_setsize cases fail on OS X due to infinite 
hard limit
versions: Python 3.4

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Tim Peters

Tim Peters added the comment:

Excellent - ship it! :-)

--

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d52b68edbca6 by Antoine Pitrou in branch 'default':
Issue #18808: Thread.join() now waits for the underlying thread state to be 
destroyed before returning.
http://hg.python.org/cpython/rev/d52b68edbca6

--

___
Python tracker 

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



[issue18964] test_tcl fails when _tkinter linked with Tcl 8.4

2013-09-07 Thread Ned Deily

New submission from Ned Deily:

The 32bit-only OS X installer links with Tcl/Tk 8.4 as these are the only 
supported native (Aqua) versions on older supported systems (OS X 10.5 Leopard 
and earlier).  These failures are also appearing on the Tiger (10.4) buildbots.

$ /usr/local/bin/python3.4 -c 'import tkinter;print(tkinter.TclVersion)'
8.4
$ /usr/local/bin/python3.4 -m test -w -uall test_tcl
[1/1] test_tcl
test test_tcl failed -- multiple errors occurred; run in verbose mode for 
details
1 test failed:
test_tcl
Re-running failed tests in verbose mode
Re-running test 'test_tcl' in verbose mode
testCall (test.test_tcl.TclTest) ... ok
testCallException (test.test_tcl.TclTest) ... ok
testCallException2 (test.test_tcl.TclTest) ... ok
testEval (test.test_tcl.TclTest) ... ok
testEvalException (test.test_tcl.TclTest) ... ok
testEvalException2 (test.test_tcl.TclTest) ... ok
testEvalFile (test.test_tcl.TclTest) ... ok
testEvalFileException (test.test_tcl.TclTest) ... ok
testGetVar (test.test_tcl.TclTest) ... ok
testGetVarArray (test.test_tcl.TclTest) ... ok
testGetVarArrayException (test.test_tcl.TclTest) ... ok
testGetVarException (test.test_tcl.TclTest) ... ok
testLoadWithUNC (test.test_tcl.TclTest) ... skipped 'Requires Windows'
testPackageRequireException (test.test_tcl.TclTest) ... ok
testSetVar (test.test_tcl.TclTest) ... ok
testSetVarArray (test.test_tcl.TclTest) ... ok
testUnsetVar (test.test_tcl.TclTest) ... ok
testUnsetVarArray (test.test_tcl.TclTest) ... ok
testUnsetVarException (test.test_tcl.TclTest) ... ok
test_passing_values (test.test_tcl.TclTest) ... ok
test_split (test.test_tcl.TclTest) ... ERROR
test_splitlist (test.test_tcl.TclTest) ... ERROR
testFlattenLen (test.test_tcl.TkinterTest) ... ok
test_huge_string (test.test_tcl.BigmemTclTest) ... skipped 'needs UINT_MAX < 
SIZE_MAX'

==
ERROR: test_split (test.test_tcl.TclTest)
--
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_tcl.py",
 line 237, in test_split
(call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)),
_tkinter.TclError: invalid command name "dict"

==
ERROR: test_splitlist (test.test_tcl.TclTest)
--
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_tcl.py",
 line 203, in test_splitlist
(call('dict', 'create', 1, '\u20ac', b'\xe2\x82\xac', (3.4,)),
_tkinter.TclError: invalid command name "dict"

--
Ran 24 tests in 7.573s

FAILED (errors=2, skipped=2)
test test_tcl failed

--
components: Tests, Tkinter
keywords: buildbot
messages: 197192
nosy: ned.deily, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: test_tcl fails when _tkinter linked with Tcl 8.4
versions: Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, this should be finally fixed!

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

___
Python tracker 

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



[issue18963] test_selectors test_above_fd_setsize cases fail on OS X due to infinite hard limit

2013-09-07 Thread R. David Murray

R. David Murray added the comment:

See also issue issue 17409.

The code isn't setting it to RLIM_INFINITY explicitly, though, so this must 
mean that OSX is reporting an infinite hard limit when the hard limit is not in 
fact infinite.  Seems like this is an OSX bug that we will have to work around 
somehow.  Maybe in getrlimit, by doing the max(OPEN_MAX, rlim_max) dance 
suggested by the osx man page.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ha, apparently test_is_alive_after_fork still fails on old Linux kernels:

http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/8562
http://buildbot.python.org/all/builders/x86%20RHEL%206%203.x/builds/2665

--
status: closed -> open

___
Python tracker 

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



[issue18873] "Encoding" detected in non-comment lines

2013-09-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Nasty bug. Running a file with 'coding=0', a quite legitimate assignment 
statement, causes Idle to close, with LookupError, leading to SyntaxError, 
reported on the console if there is one ('crash' otherwise). (Idle closing is a 
separate problem, with an issue, from the misinterpretation of 'coding'.)

Loading such a file works with a warning that should not be there.

Adding # leads to "SyntaxError: unknown encoding" in a message box, without 
closing Idle. I presume this is to be expected and is proper. There is also a 
warning on loading.

The code patch adds '^[ \t\f]' to the re. \f = FormFeed? Should that really be 
there? The PEP patch instead adds '^[ \t\v]', \v= VerticalTab? Same question, 
and why the difference?

Your other changes to IOBinding.coding_spec look correct and fix a couple of 
bugs in the function (searching all lines for the coding cookie, mangling a 
line without a line end).

Someone else should review the other code changes.

--

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Tim Peters

Tim Peters added the comment:

Figures.  That's why I wanted your name on the blamelist ;-)

--

___
Python tracker 

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



[issue18957] PYTHONFAULTHANDLER enables faulthandler when the variable is empty

2013-09-07 Thread STINNER Victor

STINNER Victor added the comment:

Yes. Maybe also with a test. The doc of all env vars must be checked.

--

___
Python tracker 

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



[issue18037] 2to3 passes through string literal which causes SyntaxError in 3.x

2013-09-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch against 2.7.

What is the policy about changing 2to3 in 3.x?

--
keywords: +patch
stage:  -> patch review
versions: +Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31654/2to3_escape_u-2.7.patch

___
Python tracker 

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



[issue18037] 2to3 passes through string literal which causes SyntaxError in 3.x

2013-09-07 Thread Benjamin Peterson

Benjamin Peterson added the comment:

You can change 2to3 in 3.x.

--

___
Python tracker 

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



[issue18873] "Encoding" detected in non-comment lines

2013-09-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> The code patch adds '^[ \t\f]' to the re. \f = FormFeed? Should that really 
> be there? The PEP patch instead adds '^[ \t\v]', \v= VerticalTab? Same 
> question, and why the difference?

Good catch. I missed in the PEP patch, it should be '\f' ('\014') in all cases.

Yes, it should be. It corresponds to the code in Parser/tokenizer.c.

--
Added file: http://bugs.python.org/file31655/pep0263_regex.diff

___
Python tracker 

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



[issue18873] "Encoding" detected in non-comment lines

2013-09-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file31646/pep0263_regex.diff

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Nick Coghlan

Nick Coghlan added the comment:

You mean I actually need to pay proper attention now? :)

--

___
Python tracker 

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



[issue16662] load_tests not invoked in package/__init__.py

2013-09-07 Thread Michael Foord

Michael Foord added the comment:

I get a couple of test failures with this patch applied:

==
ERROR: test_find_tests (unittest.test.test_discovery.TestDiscovery)
--
Traceback (most recent call last):
  File "/compile/cpython/Lib/unittest/test/test_discovery.py", line 72, in 
test_find_tests
suite = list(loader._find_tests(top_level, 'test*.py'))
  File "/compile/cpython/Lib/unittest/loader.py", line 298, in _find_tests
tests = self.loadTestsFromModule(package, use_load_tests=False)
TypeError: () got an unexpected keyword argument 'use_load_tests'

==
FAIL: test_find_tests_with_package (unittest.test.test_discovery.TestDiscovery)
--
Traceback (most recent call last):
  File "/compile/cpython/Lib/unittest/test/test_discovery.py", line 137, in 
test_find_tests_with_package
['load_tests', 'test_directory2' + ' module tests'])
AssertionError: Lists differ: ['a_directory module tests', '... != 
['load_tests', 'test_directory...

First differing element 0:
a_directory module tests
load_tests

First list contains 1 additional elements.
First extra element 2:
test_directory2 module tests

- ['a_directory module tests', 'load_tests', 'test_directory2 module tests']
?  

+ ['load_tests', 'test_directory2 module tests']

--

--

___
Python tracker 

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



[issue18964] test_tcl fails when _tkinter linked with Tcl 8.4

2013-09-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed. The dict command was added in 8.5. Thanks for reminder of this. Here is 
a patch.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file31656/test_tcl_84.patch

___
Python tracker 

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



[issue18965] 2to3 can produce illegal bytes literals

2013-09-07 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In Python 2 string literals are allowed to contain non-ascii characters. In 
Python 3 bytes literals can contains only ascii characters, non-ascii 
characters should be escaped with \xXX. However 2to3 doesn't change b'...' 
literals and produces illegal code.

I propose new fixer which escapes non-ascii bytes in bytes literals. Here is a 
patch (without tests yet).

--
components: 2to3 (2.x to 3.x conversion tool)
files: 2to3_nonascii_bytes.patch
keywords: patch
messages: 197205
nosy: serhiy.storchaka, vinay.sajip
priority: normal
severity: normal
stage: patch review
status: open
title: 2to3 can produce illegal bytes literals
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31657/2to3_nonascii_bytes.patch

___
Python tracker 

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



[issue18964] test_tcl fails when _tkinter linked with Tcl 8.4

2013-09-07 Thread Ned Deily

Ned Deily added the comment:

LGTM. And, with the patch, test_tcl no longer fails.

--

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Nick Coghlan

Nick Coghlan added the comment:

Slavek - one you may want to take a look at this. Antoine and Tim are trying to 
fix a race condition with the destruction of thread state objects, but the 
current fix isn't playing nice on older Linux kernels (including the one in 
RHEL 6).

--
nosy: +bkabrda
stage: committed/rejected -> commit review

___
Python tracker 

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



[issue18033] Example for Profile Module shows incorrect method

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 93018d47793f by Senthil Kumaran in branch '2.7':
Correct Profile class usage example. Addresses issue #18033 .
http://hg.python.org/cpython/rev/93018d47793f

New changeset ab4d3ccb92e6 by Senthil Kumaran in branch '3.3':
Correct Profile class usage example. Addresses issue #18033.
http://hg.python.org/cpython/rev/ab4d3ccb92e6

New changeset 88182b388bae by Senthil Kumaran in branch 'default':
merge from 3.3
http://hg.python.org/cpython/rev/88182b388bae

--
nosy: +python-dev

___
Python tracker 

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



[issue18033] Example for Profile Module shows incorrect method

2013-09-07 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I consolidated the patches and example and have committed them to 2.7, 3.3 and 
3.4. Thanks for your contributions.

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

___
Python tracker 

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



[issue18966] Threads within multiprocessing Process terminate early

2013-09-07 Thread Piet van Oostrum

New submission from Piet van Oostrum:

When a process started as a multiprocessing Process spawns a thread, it doesn't 
wait until the thread terminates. It terminates the thread early when the main 
thread of the process terminates, as if the thread would be daemonic (it isn't).

It may sound a bit weird to start a Thread within multiprocessing, but it isn't 
prohibited. Neither is this behavior documented.

In the attached program the thread doesn't complete. However when the 
mythread.join() statement is uncommented it does run to completion.

--
components: Library (Lib)
files: processthread.py
messages: 197210
nosy: pietvo
priority: normal
severity: normal
status: open
title: Threads within multiprocessing Process terminate early
type: behavior
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file31658/processthread.py

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-07 Thread Nick Coghlan

New submission from Nick Coghlan:

We keep muttering about coming up with a less conflict-prone approach to 
Misc/NEWS updates, without ever settling on a concrete solution.

For the last big discussion on this, see the subthread starting at 
https://mail.python.org/pipermail/python-committers/2013-May/002554.html

--
messages: 197211
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Find a less conflict prone approach to Misc/NEWS
type: enhancement

___
Python tracker 

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



[issue18937] add unittest assertion for logging

2013-09-07 Thread Michael Foord

Michael Foord added the comment:

The patch and approach look good to me (with docs needed).

Note, personally I would not use a leading underscore for the assertion methods 
(in the tests) _assertNoStderr and _assertLogRecords.

--

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5cfd7b2eb994 by Tim Peters in branch 'default':
Issue 18808:  blind attempt to repair some buildbot failures.
http://hg.python.org/cpython/rev/5cfd7b2eb994

--

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Tim Peters

Tim Peters added the comment:

Just pushed 5cfd7b2eb994 in a poke-and-hope blind attempt to repair the 
annoying ;-) buildbot failures.

--

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Tim Peters

Tim Peters added the comment:

Doesn't look like 5cfd7b2eb994 is going to fix it :-(  So I'll revert it.  
Attaching the patch as blind.patch.  After that patch, is_alive() only looks at 
Thread data members, where ._is_stopped "is obviously" True, and ._tstate_lock 
"is obviously" None, both forced by threading.py's _after_fork() function.  No 
theory as to how that can be screwed up.

--
Added file: http://bugs.python.org/file31659/blind.patch

___
Python tracker 

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



[issue18952] Fix test.support.open_urlresource (support package regression)

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 23770d446c73 by Nick Coghlan in branch '3.3':
Close #18952: correctly download test support data
http://hg.python.org/cpython/rev/23770d446c73

New changeset cb8dabc113b8 by Nick Coghlan in branch 'default':
Merge #18952 fix from 3.3
http://hg.python.org/cpython/rev/cb8dabc113b8

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

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Tim Peters

Tim Peters added the comment:

Weird!  The Ubuntu box passed test_is_alive_after_fork on its /second/ run with 
the patch:

http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/8564/steps/test/logs/stdio

The other box passed all tests:

http://buildbot.python.org/all/builders/x86%20RHEL%206%203.x/builds/2667

So I won't revert it after all - but the Ubuntu box's behavior is still major 
mystery :-(

--

___
Python tracker 

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



[issue18968] Find a way to detect regressions in test execution

2013-09-07 Thread Nick Coghlan

New submission from Nick Coghlan:

Issue 18952 (fixed in http://hg.python.org/cpython/rev/23770d446c73) was 
another case where a test suite change resulted in tests not be executed as 
expected, but this wasn't initially noticed since it didn't *fail* the tests, 
it just silently skipped them.

We've had similar issues in the past, due to test name conflicts (so the second 
test shadowed the first), to old regrtest style test discovery missing a class 
name from the test list, and to incorrect skip conditions on platform specific 
tests.

Converting "unexpected skips" to a failure isn't enough, since these errors 
occur at a narrower scope than entire test modules.

I'm not sure on what *would* work, though. Perhaps collecting platform specific 
coverage stats for the test suite itself and looking for regressions?

--
messages: 197218
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Find a way to detect regressions in test execution
type: enhancement

___
Python tracker 

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



[issue18968] Find a way to detect incorrectly skipped tests

2013-09-07 Thread Nick Coghlan

Changes by Nick Coghlan :


--
title: Find a way to detect regressions in test execution -> Find a way to 
detect incorrectly skipped tests

___
Python tracker 

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



[issue14971] (unittest) loadTestsFromName does not work on method with a decorator

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 78a5de507f19 by Michael Foord in branch '2.7':
Closes issue 14971.
http://hg.python.org/cpython/rev/78a5de507f19

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

___
Python tracker 

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



[issue18915] ssl.wrap_socket, pass in certfile and keyfile as PEM strings

2013-09-07 Thread Andrew Svetlov

Andrew Svetlov added the comment:

This issue is duplicate for #16487

--
nosy: +asvetlov
resolution:  -> duplicate
status: open -> closed
superseder:  -> Allow ssl certificates to be specified from memory rather than 
files.

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-07 Thread Tim Peters

Tim Peters added the comment:

Well, the next time the Ubuntu box ran the tests, it was clean all the way. So 
it's fixed!  Despite that it isn't ;-)

--

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-07 Thread R. David Murray

R. David Murray added the comment:

For what it is worth, I haven't had a non-trivial merge conflict on Misc/NEWS 
for quite some time now.  It seems to me that they are much rarer than they 
were with svn.  (By 'trivial' I mean that the conflicts I see is that there's a 
new entry on 3.4 that wasn't in 3.3, and the conflict is just the addition of 
the new entry in the merge, which is trivial to fix.)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2013-09-07 Thread R. David Murray

R. David Murray added the comment:

Then, again, I pretty much only do Library fixes.  Maybe 'Core and builtins' 
fixes get messier because of the proximity of the date and version-specific 
header?  That should be easy enough to fix

--

___
Python tracker 

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



[issue18962] Add special case for single iterator in heapq.merge function

2013-09-07 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
nosy: +rhettinger

___
Python tracker 

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



[issue18962] Add special case for single iterator in heapq.merge function

2013-09-07 Thread Raymond Hettinger

Raymond Hettinger added the comment:

At first glance, this looks reasonable.  I'll give it a more thorough look 
shortly.

--
assignee:  -> rhettinger
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue18943] argparse: default args in mutually exclusive groups

2013-09-07 Thread paul j3

paul j3 added the comment:

Changing the test from

if argument_values is not action.default:

to 

if argument_values is not action.default and \
(action.default is None or argument_values != action.default):

makes the behavior more consistent.  Strings and large ints behave like small 
ints, matching the default and not counting as "present"

Simply using `argument_values != action.default` was not sufficient, since it 
raised errors in existing test cases (such as ones involving Nones).

--

___
Python tracker 

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



[issue18438] Obsolete url in comment inside decimal module

2013-09-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 44ed0cd3dc6d by Senthil Kumaran in branch '2.7':
Fix the dead link of IEEE_854-1987 standard with the Wikipedia entry.
http://hg.python.org/cpython/rev/44ed0cd3dc6d

New changeset 0eef1670f316 by Senthil Kumaran in branch '3.3':
Fix the dead link of IEEE_854-1987 standard with the Wikipedia entry.
http://hg.python.org/cpython/rev/0eef1670f316

New changeset 44fa59286012 by Senthil Kumaran in branch 'default':
merge from 3.3
http://hg.python.org/cpython/rev/44fa59286012

--
nosy: +python-dev

___
Python tracker 

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



  1   2   >