[issue18320] idle, pydoc search python on wrong path at make altinstall with different exec- and prefix e.g. $HOME

2013-06-28 Thread cosmicduck

New submission from cosmicduck:

Using Solaris 10 x86
Compiling actual 3.3.2 or 2.7.5 looks like work.
Installing as non-root with 
make altinstall prefix='${HOME}/scripts/tools/python/python-3.3.2' 
exec-prefix='${HOME}/scripts/tools/python/python-3.3.2' installs looks like 
correctly to the target.
Extends LD_LIBRARYPATH and PATH to 
${HOME}/scripts/tools/python/python-3.3.2/lib and 
${HOME}/scripts/tools/python/python-3.3.2/bin has been done.
Python is started correctly with python3.3.
If I start idle3.3 or pydoc3.3 I get error:

/usr/local/bin/python3.3: bad interpreter: No such file or directory.

So it looks like the she-bang is not correctly set for shell scripts to the 
path prefix and exec-prefix path.

Correcting that by manually setup to 
${HOME}/scripts/tools/python/python-3.3.2/bin fix that problem. But I guess 
it's better to modify the installation process by make to have not future 
problems.

--
components: IDLE
messages: 191977
nosy: cosmicduck
priority: normal
severity: normal
status: open
title: idle, pydoc search python on wrong path at make altinstall with 
different exec- and prefix e.g. $HOME
versions: Python 2.7, Python 3.3

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



[issue9938] Documentation for argparse interactive use

2013-06-28 Thread Ethan Furman

Ethan Furman added the comment:

It doesn't look like xuanji has signed a CLA.

Should we create a new issue, and have someone else create a new patch, and let 
this issue just be about the docs?

--
nosy: +ethan.furman

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



[issue18321] Multivolume support in tarfile module

2013-06-28 Thread Eduardo Robles Elvira

New submission from Eduardo Robles Elvira:

The patch attached provides implementation for multivolume support for tarfile 
module. It contains both the changes in the module and a battery of unit tests. 
It contains support for multivolume for both GNU and PAX formats.

The main idea behind this proposal is that for dealing with new volumes, the 
user will provide a callback function. In this callback function the user 
typically calls to TarFile.open_volume(filename) with the appropiate filename. 
This is quite flexible in the sense that the callback function could even ask 
the user for the filename of the next volume (as tar command does), or do 
anything they need before returning or before calling to open_volume. 

Please feel free to comment on how to improve the implementation or the API. 
Documentation for the new feature will be provided at a later stage of the 
review process if the patch gets a good review.

--
components: Library (Lib)
files: cpython-tarfile-multivolume.patch
keywords: patch
messages: 191979
nosy: edulix
priority: normal
severity: normal
status: open
title: Multivolume support in tarfile module
versions: Python 3.4
Added file: http://bugs.python.org/file30720/cpython-tarfile-multivolume.patch

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



[issue18317] gettext: DoS via crafted Plural-Forms

2013-06-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I would rather ask: why do we eval() MO files?

--

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



[issue18317] gettext: DoS via crafted Plural-Forms

2013-06-28 Thread Christian Heimes

Christian Heimes added the comment:

We don't eval() the whole MO file. It's just the pluralization formula, 
http://www.gnu.org/software/gettext/manual/gettext.html#index-nplurals_0040r_007b_002c-in-a-PO-file-header_007d-1093

The patch uses ast.NodeVisitor to look for dangerous code.

--
keywords: +patch
Added file: http://bugs.python.org/file30721/18317_gettext.patch

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



[issue18042] Provide enum.unique class decorator

2013-06-28 Thread Ethan Furman

Ethan Furman added the comment:

unique() added to enum.py; tests added; docs updated.

If no complaints within a few days I'll push them through.

--
keywords: +patch
Added file: http://bugs.python.org/file30722/unique.stoneleaf.01.patch

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



[issue18042] Provide enum.unique class decorator

2013-06-28 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
stage:  - patch review

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



[issue18321] Multivolume support in tarfile module

2013-06-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +lars.gustaebel
stage:  - patch review
type:  - enhancement

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



