[issue19509] No SSL match_hostname() in ftp, imap, nntp, pop, smtp modules

2013-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1a945fb875bf by Christian Heimes in branch 'default':
Issue 19509: Don't call match_hostname() twice in http.client.
http://hg.python.org/cpython/rev/1a945fb875bf

--

___
Python tracker 

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



[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2013-12-04 Thread Charles-François Natali

Charles-François Natali added the comment:

I agree with Antoine.
Silencing warning is fine, as long as it's not to the detriment of
clarity (see Debian Openssl's vulnerability extreme example).

--

___
Python tracker 

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



[issue16669] Docstrings for namedtuple

2013-12-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

> I find the help() output way too verbose with its endless listing of all the 
> built-in behaviors.)

Then you might agree to a patch, on a separate issue. Let's set help aside for 
the moment.

I am familiar with running Sphinx on .rst files, but not on docstrings.
It looks like the docstrings use .rst markup. (Is this allowed in the  stdlib?) 
 (The output looks good enough for a first draft of a tkinter class/method 
reference, which I would like to work on.)

> I understand that part of this [signature after class name] is due to the 
> latter class having an __init__ with a reasonable docstring

If dropbox.client is written in Python, as I presume, then I strongly suspect 
that the signature part of
  class dropbox.client.DropboxClient(
oauth2_access_token, locale=None, rest_client=None)
comes from an inspect module method that examines the function attributes other 
than .__doc__. If so, DropboxClient.__init__ docstring is irrelevant to the 
above. You could test by commenting it out and rerunning the doc build.

The inspect methods do not work on C-coded functions (unless Argument Clinic 
has fixed this for 3.4), which is why signatures are put in the docstrings for 
C-coded objects. For C-coded classes, it is put in the class docstring rather 
than the class.__init__ docstring.

> but the fact remains that namedtuple's default docstring produces 
> poorly-looking documentation.

'x.__init__(...) initializes x; see help(type(x)) for signature'

This is standard boilerplate for C-coded .__init__.__doc__.
Raymond just copied it.

>>> int.__init__.__doc__
'x.__init__(...) initializes x; see help(type(x)) for signature'
>>> list.__init__.__doc__
'x.__init__(...) initializes x; see help(type(x)) for signature'

I will try to explain 'property transparency/equivalence' in another post, when 
I am fresher, and after reading the autodoc reference, so you can understand 
enough to agree or not. My reference to a possible alternate implementation of 
named tuple was part of the failed explanation of 'property transparency'. I am 
not proposing a change now.

--

___
Python tracker 

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



[issue19892] register.send_metadata fails with EOFError: EOF when reading a line

2013-12-04 Thread Jean Jordaan

Jean Jordaan added the comment:

A closer look suggests this is an issue in zest.releaser

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue19892] register.send_metadata fails with EOFError: EOF when reading a line

2013-12-04 Thread Jean Jordaan

New submission from Jean Jordaan:

On Ubuntu 12.04, using https://pypi.python.org/pypi/zest.releaser

./bin/release
[...]
INFO: Running: /.../bin/python setup.py register sdist --formats=zip upload
Showing first few lines...
running register
running egg_info
writing requirements to Products.CMFPlomino.egg-info/requires.txt
writing Products.CMFPlomino.egg-info/PKG-INFO
writing namespace_packages to 
Products.CMFPlomino.egg-info/namespace_packages.txt
...
Showing last few lines...
self.send_metadata()
  File 
"/home/jean/zope/plomino/Python-2.7/lib/python2.7/distutils/command/register.py",
 line 149, in send_metadata
choice = raw_input()
EOFError: EOF when reading a line

--
components: Distutils
messages: 205275
nosy: neaj
priority: normal
severity: normal
status: open
title: register.send_metadata fails with EOFError: EOF when reading a line
type: crash
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



[issue19683] test_minidom has many empty tests

2013-12-04 Thread Julian Gindi

Julian Gindi added the comment:

I agree that they should be implemented. I'll fill them in and submit a patch 
in a day or so.

--
nosy: +Julian.Gindi

___
Python tracker 

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