[issue18317] gettext: DoS via crafted Plural-Forms

2013-06-28 Thread Jakub Wilk

Jakub Wilk added the comment:

Making token filtering more thorough may be simpler that going through AST.

I think Python should accept all the operators that GNU gettext accepts:
http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/plural.y?id=v0.18.2.1#n132

--

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



[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)

2013-06-28 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +neologix

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



[issue16251] pickle special methods are looked up on the instance rather than the type

2013-06-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 At the very least the pickle docs deserve some mention of the 
 behavior.  That way people won't need to spend as much time trying to
 figure out why things aren't working the way they expect.

I think you are overreacting. The rule you are talking about (special methods 
are only looked up on the class) is really known by experts, not so much by 
common Python programmers. I'd argue that pickle doesn't break normal users' 
expectations here.

--

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



[issue18322] test_stat nits

2013-06-28 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Patch with small fixes and improvements to test_stat.

--
assignee: christian.heimes
components: Tests
files: test_stat.patch
keywords: patch
messages: 191985
nosy: christian.heimes, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: test_stat nits
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file30723/test_stat.patch

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



[issue18287] PyType_Ready() should sanity-check the tp_name field

2013-06-28 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +amaury.forgeotdarc, benjamin.peterson
stage:  - patch review
versions: +Python 2.7, Python 3.3, Python 3.4 -Python 3.5

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



[issue18287] PyType_Ready() should sanity-check the tp_name field

2013-06-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

The patch is not complete: PyType_Ready() returns -1 but no no exception is set.

--

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



[issue18224] pyvenv pydoc.py script causing AttributeErrors on Windows

2013-06-28 Thread Vinay Sajip

Vinay Sajip added the comment:

On further reflection: the pydoc script adds no value over and above python -m 
pydoc args, so I think I will remove it.

--
assignee:  - vinay.sajip
versions: +Python 3.4

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



[issue14455] plistlib unable to read json and binary plist files

2013-06-28 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I intend to commit my latest version of the patch during the europython 
sprints, with a minor change: don't include dump(s) and load(s), that change 
(and the other items on open issues in my last post) can be addressed later.

--

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



[issue18323] 'GzipFile' object has no attribute 'extrastart'

2013-06-28 Thread Laurent Gautier

New submission from Laurent Gautier:

When creating a `gzip.GzipFile` using the named parameter `fileobj`
rather than filename, iterating over it is broken:
```
AttributeError: 'GzipFile' object has no attribute 'extrastart'
```

The short example below is demonstrating the problem:

## ---

import gzip, tempfile
_data = (b'@WXOVW:25:85', b'ATACGCGGCT'+b'GATCGTAGCG',
 b'+',
 b'@@))BB'+b'???ECCEECC')

data = gzip.zlib.compress(b'\n'.join(_data))
foo = tempfile.NamedTemporaryFile()
foo.write(data)
foo.flush()
foo.seek(0)

gzf = gzip.GzipFile(fileobj=foo)

# this will trigger the AttributeError
for x in gzf:
print(x)

--
components: Library (Lib)
messages: 191989
nosy: Laurent.Gautier
priority: normal
severity: normal
status: open
title: 'GzipFile' object has no attribute 'extrastart'
type: crash
versions: Python 2.7

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



[issue18287] PyType_Ready() should sanity-check the tp_name field

2013-06-28 Thread Niklas Koep

Niklas Koep added the comment:

Oh, you're right, of course. I completely forgot that any other case which 
jumps to the error label assumes an appropriate exception has already been set. 
I attached a new patch which raises a TypeError. Is there a better way to 
identify the type which is affected by this exception? Since we're complaining 
about the missing tp_name field we obviously can't supply the name in the 
exception.

--
Added file: http://bugs.python.org/file30724/patch.default

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



[issue18287] PyType_Ready() should sanity-check the tp_name field

2013-06-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Since this error can occur only during the development of a C extension, I 
would not worry too much. The traceback will already indicate the imported 
module, this is much better than a segfault later in pydoc.

--

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



[issue18042] Provide enum.unique class decorator

2013-06-28 Thread Eli Bendersky

Eli Bendersky added the comment:

Sent some review comments. I'll be on a short vacation this weekend, so please 
wait at least until next week so I can review the changes. Also, Nick should 
definitely review this too :)

--

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



[issue18323] 'GzipFile' object has no attribute 'extrastart'

2013-06-28 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +nadeem.vawda

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



[issue18321] Multivolume support in tarfile module

2013-06-28 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Eduardo, can you please fill out the contributor form?

--
nosy: +loewis

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



[issue18309] Make python slightly more relocatable

2013-06-28 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Note that the OSX port already does this for framework builds. I don't know why 
we don't use the same code for shared library builds.

Issue #15498 contains a patch that switches this code from a deprecated 
nextstep-era API to dladdr.

Two comments on the patch attached to this issue:

1) The name _PyImport_GetModulePath is confusing, I'd use 
_PyImport_GetSharedLibPath to make clear that this is locating the shared 
library.

2) The code calls dladdr on a static variable that's introduced just for that, 
it is also possible to call dladdr on an already existing symbol (for example 
the address of a function in the public API).

--
nosy: +ronaldoussoren

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



[issue18317] gettext: DoS via crafted Plural-Forms

2013-06-28 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for the link plural.y! I was looking for a C file, not a YACC file.

The AST approach has advantages over tokenizing. The tokenizer returns just 
symbols but the AST has also context information. It makes it much easier to 
distinguish between unary - and binary -. Gettext supports substraction but 
doesn't allow negative numbers.

Python's gettext is not as strict as GNU gettext. For 3.4 I like to forbid oct 
and hex numbers, too.

--
Added file: http://bugs.python.org/file30725/18317_gettext2.patch

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



[issue18322] test_stat nits

2013-06-28 Thread Christian Heimes

Christian Heimes added the comment:

I wish the loader would ignore all test classes with a leading underscore or 
would gain another way to mark a test class as abstract. The mixin approach 
looks ugly and prohibits tab completion in my IDE.

--

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



[issue9938] Documentation for argparse interactive use

2013-06-28 Thread R. David Murray

R. David Murray added the comment:

Yes, I think opening a new issue at this point might be a good idea.  The 
reason is that there are a changes either in place or pending in other issues 
that involve the parse_know_args code, so a new patch is probably required 
regardless.

I wish I had time to review and commit all the argparse patches, but so far I 
haven't gotten to them.  They are on my todo list somewhere, though :)

--

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



[issue18323] 'GzipFile' object has no attribute 'extrastart'

2013-06-28 Thread R. David Murray

R. David Murray added the comment:

Based on a quick glance at the code, the problem isn't that you are passing 
fileobj, it is that fileobj has been opened for writing, not reading, and you 
are attempting to read from it.  extrastart (and other attibutes) are only set 
if mode starts with 'r'.

There is certainly a bug here, but it might just be that a clearer error should 
be generated if you try to read a fileobj open for writing.

--
nosy: +r.david.murray

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



[issue18321] Multivolume support in tarfile module

2013-06-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue18323] 'GzipFile' object has no attribute 'extrastart'

2013-06-28 Thread R. David Murray

R. David Murray added the comment:

On the other hand, it seems reasonable to be able to read if you've done a 
seek(0), so a more complicated fix may also be appropriate.

--

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



[issue14455] plistlib unable to read json and binary plist files

2013-06-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Let me review your patch.

--

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



[issue18322] test_stat nits

2013-06-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 I wish the loader would ignore all test classes with a leading
 underscore or would gain another way to mark a test class as
 abstract. The mixin approach looks ugly and prohibits tab completion
 in my IDE.

I don't really understand what makes mixins ugly. I'm sorry about
your IDE :-)

--

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



[issue10786] unittest.TextTextRunner does not respect redirected stderr

2013-06-28 Thread Sylvain Corlay

Sylvain Corlay added the comment:

Hello, 
It would be great if this modification was also done for Python 2.7. 