[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2013-12-04 Thread Vajrasky Kok

New submission from Vajrasky Kok:

$ sudo adduser --no-create-home cutecat
Adding user `cutecat' ...
Adding new group `cutecat' (1007) ...
Adding new user `cutecat' (1005) with group `cutecat' ...
Not creating home directory `/home/cutecat'.
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for cutecat
Enter the new value, or press ENTER for the default
Full Name []: 
Room Number []: 
Work Phone []: 
Home Phone []: 
Other []: 
Is the information correct? [Y/n] Y

$ su cutecat
Password: 

$ ./python
Python 3.4.0b1 (default:1f1498fe50e5, Dec  5 2013, 09:48:25) 
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
Error in atexit._run_exitfuncs:
FileNotFoundError: [Errno 2] No such file or directory
$

Python 2.7 and 3.3 do not throw error.

$ ./python
Python 3.3.3+ (3.3:07425df887b5+, Dec  2 2013, 12:27:06) 
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
[60778 refs]
[41580 refs]
$

$ ./python
Python 2.7.6+ (2.7:181ced5bf0be, Dec  4 2013, 11:23:42) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
$

--
components: Extension Modules
messages: 205273
nosy: vajrasky
priority: normal
severity: normal
status: open
title: Exiting Python REPL prompt with user without home directory throws error 
in atexit._run_exitfuncs
type: behavior
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



[issue19776] Provide expanduser() on Path objects

2013-12-04 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Documentation, please (Doc/library/pathlib.rst)!

This is the docstring of Path.cwd.

"""Return a new path pointing to the current working directory
(as returned by os.getcwd()).
"""

This is the docstring of Path.expanduser.
""" Return a new path with expanded ~ and ~user constructs.
"""

Perhaps we need to add "(as returned by os.path.expanduser)"?

--
nosy: +vajrasky

___
Python tracker 

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



[issue16669] Docstrings for namedtuple

2013-12-04 Thread Guido van Rossum

Guido van Rossum added the comment:

On Wed, Dec 4, 2013 at 5:40 PM, Terry J. Reedy  wrote:
> 1. I posted on SO the simple Py 3 solution that replaces the previously 
> posted wrapper solutions needed for Py 2.

Thanks, that will give people some pointers for Python 3. We need
folks to upvote it. :-)

> 2. Much of what you do not like is standard Sphinx/help behavior that would 
> be unchanged by Serhiy's patch. The first line for a class is always "class 
> ()".

Maybe for help(), but the Sphinx docs look better for most classes.
Compare my screen capture with the first class on this page:
https://www.dropbox.com/static/developers/dropbox-python-sdk-1.6-docs/index.html
The screen capture looks roughly like this (note this is two lines and
the word DatastoreInfo is repeated -- that wasn't line folding):

class dropbox.datastore.DatastoreInfo
DatastoreInfo(id, handle, rev, title, mtime)

whereas for non-namedtuple classes it looks like this:

class dropbox.client.DropboxClient(oauth2_access_token, locale=None,
rest_client=None)¶

I understand that part of this is due to the latter class having an
__init__ with a reasonable docstring, but the fact remains that
namedtuple's default docstring produces poorly-looking documentation.

> The first line is followed by the docstring, so the class name is repeated if 
> and only if it is repeated in the docstring (as for list, see below). The 
> __new__/__init__ signature is given here if and only it is in the docstring. 
> Otherwise, one has to look down for the method. The method signatures are 
> never on the first line. Examples:
>
 help(list)
> Help on class list in module builtins:
>
> class list(object)
>  |  list() -> new empty list
>  |  list(iterable) -> new list initialized from iterable's items
> ...
 class C:
> "doc string"
> def __init__(self, a, b): pass
>
 help(C)
> Help on class C in module __main__:
>
> class C(builtins.object)
>  |  doc string
>  |
>  |  Methods defined here:
>  |
>  |  __init__(self, a, b)
> ...

Yeah, help() is different than Sphinx. (As a general remark I find the
help() output way too verbose with its endless listing of all the
built-in behaviors.)

> 3. ?? Python 3 has many improvements and we will add more.
> ---
>
> I am still of the opinion that property usage should be a mostly transparent 
> implementation detail.

What does that mean?

> Point classes could have 4 instance attributes: x, y, r, and theta, with a 
> particular implementation using 0 to 4 properties.  All attributes should be 
> documented regardless of the number of properties, which currently means 
> listing them in the class docstring. A library could have more than one than 
> one implementation.

For various reasons (like consistency with other classes) I *really*
want the property docstrings on the individual properties, not in the
class docstring. Here's a screenshot of what I want:

https://www.dropbox.com/s/70zfapz8pcz9476/Screenshot%202013-12-04%2019.57.36.png

I obtained this by abandoning the namedtuple and hand-coding
properties -- the resulting class uses 4 lines (+ 1 blank) of
boilerplate per property instead of just one line of docstring per
property.

>
> As for named tuples, I believe (without trying) that the name to index 
> mapping could be done with __gettattr__ and a separate dict. If so, there 
> would be no property docstrings and hence no field docstrings to worry about 
> ;-).

I'm not sure what you are proposing here -- a patch to namedtuple or a
work-around? I think namedtuple is too valuable to abandon. It not
only saves a lot of code, it captures the regularity of the code. (If
I have a class with 5 similar-looking methods it's easy to overlook a
subtle difference in one of them.)

> ---
>
> There have been requests for data attribute docstrings (without the bother 
> and inefficiency of replacing a simple attribute with a property). Since such 
> a docstring would have to be attached to the fixed attribute name, rather 
> than the variable attribute value, I believe a string subclass would suffice, 
> to be used as needed. The main problem is a decent syntax to add a docstring 
> to a simple (assignment) statement.

Sphinx actually has a syntax for this already. In fact, it has three:
it allwos a comment before or on the class variable starting with
"#:", or a docstring immediately following. Check out this
documentation for the autodoc extension:
http://sphinx-doc.org/ext/autodoc.html#directive-autoattribute

> If the general problem were solved, I would choose Serhiy's option B for 
> namedtuple.

If you're referring to this:

Point = namedtuple('Point', [('x', 'absciss'), ('y', 'ordinate')],
   doc='Point: 2-dimensional coordinate')

I'd love it!

--

___
Python tracker 

___
___
Python-bugs-list mailing list

[issue19775] Provide samefile() on Path objects

2013-12-04 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Added file: http://bugs.python.org/file32979/pathlib_samefile_v3.patch

___
Python tracker 

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



[issue19775] Provide samefile() on Path objects

2013-12-04 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Removed file: http://bugs.python.org/file32978/pathlib_samefile_v3.patch

___
Python tracker 

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



[issue19775] Provide samefile() on Path objects

2013-12-04 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Added file: http://bugs.python.org/file32978/pathlib_samefile_v3.patch

___
Python tracker 

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



[issue19775] Provide samefile() on Path objects

2013-12-04 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Removed file: http://bugs.python.org/file32977/pathlib_samefile_v3.patch

___
Python tracker 

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



[issue19775] Provide samefile() on Path objects

2013-12-04 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Thanks for the review!

Attached the patch addressing the request by Antoine.

--
Added file: http://bugs.python.org/file32977/pathlib_samefile_v3.patch

___
Python tracker 

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



[issue19888] type.__new__() name argument is ignored

2013-12-04 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
status: open -> closed

___
Python tracker 

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



[issue16669] Docstrings for namedtuple

2013-12-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Serhiy: I am not familiar with C PyStructSequence and how an instance of one 
appears in Python code. I agree that more methods should have docstrings.

Guido:
1. I posted on SO the simple Py 3 solution that replaces the previously posted 
wrapper solutions needed for Py 2.

2. Much of what you do not like is standard Sphinx/help behavior that would be 
unchanged by Serhiy's patch. The first line for a class is always "class 
()". The first line is followed by the docstring, so 
the class name is repeated if and only if it is repeated in the docstring (as 
for list, see below). The __new__/__init__ signature is given here if and only 
it is in the docstring. Otherwise, one has to look down for the method. The 
method signatures are never on the first line. Examples:

>>> help(list)
Help on class list in module builtins:

class list(object)
 |  list() -> new empty list
 |  list(iterable) -> new list initialized from iterable's items
...
>>> class C:
"doc string"
def __init__(self, a, b): pass

>>> help(C)
Help on class C in module __main__:

class C(builtins.object)
 |  doc string
 |
 |  Methods defined here:
 |  
 |  __init__(self, a, b)
...

3. ?? Python 3 has many improvements and we will add more.
---

I am still of the opinion that property usage should be a mostly transparent 
implementation detail. Point classes could have 4 instance attributes: x, y, r, 
and theta, with a particular implementation using 0 to 4 properties.  All 
attributes should be documented regardless of the number of properties, which 
currently means listing them in the class docstring. A library could have more 
than one than one implementation.

As for named tuples, I believe (without trying) that the name to index mapping 
could be done with __gettattr__ and a separate dict. If so, there would be no 
property docstrings and hence no field docstrings to worry about ;-).
---

There have been requests for data attribute docstrings (without the bother and 
inefficiency of replacing a simple attribute with a property). Since such a 
docstring would have to be attached to the fixed attribute name, rather than 
the variable attribute value, I believe a string subclass would suffice, to be 
used as needed. The main problem is a decent syntax to add a docstring to a 
simple (assignment) statement.  

If the general problem were solved, I would choose Serhiy's option B for 
namedtuple.

--

___
Python tracker 

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



[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Is there any point in littering the source code to avoid platform-specific 
warnings? The difference is probably that some fields are defined unsigned on 
OS X while they're signed on other platforms.

(also, your patch has lots of unrelated changes)

--

___
Python tracker 

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



[issue19885] lzma segfault when __init__ with non-existent file after executing the constructor (Python 2.7)

2013-12-04 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Wait, you're right. I have not been able to reproduce this under Python 
downloaded from Python.org.

[sky@localhost cpython2.7]$ ./python
Python 2.7.6+ (2.7:ae9fb85ab4e0, Dec  5 2013, 08:24:11) 
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lzma
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named lzma
[40709 refs]

The python is from Fedora itself. Maybe I did some funky stuff in my Fedora 
installation. Let me check this first and report to you later.

[sky@localhost cpython2.7]$ python
Python 2.7.3 (default, Aug  9 2012, 17:23:57) 
[GCC 4.7.1 20120720 (Red Hat 4.7.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lzma
>>> lzma


--
status: open -> pending

___
Python tracker 

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



[issue19888] type.__new__() name argument is ignored

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(you can open a new issue for the __name__ / __qualname__ discrepancy, though)

--

___
Python tracker 

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



[issue19888] type.__new__() name argument is ignored

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Barry: that's because __name__ is 'foo' while __qualname__ is 'Obj'.

I'm gonna close the bug, since it's invalid.

--
nosy: +pitrou
resolution:  -> invalid

___
Python tracker 

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



[issue19888] type.__new__() name argument is ignored

2013-12-04 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue19889] Revision information missing in Python 2.6.9

2013-12-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

I think this is due to the switch from Subversion to Mercurial, which if I'm 
reading PEP 385 and remembering correctly, happened about the time of Python 
2.6.7.  IIRC, we released that source tarball from Subversion so you're seeing 
svn build number.  When we switched to Mercurial, it was decided not to fix 
sys.version to understand hg version numbers, since we were in source-only 
security-only mode.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue19775] Provide samefile() on Path objects

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks for the patch! Some comments:

1. It should path objects as well as str objects.
2. I don't think you have to call resolve() here.
3. you should probably test what happens when one of the files doesn't exist
4. you need to update the documentation too

--

___
Python tracker 

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



[issue19887] Path.resolve() ENAMETOOLONG on pathologic symlinks

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This is 
https://bitbucket.org/pitrou/pathlib/issue/9/pathresolve-fails-on-complex-symlinks

As noted there:

"""It's a ENAMETOOLONG error when calling readlink(), because there are many 
"." components. This is really an edge case caused by the specific test setup, 
I don't think you'd have that many "." components in real-world use."""

--
priority: normal -> low
title: Path.resolve() fails on deep symlinks -> Path.resolve() ENAMETOOLONG on 
pathologic symlinks

___
Python tracker 

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



[issue19890] Typo in multiprocessing docs

2013-12-04 Thread Antony Lee

New submission from Antony Lee:

The docs for multiprocessing refer to BaseProxy._callMethod() while it should 
be _callmethod.

--
assignee: docs@python
components: Documentation
messages: 205261
nosy: Antony.Lee, docs@python
priority: normal
severity: normal
status: open
title: Typo in multiprocessing docs
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue19888] type.__new__() name argument is ignored

2013-12-04 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
versions: +Python 3.3, Python 3.4 -Python 2.7, Python 3.2

___
Python tracker 

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



[issue19888] type.__new__() name argument is ignored

2013-12-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

At best, this is an undocumented (afaict) change in behavior in 3.3.  Let's 
boil it down:

-snip snip-
class Type(type):
def __new__(mcls, name, bases, namespace):
return super().__new__(mcls, 'foo', bases, namespace)

class Obj(metaclass=Type):
def __init__(self, **kwargs):
pass

print(repr(Obj))
-snip snip-

In <= 3.2, this prints 

In >= 3.3 this prints 

So, clearly this is a change in behavior.  Was it intended?  If so, it's 
undocumented - I can find no mention of it in Misc/NEWS or What's New in 3.3.  
I suspect it is unintended.

--

___
Python tracker 

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



[issue19888] type.__new__() name argument is ignored

2013-12-04 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
resolution: invalid -> 
status: closed -> open

___
Python tracker 

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



[issue19888] type.__new__() name argument is ignored

2013-12-04 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
title: possible memory corruption caused by for-loop iteration over 
namespace.items() in a metaclass defining __new__ -> type.__new__() name 
argument is ignored

___
Python tracker 

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



[issue19889] Revision information missing in Python 2.6.9

2013-12-04 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +barry

___
Python tracker 

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



[issue19866] tests aifc, sunau and wave failures on a fresh Win64 installation

2013-12-04 Thread Francisco Martín Brugué

Francisco Martín Brugué added the comment:

On 12/03/2013 07:21 PM, Zachary Ware wrote:
>
> Zachary Ware added the comment:
>
> Francis, would you like to work on a patch for this?  The change should go in 
> Tools/msi/msi.py, if I'm not mistaken.
>
> --
>
> ___
> Python tracker 
> 
> ___
>
please go ahead

--

___
Python tracker 

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



[issue19839] bz2: regression wrt supporting files with trailing garbage after EOF

2013-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c5349a560703 by Nadeem Vawda in branch '3.3':
#19839: Fix regression in bz2 module's handling of non-bzip2 data at EOF.
http://hg.python.org/cpython/rev/c5349a560703

New changeset bec2033ee2ec by Nadeem Vawda in branch '3.3':
#19839: Fix lzma module's handling of non-lzma data at EOF.
http://hg.python.org/cpython/rev/bec2033ee2ec

New changeset 1f1498fe50e5 by Nadeem Vawda in branch 'default':
Closes #19839: Fix regression in bz2 module's handling of non-bzip2 data at EOF.
http://hg.python.org/cpython/rev/1f1498fe50e5

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



[issue19888] possible memory corruption caused by for-loop iteration over namespace.items() in a metaclass defining __new__

2013-12-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

D'oh! Should have looked closer. ;)

--

___
Python tracker 

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



[issue19888] possible memory corruption caused by for-loop iteration over namespace.items() in a metaclass defining __new__

2013-12-04 Thread Zygmunt Krynicki

Changes by Zygmunt Krynicki :


--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue19889] Revision information missing in Python 2.6.9

2013-12-04 Thread Marc-Andre Lemburg

New submission from Marc-Andre Lemburg:

Not sure whether this can be considered a bug, but Python 2.6.7 for example 
showed the build revision in the sys.version:

>>> sys.version
'2.6.7 (r267:88850, Feb  9 2012, 18:56:05) \n[GCC 4.5.0 20100604 
[gcc-4_5-branch revision 160292]]'

whereas Python 2.6.9 does not:

>>> sys.version
'2.6.9 (unknown, Dec  4 2013, 18:39:21) \n[GCC 4.5.0 20100604 [gcc-4_5-branch 
revision 160292]]'

--
components: Build
messages: 205256
nosy: lemburg
priority: normal
severity: normal
status: open
title: Revision information missing in Python 2.6.9
versions: Python 2.6

___
Python tracker 

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



[issue19888] possible memory corruption caused by for-loop iteration over namespace.items() in a metaclass defining __new__

2013-12-04 Thread Zygmunt Krynicki

Zygmunt Krynicki added the comment:

This is not a bug, name spills out of for ... loop and then gets passed to 
__new__

--

___
Python tracker 

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



[issue19888] possible memory corruption caused by for-loop iteration over namespace.items() in a metaclass defining __new__

2013-12-04 Thread Zygmunt Krynicki

Zygmunt Krynicki added the comment:

Experimenting with a few modifications lead to the following observations:

1) objects with short names (defined inside the Obj class) tend to be ignored 
and don't trigger the bug
2) Longer names tend to trigger the bug, ordering is not deterministic
3) Calling __new__ before iterating over namespace makes the problem go away, 
it seems to be related to the for loop more than to anything else

--

___
Python tracker 

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



[issue19888] possible memory corruption caused by for-loop iteration over namespace.items() in a metaclass defining __new__

2013-12-04 Thread Zygmunt Krynicki

Zygmunt Krynicki added the comment:

2.7 test program

--
Added file: http://bugs.python.org/file32976/issue-19888.py27.py

___
Python tracker 

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



[issue19888] possible memory corruption caused by for-loop iteration over namespace.items() in a metaclass defining __new__

2013-12-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Also seems to be triggered on 2.7 (with appropriate syntax adjustments in 
bug.py)

--
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



[issue19888] possible memory corruption caused by for-loop iteration over namespace.items() in a metaclass defining __new__

2013-12-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Note that just iterating over namespace doesn't trigger the problem, e.g. 
instead of 

for name, value in namespace.items(): pass

using

list(namespace.items())

seems to work.

--

___
Python tracker 

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



[issue19888] possible memory corruption caused by for-loop iteration over namespace.items() in a metaclass defining __new__

2013-12-04 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue19888] possible memory corruption caused by for-loop iteration over namespace.items() in a metaclass defining __new__

2013-12-04 Thread Zygmunt Krynicki

New submission from Zygmunt Krynicki:

It seems that a particular code sequence causes memory corruption (but not a 
crash so far) in the interpreter. I've attached a test case that fails 
assertion on python3.2 (tested on current amd64 12.04 builds) and works on 
python3.3 (tested on current amd64 14.04 builds and i386 fedora 19 builds).

The attached test program shows how the bug is actually triggered by using a 
for loop to iterate over key, value in namespace.items() inside a metaclass 
__new__() method that does nothing else apart from that.

--
components: Interpreter Core
files: bug.py
messages: 205250
nosy: zkrynicki
priority: normal
severity: normal
status: open
title: possible memory corruption caused by for-loop iteration over 
namespace.items() in a metaclass defining __new__
type: security
versions: Python 3.2
Added file: http://bugs.python.org/file32975/bug.py

___
Python tracker 

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



[issue16669] Docstrings for namedtuple

2013-12-04 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't know if it's worth reopening this, but I had a need for generating docs 
including attribute docstrings for a namedtuple class using Sphinx, and I 
noticed a few things...

(1) Regarding there not being demand: There's a StackOverflow question for this 
with 17 "ups" on the question and 22 on the best answer: 
http://stackoverflow.com/questions/1606436/adding-docstrings-to-namedtuples-in-python

(2) The default autodocs produced by sphinx look dreadful (e.g. 
https://www.dropbox.com/s/nakxsslhb588tu1/Screenshot%202013-12-04%2013.29.13.png)
 -- note the duplication of the class name, the line break before the 
signature, and the listing of attributes in alphabetical order with useless 
boilerplate.  Here's what I would *like* to produce: (though there's probably 
too much whitespace :-): 
https://www.dropbox.com/s/j11uismbeo6rrzx/Screenshot%202013-12-04%2013.31.44.png

(3) In Python 2.7 you can't assign to the __doc__ class attribute.

I would really appreciate some way to set the docstring for the class as a 
whole as well as for each property, so they come out correct in Sphinx (and 
help()), preferably without having to manually assign doc strings or write the 
class by hand without using namedtuple at all.  (The latter will become very 
verbose, each property has to look like this:

@property
def handle(self):
"""The datastore handle (a string)."""
return self[1]
)

--
nosy: +gvanrossum

___
Python tracker 

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



[issue19859] functools.lru_cache keeps objects alive forever

2013-12-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'm not in favor of filling the docs with warnings like this.  It tends to make 
everything sound dangerous even when the tools are doing exactly what they are 
supposed to do.

Every container (except for the weakref containers) keeps their references 
alive.  That is how Python works.  The LRU cache is no more special in this 
regard than a dictionary, list, or set.   In addition, the older entries get 
flushed-out and freed as the LRU cache gets newer entries.

[Radomir Dopieralski]
> So please consider this patch abandoned.

Marking this as closed.

--
resolution:  -> 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



[issue19871] json module won't parse a float that starts with a decimal point

2013-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There are too many cases where json and Python syntax differ. Final comma("[1, 
2,]"), non-string keys ({1: 2}), tuples ("(1, 2)"), leading zeros ("0001"), 
hexadecimal integers ("0xaf"), escapes of astral characters('"\U0001d504"'), 
single quotes ("'spam'"), octal escape codes ("\015"), etc, etc...

--

___
Python tracker 

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



[issue19871] json module won't parse a float that starts with a decimal point

2013-12-04 Thread Tim Peters

Tim Peters added the comment:

We should adhere to the json spec, but there's no harm (and some real good!) in 
the docs pointing out notable cases where json and Python syntax differ.

--
nosy: +tim.peters

___
Python tracker 

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



[issue19887] Path.resolve() fails on deep symlinks

2013-12-04 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a script which success with os.path.realpath(), but fails with 
pathlib.Path.resolve(). The `readlink -f` also success with these examples.

--
components: Library (Lib)
files: pathlib_resolve_test.py
messages: 205245
nosy: pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Path.resolve() fails on deep symlinks
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file32974/pathlib_resolve_test.py

___
Python tracker 

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



[issue19871] json module won't parse a float that starts with a decimal point

2013-12-04 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue19882] Closing a socket when makefile() is used

2013-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e10bb7c1b8f8 by Antoine Pitrou in branch '3.3':
Issue #19882: tweak docs for socket.close()
http://hg.python.org/cpython/rev/e10bb7c1b8f8

--
nosy: +python-dev

___
Python tracker 

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



[issue19882] Closing a socket when makefile() is used

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Fixed, thanks!

--
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



[issue19871] json module won't parse a float that starts with a decimal point

2013-12-04 Thread Mark Dickinson

Mark Dickinson added the comment:

> Oddly, with all of the strictness in JSON, the exponent-marker "e"
> can be upper- or lower-case

I'd guess that the aim is that common floating-point output formats from a 
variety of languages are valid JSON.  That would also explain why both '+' and 
'-' are allowed on the exponent, but only '-' on the significand, and why 
leading zeros are permitted on the exponent but not the significand.

--

___
Python tracker 

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



[issue19509] No SSL match_hostname() in ftp, imap, nntp, pop, smtp modules

2013-12-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b6fce698e467 by Christian Heimes in branch 'default':
Issue #19509: Don't close the socket in do_handshake() when hostname 
verification fails.
http://hg.python.org/cpython/rev/b6fce698e467

--

___
Python tracker 

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



[issue19882] Closing a socket when makefile() is used

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Your observations are right, indeed. I'll make the doc changes.

--
nosy: +pitrou
stage:  -> patch review
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



[issue19886] Better estimated memory requirements for bigmem tests

2013-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

These are experimental values. I hacked tests and ran them with less sizes 
(using `ulimit -v` to hard limit memory size). And then I had approximated 
measured values.

On Windows values can be larger (due different memory management).

--

___
Python tracker 

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



[issue19886] Better estimated memory requirements for bigmem tests

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Why did you compute those estimates? When coming up with factors such as 3.3 or 
3.57 (!), it would be nice to add a comment to explain the reasoning.

(otherwise, thanks a lot for doing this)

--

___
Python tracker 

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



[issue19881] Fix bigmem pickle tests

2013-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch about bigmem limits was moved to issue19886.

--

___
Python tracker 

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



[issue19886] Better estimated memory requirements for bigmem tests

2013-12-04 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Some bigmem tests actually consume much more memory than declare. This can 
cause swapping and too long time of test run. Here is a patch which improves 
estimates.

--
components: Tests
files: bigmem_tests.patch
keywords: patch
messages: 205236
nosy: ezio.melotti, michael.foord, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Better estimated memory requirements for bigmem tests
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file32973/bigmem_tests.patch

___
Python tracker 

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



[issue19881] Fix bigmem pickle tests

2013-12-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file32972/pickle_bigmem_limits.patch

___
Python tracker 

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



[issue18840] Tutorial recommends pickle module without any warning of insecurity

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Correction: you can't pickle executable code, you can pickle references to 
well-known objects (by name):

>>> def f(): pass
... 
>>> pickle.dumps(f)
b'\x80\x03c__main__\nf\nq\x00.'
>>> pickle.dumps(f.__code__)
Traceback (most recent call last):
  File "", line 1, in 
_pickle.PicklingError: Can't pickle : attribute lookup code on 
builtins failed

--

___
Python tracker 

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



[issue18840] Tutorial recommends pickle module without any warning of insecurity

2013-12-04 Thread Westley Martínez

Westley Martínez added the comment:

Sounds good to me.

--

___
Python tracker 

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



[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-04 Thread Guido van Rossum

Guido van Rossum added the comment:

The more I think about this the more I believe unregister() should catch the 
OSError (but not the KeyError).

Every unregister() implementation starts by calling super().unregister(key), 
which has a side effect (it removes the key from the _fd_to_key dict).

I believe that once this side effect has happened the unregister() call should 
return with success even if the kqueue syscall fails with OSError.

A further refinement could be to skip the kqueue syscall *if* the registered 
object is in fact an object with a fileno() method and not a bare FD, and the 
object is closed -- we should be able to tell that by calling its fileno() 
method, which should return -1 or None if it is closed.  (But this would be 
mostly an optimization -- and a safety guard in case the FD has been reused for 
a different object.)

I don't know how poll and epoll behave under these circumstances, but given 
that only the Kqueue-based asyncio test failed I think those don't raise when 
the FD has been closed.

If you are not amenable to this fix I will have to catch the OSError in Tulip's 
remove_reader(), e.g. like this:

try:
if not mask:
self._selector.unregister(fd)
else:
self._selector.modify(fd, mask, (None, writer))
except OSError:
# unregister()/modify() may or may not raise this if
# the FD is closed -- it depends on what type of
# selector is used.
pass

(and repeated in remove_writer()).

--

___
Python tracker 

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



[issue19885] lzma segfault when __init__ with non-existent file after executing the constructor (Python 2.7)

2013-12-04 Thread Nadeem Vawda

Nadeem Vawda added the comment:

To clarify, which version(s) does this affect? I have not been able to
reproduce against 3.4, and 2.7 does not included the lzma module in the
first place.

--

___
Python tracker 

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



[issue19509] No SSL match_hostname() in ftp, imap, nntp, pop, smtp modules

2013-12-04 Thread Guido van Rossum

Guido van Rossum added the comment:

See my messages on the review.  Is it absolutely necessary to close the socket 
when the hostname verification fails?

--

___
Python tracker 

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



[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-04 Thread Guido van Rossum

Guido van Rossum added the comment:

I just ran into a live case of the platform differences here.  Check out 
http://bugs.python.org/review/19509/ (issue 19509).  Christian uploaded a patch 
for asyncio, and when I tested it I got a double traceback and a hang.  This 
could have been avoided if the unregister() call for the closed FD had been 
silent instead of raising.

I think that the proper fix might have been not to close the socket, but 
nevertheless this failure confused everyone -- the author of the patch thought 
it had to do with the SSL version, I was initially confused by the first half 
of the traceback (which turned out to be expected, this was in an 
assertRaises() call), and I spent half an hour in pdb to track down the real 
cause.

--

___
Python tracker 

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



[issue19885] lzma segfault when __init__ with non-existent file after executing the constructor (Python 2.7)

2013-12-04 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue19885] lzma segfault when __init__ with non-existent file after executing the constructor (Python 2.7)

2013-12-04 Thread Vajrasky Kok

Changes by Vajrasky Kok :


--
title: lzma.LZMAFile.__init__() segfault when __init__ with non-existent file 
after executing the constructor -> lzma segfault when __init__ with 
non-existent file after executing the constructor (Python 2.7)

___
Python tracker 

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



[issue19885] lzma.LZMAFile.__init__() segfault when __init__ with non-existent file after executing the constructor

2013-12-04 Thread Vajrasky Kok

New submission from Vajrasky Kok:

[sky@localhost cutecat]$ cat /tmp/lzma_segfault.py 
import lzma
file = lzma.LZMAFile("/tmp/file.lzma", "w")
file.write(b"")
file.close()
with lzma.LZMAFile("/tmp/file.lzma", "w") as f:
f.__init__("non-existent")
[sky@localhost cutecat]$ python /tmp/lzma_segfault.py 
Segmentation fault (core dumped)

See also issue19878.

I'll provide the patch tomorrow.

--
components: Extension Modules
messages: 205229
nosy: nadeem.vawda, vajrasky
priority: normal
severity: normal
status: open
title: lzma.LZMAFile.__init__() segfault when __init__ with non-existent file 
after executing the constructor
type: crash
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



[issue19884] Importing readline produces erroneous output

2013-12-04 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Reproducible under Fedora 18.

$ ./python -c "import readline" | hexdump -C
  1b 5b 3f 31 30 33 34 68   |.[?1034h|
0008

$ TERM=dumb ./python -c "import readline" | hexdump -C

--
nosy: +vajrasky

___
Python tracker 

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



[issue19875] test_getsockaddrarg occasional failure

2013-12-04 Thread John W. O'Brien

John W. O'Brien added the comment:

For reference:

CPython code comments showing that this may be an anticipated problem:

http://hg.python.org/cpython/file/0830670a9d9d/Lib/test/support/__init__.py#l562

An example of another project that seems to have tackled this problem in the 
way neologix suggests:

http://openvswitch.org/pipermail/dev/2013-April/026430.html

I am inclined to frame this issue as a choice between LBYL (try to predict, 
subject to the race, whether a port will be available) and EAFP (blindly try a 
few random high ports before inferring failure).

--
nosy: +neirbowj

___
Python tracker 

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



[issue7060] test_multiprocessing dictionary changed size errors and hang

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Okay, let's say it is fixed. Adding Richard to nosy so that he can review the 
issue if he's interested.

--
resolution:  -> out of date
stage: needs patch -> committed/rejected

___
Python tracker 

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



[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'm ok with the backport.

--

___
Python tracker 

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



[issue19859] functools.lru_cache keeps objects alive forever

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Just adding a note in the documentation sounds enough.

--
nosy: +pitrou

___
Python tracker 

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



[issue19881] Fix bigmem pickle tests

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(we did have a bigmem buildbot but the bigmem tests tended to crash it, as some 
memory estimates are widely inaccurate)

--

___
Python tracker 

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



[issue19884] Importing readline produces erroneous output

2013-12-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I can't reproduce under Ubuntu 13.10. Is this Red Hat-specific?

(according to Dave, """This is a readline bug; it looks like it should not emit 
those characters when stdout is not a tty""")

--
nosy: +dmalcolm, pitrou
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



[issue19881] Fix bigmem pickle tests

2013-12-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file32972/pickle_bigmem_limits.patch

___
Python tracker 

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



[issue19881] Fix bigmem pickle tests

2013-12-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file32969/pickle_bigmem_limits.patch

___
Python tracker 

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



[issue19859] functools.lru_cache keeps objects alive forever

2013-12-04 Thread Radomir Dopieralski

Radomir Dopieralski added the comment:

> Umm, that's part of the operational definition of a value based cache
> - it needs to keep things alive, so that if a different instance shows
> up with the same value, it will still get a cache hit.

If it only kept the return value alive, that wouldn't be a problem, it's indeed 
intuitively obvious that it has to do that in order to work. But what many 
people miss to notice is that it also keeps any arguments that were passed to 
the function alive. This is not intuitive, and as I demonstrated with my patch, 
not even necessary, so I think it might be worthwhile to at least mention this 
little implementation quirk.

--

___
Python tracker 

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



[issue18840] Tutorial recommends pickle module without any warning of insecurity

2013-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Since this particular tutorial section was written long before the json module 
was part of the standard library, I think it makes sense to switch now we have 
the option.

pickle is definitely a useful tool, but now that JSON is available by default, 
it's now one to escalate to if JSON doesn't meet your needs, rather than the 
one to use by default.

Chris's patch looks generally good to me, although I think it could use a 
second paragraph in the pickle section. Perhaps something like:

"""JSON is much simpler to use safely than pickle, and offers broader 
interoperability with programs written in other languages. However, pickle has 
the advantage of supporting a much wider range of Python object types, 
including executable code, which means it can handle use cases that JSON can't 
(like sending code to another process for execution)"


This simpler/safer/less powerful API/technique vs more powerful/more dangerous 
API/technique trade-off is a fairly common one, so I think it's a good thing to 
have a concrete example of it in the tutorial rather than just dropping the 
reference to pickle entirely.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue19859] functools.lru_cache keeps objects alive forever

2013-12-04 Thread Nick Coghlan

Nick Coghlan added the comment:

On 4 December 2013 20:15, Radomir Dopieralski  wrote:
> But I think it's would be still worthwhile to add a note to the lru_cache's 
> documentation, saying something like:
>
> """
> Warning! lru_cache will keep references to all the arguments for which it 
> keeps cached values, which prevents them from being freed from memory when 
> there are no other references. This can lead to memory leaks when you call a 
> function with lru_cache on a lot of short-lived objects.
> """

Umm, that's part of the operational definition of a value based cache
- it needs to keep things alive, so that if a different instance shows
up with the same value, it will still get a cache hit.

We're willing to put warnings in the docs for cases where it's easy to
inadvertently introduce a security vulnerability, but not for
situations like this where using a container inappropriately may cause
it to keep objects alive that you didn't intend to keep alive.

--

___
Python tracker 

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



[issue19884] Importing readline produces erroneous output

2013-12-04 Thread Bohuslav "Slavek" Kabrda

New submission from Bohuslav "Slavek" Kabrda:

A simple reproducer:

python -c 'import readline' | xxd
000: 1b5b 3f31 3033 3468  .[?1034h

This was reported at [1] and originally at [2]. The readline maintainer 
suggests [3] using:

rl_variable_bind ("enable-meta-key", "off");

which was introduced in readline 6.1. Do you think it'd be safe to add the 
above line?

Thanks.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=880393
[2] https://bugzilla.redhat.com/show_bug.cgi?id=593799
[3] http://lists.gnu.org/archive/html/bug-readline/2011-04/msg9.html

--
components: Extension Modules
messages: 205217
nosy: bkabrda
priority: normal
severity: normal
status: open
title: Importing readline produces erroneous output
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue19787] tracemalloc: set_reentrant() should not have to call PyThread_delete_key()

2013-12-04 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

+1
Why don't we just fix this and see where the chips fall?

--

___
Python tracker 

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



[issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers

2013-12-04 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2013-12-04 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

That's the spirit, Guido :)
I just think people are being extra careful after the "regression" introduced 
in 2.7.5.
However, IMHO we must never let the odd mistake scare us from making necessary 
moves.
Unless Antoine explicitly objects, I think I'll submit my patch from november 
and we'll just watch what happens.

--

___
Python tracker 

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



[issue19687] Fixes for elementtree integer overflow

2013-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also *first* patch in issue16986.

--
nosy: +eli.bendersky, scoder, serhiy.storchaka

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2013-12-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue19859] functools.lru_cache keeps objects alive forever

2013-12-04 Thread Radomir Dopieralski

Radomir Dopieralski added the comment:

Thank you for your attention. I'm actually quite happy with the solution we 
have, it works well. That's actually I thought that it may be worthwhile to try 
and push it upstream to Python. I can totally understand why you don't want to 
add too much to the standard library, after all, everything you add there has 
to stay forever. So please consider this patch abandoned.

But I think it's would be still worthwhile to add a note to the lru_cache's 
documentation, saying something like:

"""
Warning! lru_cache will keep references to all the arguments for which it keeps 
cached values, which prevents them from being freed from memory when there are 
no other references. This can lead to memory leaks when you call a function 
with lru_cache on a lot of short-lived objects.
"""

I suppose you can come up with a nicer phrasing.

--

___
Python tracker 

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



[issue19687] Fixes for elementtree integer overflow

2013-12-04 Thread Christian Heimes

Christian Heimes added the comment:

New patch with fixes for element_ass_subscr().

--
Added file: http://bugs.python.org/file32971/elementtree_overflow2.patch

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2013-12-04 Thread STINNER Victor

STINNER Victor added the comment:

See also zipfile.py which is probably more correct than zipimport.c: zipfile 
uses for example "L" format for struct.unpack (*unsigned* long) to decode 
header fields.

--

___
Python tracker 

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



[issue19883] Integer overflow in zipimport.c

2013-12-04 Thread STINNER Victor

STINNER Victor added the comment:

read_directory() uses fseek() and ftell() which don't support offset larger 
than LONG_MAX (2 GB on 32-bit system).  I don't know if it's an issue. What 
happens if the file is longer?

"header_offset += arc_offset;" can overflow or not? This instuction looks weird.

header_position = ftell(fp);
...
header_offset = get_long((unsigned char *)endof_central_dir + 16);
arc_offset = header_position - header_offset - header_size;
header_offset += arc_offset;

If I computed correctly, the final line can be replaced with:

arc_offset = header_position - header_offset - header_size;
header_offset = header_position - header_size;

(It is weird to reuse header_position for two different values, a new variable 
may be added.)

Instead of checking that "header_offset > LONG_MAX", it may be safer to check 
that:

 - header_size >= 0
 - header_offset >= 0
 - header_offset + header_size <= LONG_MAX ---> header_offset <= LONG_MAX - 
header_size
 - arc_offset >= 0 ---> header_position >= header_offset + header_size
 - header_offset > 0 ---> header_position >= header_size

If all these values must be positive according to ZIP format, get_long() may be 
replaced with get_ulong() to simplify these checks.

--
nosy: +haypo
title: overflow in zipexport.c -> Integer overflow in zipimport.c

___
Python tracker 

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



[issue19883] overflow in zipexport.c

2013-12-04 Thread Christian Heimes

New submission from Christian Heimes:

MSVC complains about "conversion from 'Py_ssize_t' to 'long', possible loss of 
data" in zipimport.c. header_offset is a Py_ssize_t but fseek() only takes a 
long. On 64bit Windows Py_ssize_t is a 64bit data type but long is still a 
32bit data type.

It's safe to assume that the header will be smaller than 2 GB for the next 
couple of years. :)

--
assignee: brett.cannon
files: zipimport_header_offset.patch
keywords: patch
messages: 205209
nosy: brett.cannon, christian.heimes
priority: low
severity: normal
stage: patch review
status: open
title: overflow in zipexport.c
type: compile error
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file32970/zipimport_header_offset.patch

___
Python tracker 

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



[issue19859] functools.lru_cache keeps objects alive forever

2013-12-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Limiting the cache size is also not a solution in the 
> practical example with request that I linked to in the
> previous comment, because we can't know in advance how
> many times per request the function is going to be called, 
> picking an arbitrary number feels wrong and may lead to 
> unexpected behaviors

This suggests that you don't really want an LRU cache which is specifically 
designed to limit the cache size by expelling the
least recently used entry.

At its heart, the cache decorator is all about mapping a fixed inputs to fixed 
outputs.  The memory conservation comes from the replacement strategy and an 
option to clear the cache entirely.

The reason that my answer and Serhiy's answer don't fit your needs is that it 
isn't clear what you really want to do.  I think you should move this 
discussion to StackOverflow so others can help you tease-out your actual needs 
and suggest appropriate solutions.  Ideally, you should start with real use 
cases rather than focusing on hacking-up the LRU cache implementation.

--

___
Python tracker 

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



[issue19881] Fix bigmem pickle tests

2013-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch with new bigmem limits. Currently bigmem tests consumes much 
more memory than they declare. This can cause memory swapping and too long time 
of test's running.

--
Added file: http://bugs.python.org/file32969/pickle_bigmem_limits.patch

___
Python tracker 

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



[issue18840] Tutorial recommends pickle module without any warning of insecurity

2013-12-04 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
stage: needs patch -> patch review
type:  -> enhancement

___
Python tracker 

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



[issue19881] Fix bigmem pickle tests

2013-12-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Alexandre, if you have enough memory, could you please check that memory 
requirements for bigmem tests are correct?

--

___
Python tracker 

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



[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2013-12-04 Thread Christian Heimes

Christian Heimes added the comment:

I'd like to see the warning silenced before 3.4 gets released, too. How about a 
check like

   (Py_ssize_t)msg->msg_controllen > 0xL

instead? I'd also be fine with pragmas.

--
nosy: +christian.heimes
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