A reason is that IPython redirects stderr. When running unit tests in the 
IPython console without specifying the stream argument, the errors are printed 
in the shell. 

See 
http://python.6.x6.nabble.com/How-to-print-stderr-in-qtconsole-td5021001.html

--
nosy: +sylvain.corlay
versions: +Python 2.7 -Python 3.2

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



[issue18111] Add a default argument to min max

2013-06-28 Thread R. David Murray

R. David Murray added the comment:

Julian, could you please submit a contributor agreement?  
(http://www.python.org/psf/contrib)

--

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



[issue18322] test_stat nits

2013-06-28 Thread Christian Heimes

Christian Heimes added the comment:

Ask your Java buddies about mixins. :)

Go ahead and submit the patch.

--

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



[issue17914] add os.cpu_count()

2013-06-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6a0437adafbd by Charles-François Natali in branch 'default':
Issue #17914: Use os.cpu_count() instead of multiprocessing.cpu_count() where
http://hg.python.org/cpython/rev/6a0437adafbd

--

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



[issue18111] Add a default argument to min max

2013-06-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 34ff27b431d0 by R David Murray in branch 'default':
#18111: Add What's New entry for max/min default.
http://hg.python.org/cpython/rev/34ff27b431d0

--

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



[issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes)

2013-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Re-close?

--
nosy: +terry.reedy

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



[issue18280] Documentation is too personalized

2013-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I find some anonymous I references (Guido? 20 years ago?) off-putting when 
reading the doc as formal reference.

--
nosy: +terry.reedy

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



[issue18292] IDLE Improvements: Unit test for AutoExpand.py

2013-06-28 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +terry.reedy

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



[issue17914] add os.cpu_count()

2013-06-28 Thread Charles-François Natali

Changes by Charles-François Natali cf.nat...@gmail.com:


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

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



[issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes)

2013-06-28 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
status: open - closed

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



[issue18301] In itertools.chain.from_iterable() there is no cls argument

2013-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The 2.7 doc says 'Roughly equivalent to' rather than 'Equivalent to'.
The undecorated Python version of from_iterable actually works as an attribute 
of the Python version of chain: chain.from_iterable = from_iterable. I would 
just remove the decorator. The entire itertools doc exploits that fact that 
generator functions are analogous to classes, but it does not work to mix the 
two in the way that the 3.x chain entry does.

--
nosy: +terry.reedy

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



[issue4768] email.generator.Generator object bytes/str crash - b64encode() bug?

2013-06-28 Thread R. David Murray

R. David Murray added the comment:

For the record, encode_quopri was fixed in #14360.

--

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



[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2013-06-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7c807bc15fa8 by R David Murray in branch '3.3':
#14360: Add news item.
http://hg.python.org/cpython/rev/7c807bc15fa8

New changeset 36cc8b0446b3 by R David Murray in branch 'default':
Merge #14360: Add news item.
http://hg.python.org/cpython/rev/36cc8b0446b3

--

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



[issue18324] set_payload does not handle binary payloads correctly

2013-06-28 Thread R. David Murray

New submission from R. David Murray:

In order to maintain model consistency without exposing the need for 
'surrogateescape' to library users, it should be possible to pass binary data 
to set_payload and have it do the correct conversion to the expected storage 
format for the model.  Currently, this does not work.  The attached patch 
provides one example test out of a class of tests that should be written and 
made to pass.

--
components: email
files: set_qp_payload_test.patch
keywords: easy, patch
messages: 192012
nosy: barry, r.david.murray
priority: normal
severity: normal
stage: test needed
status: open
title: set_payload does not handle binary payloads correctly
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30726/set_qp_payload_test.patch

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



[issue18322] test_stat nits

2013-06-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue18322] test_stat nits

2013-06-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +zach.ware

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



[issue18305] [patch] Fast sum() for non-numbers

2013-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Performance enhancements do not normally go in bugfix releases. The issue of 
quadratic performance of sum(sequences, null_seq) is known, which is why the 
doc says that sum() is for numbers and recommends .join for strings and 
itertools.chain for other sequences.

sum([[1,2,3]]*n, []) == [1,2,3]*n == list(chain.from_iterable([[1,2,3]]*n))

For n = 100, the second takes a blink of an eye and the third under a 
second. So there is no issue for properly written code. More generally,

sum(listlist, []) == list(chain.from_iterable(listlist))

The latter should be comparable in speed to your patch and has the advantage of 
not turning the iterator into a concrete list unless and until one actually 
needs a concrete list.

There are two disadvantages to doing the equivalent within sum:

1. People *will* move code that depends on the internal optimization to pythons 
that do not have it. And they *will* complain about their program 'freezing'. 
This already happened when the equivalent of str.join was built into sum. It is 
better to use 'proper' code that will work well enough on all CPython versions 
and other implementations.

2. It discourages people from carefully thinking about whether they actually 
need a concrete list or merely the iterator for a virtual list. The latter work 
for sequences that are too long to fit in memory.

So my inclination is to reject the change.

--
nosy: +terry.reedy
versions: +Python 3.4 -Python 2.7

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



[issue18305] [patch] Fast sum() for non-numbers

2013-06-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree with Terry. CPython deliberately disallow use sum() with lists of 
strings.

--

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



[issue18301] In itertools.chain.from_iterable() there is no cls argument

2013-06-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Perhaps it should be staticmethod, not classmethod.

--
nosy: +serhiy.storchaka

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



[issue17767] Fix test discovery for test_locale.py

2013-06-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue18266] Fix test discovery for test_largefile.py

2013-06-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue18322] test_stat nits

2013-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

While you are at it, should you just replace test_main with unittest.main?

--
nosy: +terry.reedy

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



[issue18322] test_stat nits

2013-06-28 Thread STINNER Victor

STINNER Victor added the comment:

 The mixin approach looks ugly and prohibits tab completion in my IDE.

It is a common practice in Python, especially in tests.

--
nosy: +haypo

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



[issue18325] test_kqueue fails in OpenBSD

2013-06-28 Thread Federico Schwindt

New submission from Federico Schwindt:

test_kqueue fails in OpenBSD/amd64 -current:

Traceback (most recent call last):
  File /usr/obj/pobj/Python-3.3.2/Python-3.3.2/Lib/test/test_kqueue.py, line 
79, in test_create_event
ev = select.kevent(bignum, 1, 2, 3, sys.maxsize, bignum)
OverflowError: signed integer is greater than maximum

In OpenBSD, ident is an unsigned integer data is a signed integer.
See http://bugs.python.org/issue12181 for details.

--
components: Tests
messages: 192018
nosy: Federico.Schwindt, neologix
priority: normal
severity: normal
status: open
title: test_kqueue fails in OpenBSD
versions: Python 2.7, Python 3.3

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



[issue18325] test_kqueue fails in OpenBSD

2013-06-28 Thread Federico Schwindt

Changes by Federico Schwindt federico.schwi...@gmail.com:


--
type:  - behavior

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



[issue18315] bufsize parameter not documented in 2.7.5

2013-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If you think you will ever contribute another patch (and we hope you do), and 
you have not yet submitted a contributor agreement, please do.
http://www.python.org/psf/contrib/contrib-form/ 
http://www.python.org/psf/contrib/
Once processed, a * will appear after your name.
In the meanwhile, I will fix this. (2.6 is security patches only.)

Your patch missed the doc, as opposed to the docstrings, but your report with 
tracker research was unusually complete. Thanks.

--
assignee: docs@python - terry.reedy
nosy: +terry.reedy

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



[issue18315] bufsize parameter not documented in 2.7.5

2013-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

David, with the addition, this line
class FileInput([files[, inplace[, backup[, bufsize[, mode[, 
openhook]])
ends at position 83 instead of 80. It should stay on one line. I could reduce 
that by removing blanks after ,s. Is it better to be a bit too long or a bit 
too compressed?

--

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



[issue18315] bufsize parameter not documented in 2.7.5

2013-06-28 Thread R. David Murray

R. David Murray added the comment:

At 83 it is a judgement call whether to leave it long or wrap it.  I wouldn't 
compress it.  (Wrapping is done by putting a '\' at the end of the line you 
want to wrap, if you don't already know that).

--

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



[issue18315] bufsize parameter not documented in 2.7.5

2013-06-28 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


Added file: http://bugs.python.org/file30727/18315-fileinput-27.diff

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



[issue18315] Fix fileinput doc and docstrings (add 'buffer' in 2.7)

2013-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I just remembered: the first list of a .py file docstring should be a one line 
summary of what the callable does. It should not give the signature because 
(unlike C function currently) help does that for us from the callable itself 
(using the inspect module). Putting it in the docstring just repeats it. On 
3.3.2:

 help(fileinput.input)
Help on function input in module fileinput:

input(files=None, inplace=False, backup='', bufsize=0, mode='r', openhook=None)
input(files=None, inplace=False, backup=, bufsize=0, mode=r, 
openhook=None)
...
So the 3.x files need correcting also.
For .doc, the signature does need to be present and correct.

--
title: bufsize parameter not documented in 2.7.5 - Fix fileinput doc and 
docstrings (add 'buffer' in 2.7)
versions: +Python 3.3, Python 3.4

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



[issue18315] Fix fileinput doc and docstrings (add 'buffer' in 2.7)

2013-06-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 80b1c5b25ff0 by Terry Jan Reedy in branch '2.7':
Issue #18315: Improve fileinput docs by adding 'bufsize' where missing and
http://hg.python.org/cpython/rev/80b1c5b25ff0

New changeset 0760b58526ba by Terry Jan Reedy in branch '3.3':
Issue #18315: Improve fileinput docs by adding 'bufsize' where missing and
http://hg.python.org/cpython/rev/0760b58526ba

--
nosy: +python-dev

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



[issue18315] Fix fileinput doc and docstrings (add 'buffer' in 2.7)

2013-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

There was one missing 'bufsize' in 3.x also.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue18305] [patch] Fast sum() for non-numbers

2013-06-28 Thread Sergey

Sergey added the comment:

 The issue of quadratic performance of sum(sequences, null_seq) is known

I hope it's never too late to fix some bugs... :)

 sum([[1,2,3]]*n, []) == [1,2,3]*n == list(chain.from_iterable([[1,2,3]]*n))

But if you already have a list of lists, and you need to join the lists 
together you have only two of those:
1. sum(list_of_lists, [])
2. list(chain.from_iterable(list_of_lists))
And using sum is much more obvious than using itertools, that most people may 
not (and don't have to) even know about.

When someone, not a python-guru, just thinks about that, she would think so, 
I'll just add lists together, let's write a for-loop... Oh, wait, that's what 
sum() does, it adds things, and python is dynamic-type, sum() should work for 
everything. That's how I was thinking, that's how most people would think, I 
guess...

I was very surprised to find out about that bug.

 1. People *will* move code that depends on the internal optimization to 
 pythons that do not have it.

Looks like this bug is CPython-specific, others (Jython, IronPython...) don't 
have it, so people will move code that depends on the internal optimization to 
other pythons that DO have it. :)

 2. It discourages people from carefully thinking about whether they actually 
 need a concrete list or merely the iterator for a virtual list.

Hm... Currently people can also use iterator for sum() or list for itertools. 
Nothing changed...

 I agree with Terry. CPython deliberately disallow use sum() with lists of 
 strings.

Isn't it exactly because of this bug? I mean, if this bug gets fixed, sum would 
be as fast as join, or maybe even faster, right? So the string restriction can 
be dropped later. But that would be a separate bugreport. Anyway, the bug is 
there not just for strings, it also happens for lists, or for any other 
non-numeric objects that can be added.

PS: I was ready that my patch may not get accepted, and I'm actually thinking 
on another way of doing that (just don't know how to get a copy of arbitrary 
PyObject in C yet). But I thought that the idea itself is great: finally making 
sum() fast without any trade-offs, what could be better? Patch works at least 
for 2.7, 3.3, hg-tip and can be easily ported to any other version. I have not 
expected to get such a cold shoulder. :(

--
versions: +Python 2.7 -Python 3.4

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



[issue17940] extra code in argparse.py

2013-06-28 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: needs patch - patch review
versions: +Python 3.4 -Python 2.7

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



[issue18081] test_logging failure in WarningsTest on buildbots

2013-06-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2176c1867b34 by Terry Jan Reedy in branch 'default':
Issue #18081: Back out temporary changeset, 2a9e1eb3719c, to merge new patch.
http://hg.python.org/cpython/rev/2176c1867b34

--

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



[issue18242] IDLE should not be replacing warnings.formatwarning

2013-06-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c15d0baac3d6 by Terry Jan Reedy in branch '3.3':
Issue *18081, #18242: Change Idle warnings capture in PyShell and run to stop
http://hg.python.org/cpython/rev/c15d0baac3d6

New changeset 89e0d33cb978 by Terry Jan Reedy in branch '2.7':
Issue *18081, #18242: Change Idle warnings capture in PyShell and run to stop
http://hg.python.org/cpython/rev/89e0d33cb978

--
nosy: +python-dev

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



[issue18242] IDLE should not be replacing warnings.formatwarning

2013-06-28 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


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

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



[issue18081] test_logging failure in WarningsTest on buildbots

2013-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This was sent to #18242 but not here. I expected here also.

New changeset c15d0baac3d6 by Terry Jan Reedy in branch '3.3':
Issue *18081, #18242: Change Idle warnings capture in PyShell and run
http://hg.python.org/cpython/rev/c15d0baac3d6

New changeset 89e0d33cb978 by Terry Jan Reedy in branch '2.7':
Issue *18081, #18242: Change Idle warnings capture in PyShell and run 
http://hg.python.org/cpython/rev/89e0d33cb978

Brett's test case works on my machine, all 3 versions.
python_d -m test[.regrtest] test_idle test_logging

--
resolution:  - fixed
status: open - closed

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



[issue16000] test_curses should use unittest

2013-06-28 Thread Zachary Ware

Zachary Ware added the comment:

I had a chance to look at this today and took a stab at writing a patch 
(attached).  Since moving all of the test functions into a TestCase subclass 
necessarily means indenting everything another level, the patch is a huge ugly 
mix of - and + lines that don't really have any relation to each other.  As 
such, I'll also be attaching another patch which is for review purposes only: 
it differs from the real patch by only indenting the def statements by 2 spaces 
instead of the usual 4, allowing the bodies of the methods to not be indented, 
which makes the changes MUCH easier to keep track of.

As Chris mentioned previously, running the test in verbose mode (under 
regrtest) causes rendering problems.  I worked around this by adding a 
print('') to the setUp method; it doesn't make things perfect, but it makes 
it a bit easier to read.  I'm not terribly attached to this hack, though, so 
I'd be fine with removing it if anyone has a preference.

Also as Chris mentioned, there is an open question of how to do setup, whether 
to do things in TestCase.setUp, TestCase,setUpClass, or setUpModule.  This 
patch does initial curses.setupterm() in setUpModule, then initscr and savetty 
in setUp (with resetty and endwin in tearDown).  However, this is not how the 
module has been testing; it has been doing initscr/savetty and resetty/endwin 
only once throughout execution.  I've considered creating a subclass of the 
TestCurses test class which would do initscr/savetty in setUpClass, to do all 
the tests again on the same screen (as has been up to now), but I'd like 
others' opinions on that before I write it.

Also, this patch is against default; I'll make sure it works for 3.3 after a 
round or two of review.

--
Added file: http://bugs.python.org/file30728/issue16000.v1.diff

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



[issue18316] Idle 2.7: update to simplify cross-version patches

2013-06-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset aa1350c7d196 by Terry Jan Reedy in branch '2.7':
Issue #18316: Update idlelib 2.7 except clauses to ease backports.
http://hg.python.org/cpython/rev/aa1350c7d196

--
nosy: +python-dev

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



[issue16000] test_curses should use unittest

2013-06-28 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


Added file: http://bugs.python.org/file30729/issue16000.v1-cmp.diff

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