[issue16998] Lost updates with multiprocessing.Value

2013-01-20 Thread Jens Lechtenboerger

Jens Lechtenboerger added the comment:

 Loads and stores are both atomic.  But += is made up of two operations, a 
 load followed by a store, and the lock is dropped between the two.

I see.  Then this is a documentation bug.  The examples in the documentation 
use such non-thread-safe assignments (combined with the statement These shared 
objects will be process and thread safe.).

--

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



[issue4153] Unicode HOWTO up to date?

2013-01-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 260a9afd999a by Ezio Melotti in branch '3.2':
#4153: update the Unicode howto.
http://hg.python.org/cpython/rev/260a9afd999a

New changeset 572ca3d35c2f by Ezio Melotti in branch '3.3':
#4153: merge with 3.2.
http://hg.python.org/cpython/rev/572ca3d35c2f

New changeset 034e1e076c77 by Ezio Melotti in branch 'default':
#4153: merge with 3.3.
http://hg.python.org/cpython/rev/034e1e076c77

--
nosy: +python-dev

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



[issue4153] Unicode HOWTO up to date?

2013-01-20 Thread Ezio Melotti

Ezio Melotti added the comment:

I committed the attached patch with some minor modifications, but there are 
still comments that should be addressed on Rietveld.

--

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



[issue17002] html.entities ImportError in distutils2/pypi/simple.py on Python2.7

2013-01-20 Thread Cillian de Róiste

New submission from Cillian de Róiste:

I guess it should be wrapped in a try, except:

try:
from html.entities import name2codepoint
except ImportError:
from htmlentitydefs import name2codepoint

This works locally

Here's a sample traceback:

Traceback (most recent call last):
  File python2nix.py, line 119, in module
egg_release = pypi.get_release(egg['name'] + '==' + version)
  File 
/nix/var/nix/profiles/plone/lib/python2.7/site-packages/Distutils2-1.0a4-py2.7.egg/distutils2/pypi/simple.py,
 line 201, in get_release
releases = self.get_releases(predicate, prefer_final)
  File 
/nix/var/nix/profiles/plone/lib/python2.7/site-packages/Distutils2-1.0a4-py2.7.egg/distutils2/pypi/simple.py,
 line 189, in get_releases
self._process_index_page(predicate.name)
  File 
/nix/var/nix/profiles/plone/lib/python2.7/site-packages/Distutils2-1.0a4-py2.7.egg/distutils2/pypi/simple.py,
 line 75, in wrapped
return func(self, *args, **kwargs)
  File 
/nix/var/nix/profiles/plone/lib/python2.7/site-packages/Distutils2-1.0a4-py2.7.egg/distutils2/pypi/simple.py,
 line 397, in _process_index_page
self._process_url(url, name)
  File 
/nix/var/nix/profiles/plone/lib/python2.7/site-packages/Distutils2-1.0a4-py2.7.egg/distutils2/pypi/simple.py,
 line 320, in _process_url
for link, is_download in link_matcher(f.read().decode(), base_url):
  File 
/nix/var/nix/profiles/plone/lib/python2.7/site-packages/Distutils2-1.0a4-py2.7.egg/distutils2/pypi/simple.py,
 line 362, in _simple_link_matcher
url = self._get_full_url(match.group(1), base_url)
  File 
/nix/var/nix/profiles/plone/lib/python2.7/site-packages/Distutils2-1.0a4-py2.7.egg/distutils2/pypi/simple.py,
 line 349, in _get_full_url
return urlparse.urljoin(base_url, self._htmldecode(url))
  File 
/nix/var/nix/profiles/plone/lib/python2.7/site-packages/Distutils2-1.0a4-py2.7.egg/distutils2/pypi/simple.py,
 line 469, in _htmldecode
return ENTITY_SUB(self._decode_entity, text)
  File 
/nix/var/nix/profiles/plone/lib/python2.7/site-packages/Distutils2-1.0a4-py2.7.egg/distutils2/pypi/simple.py,
 line 463, in _decode_entity
from html.entities import name2codepoint
ImportError: No module named html.entities

--
assignee: eric.araujo
components: Distutils2
messages: 180285
nosy: alexis, eric.araujo, goibhniu, tarek
priority: normal
severity: normal
status: open
title: html.entities ImportError in distutils2/pypi/simple.py on Python2.7
type: crash
versions: Python 2.7

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



[issue16998] Lost updates with multiprocessing.Value

2013-01-20 Thread Richard Oudkerk

Richard Oudkerk added the comment:

 I see.  Then this is a documentation bug.  The examples in the 
 documentation use such non-thread-safe assignments (combined with the 
 statement These shared objects will be process and thread safe.).

Are you talking about this documentation:

  If lock is True (the default) then a new lock object is created to 
  synchronize access to the value. If lock is a Lock or RLock object then 
  that will be used to synchronize access to the value. If lock is False 
  then access to the returned object will not be automatically protected 
  by a lock, so it will not necessarily be “process-safe”.

It only says that accesses are synchronized.  The problem is that you were 
assuming that += involves a single access -- but that is not how python works.

Where in the examples is there non-process-safe access?  (Note that waiting 
for the only process which modifies a value to terminate using join() will 
prevent races.)

--

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



[issue17002] html.entities ImportError in distutils2/pypi/simple.py on Python2.7

2013-01-20 Thread Ezio Melotti

Ezio Melotti added the comment:

htmlentitydefs was renamed to html.entities in Python 3.
If this is supposed to run with Python 2 it should use the former, otherwise 
the latter (unless it has the same codebase on both).

--
nosy: +ezio.melotti
type: crash - behavior

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



[issue1159051] Handle corrupted gzip files with unexpected EOF

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is an updated patch addressing Nadeem Vawda's comments. Thank you.

--
Added file: http://bugs.python.org/file28795/gzip_eof-3.4_2.patch

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



[issue1159051] Handle corrupted gzip files with unexpected EOF

2013-01-20 Thread Nadeem Vawda

Nadeem Vawda added the comment:

The updated patch looks good to me.

--

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



[issue16997] subtests

2013-01-20 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue13598] string.Formatter doesn't support empty curly braces {}

2013-01-20 Thread Vinay Sajip

Vinay Sajip added the comment:

Looking at Phil Elson's patch:

I didn't see a test case relating to the example in his comment, namely

f.format({0:{}}, 'foo', 5)

Did I miss it? The documentation also needs to be updated.

--

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



[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Ramchandra Apte

Changes by Ramchandra Apte maniandra...@gmail.com:


Removed file: http://bugs.python.org/file28794/issue-v2.patch

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



[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Oh darn, I included another bugs changes in it.
I unlinked the v2 patch and have attached issue17001-v2.patch

--

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



[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Except for mistakenly included functional.rst changes, the patch looks good for 
me.

--
nosy: +serhiy.storchaka

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



[issue16557] PEP 380 isn't reflected in the Functional Programming HOWTO

2013-01-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e0de6e6e992e by Ezio Melotti in branch '3.3':
#16557: update functional howto -- return value is valid after PEP 380.  
Initial patch by Ramchandra Apte.
http://hg.python.org/cpython/rev/e0de6e6e992e

New changeset 81b2a30da853 by Ezio Melotti in branch 'default':
#16557: merge with 3.3.
http://hg.python.org/cpython/rev/81b2a30da853

--
nosy: +python-dev

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



[issue16557] PEP 380 isn't reflected in the Functional Programming HOWTO

2013-01-20 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patch!

--
assignee: docs@python - ezio.melotti
nosy: +ezio.melotti
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue16042] smtplib: unlimited readline() from connection

2013-01-20 Thread Christian Heimes

Christian Heimes added the comment:

Yes, I'm going to work on this issue for 2.7 and 3.3.

--
assignee:  - christian.heimes
priority: normal - critical
stage:  - needs patch
versions: +Python 3.4

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



[issue16041] poplib: unlimited readline() from connection

2013-01-20 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
assignee:  - christian.heimes
priority: normal - critical
stage:  - needs patch
versions: +Python 3.4

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



[issue16040] nntplib: unlimited readline() from connection

2013-01-20 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
assignee:  - christian.heimes
priority: normal - critical
versions: +Python 3.4

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



[issue16039] imaplib: unlimited readline() from connection

2013-01-20 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
assignee:  - christian.heimes
priority: normal - critical
stage:  - needs patch
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue16038] ftplib: unlimited readline() from connection

2013-01-20 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
assignee:  - christian.heimes
priority: normal - critical
stage:  - needs patch

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



[issue16037] httplib: header parsing is not delimited

2013-01-20 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
assignee:  - christian.heimes
priority: normal - critical
stage:  - needs patch
versions: +Python 3.4

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



[issue16043] xmlrpc: gzip_decode has unlimited read()

2013-01-20 Thread Christian Heimes

Christian Heimes added the comment:

The attached patch adds a limitation to xmlrpclib.gzip_decode().

--
assignee:  - christian.heimes
dependencies:  -gzip, bz2, lzma: add option to limit output size
keywords: +patch
priority: normal - critical
stage:  - patch review
versions: +Python 3.4
Added file: http://bugs.python.org/file28796/xmlrpc_gzip_27.patch

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



[issue1470548] Bugfix for #1470540 (XMLGenerator cannot output UTF-16)

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated. Now I get rid of __del__ to prevent hanging on reference cicles 
as Antoine suggested on IRC. Added test for check that XMLGenerator doesn't 
close the file passed as argument.

--
Added file: http://bugs.python.org/file28797/XMLGenerator-5.patch

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



[issue17003] Unification of read() and readline() argument names

2013-01-20 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

read() and readline() optional parameter which limit the amount of read data 
has different names in different classes. All this classes mimic (less or more) 
io classes. Keyword parameter name is a part of method specification. Therefore 
it will be good made all read() arguments names the same and all readline() 
arguments names the same (and be consistent with documentation and C 
implementation). At least we should choose most consistent name for new 
implementations. If existent C implementation of some method doesn't support 
keyword argument (all _io classes) or argument names in C and Python 
implementations are different then we are free to change this name without 
breaking existing code.

For example, read()'s parameter named as:

n in _pyio, zipfile, and io documentation;
size in gzip, bz2, imaplib, tarfile, codecs, mailbox;
len in ssl;
wtd or totalwtd in binhex;
amt in http/client;
chars in codecs;
buffersize in os.

readline()'s parameter named as:

limit in _pyio, zipfile, and io documentation;
size in gzip, bz2, codecs, mailbox, lzma.

--
assignee: docs@python
components: Documentation, IO, Library (Lib)
messages: 180298
nosy: benjamin.peterson, christian.heimes, docs@python, hynek, pitrou, 
serhiy.storchaka, stutzbach
priority: normal
severity: normal
status: open
title: Unification of read() and readline() argument names
type: enhancement

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



[issue7353] cporting docs recommend using Include/intobject.h, which was removed in 3.1?

2013-01-20 Thread Christian Heimes

Christian Heimes added the comment:

Go ahead!

The intobject header file used to make porting to Python 3 easier. Nowadays 
it's no longer required.

--

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



[issue17003] Unification of read() and readline() argument names

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Looks as size is most common parameter name for both read() and readline(). 
First, we can change the io documentation and _pyio signatures (it shouldn't 
break anything because _io doesn't support keyword arguments).

--

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



[issue16273] f.tell() returning negative number on Windows build

2013-01-20 Thread Catalin Iacob

Catalin Iacob added the comment:

Could it be that Raymond's file had Unix line endings?

I tried to reproduce this, picked a file on my disk and indeed I got a negative 
number, but that file has Unix line endings. This is documented at 
http://docs.python.org/2/library/stdtypes.html#file.tell so probably there's 
nothing to do then.

As for Armin's report in msg180145, even though it's not intuitive, this 
matches ftell's behavior on Windows, as documented in the Remarks section of 
http://msdn.microsoft.com/en-us/library/0ys3hc0b%28v=vs.100%29.aspx. The tell() 
method on fileobjects is explicitly documented as matching ftell behavior: 
Return the file’s current position, like stdio‘s ftell(). So even though it's 
not intuitive at all, it's probably better to leave it as is. tell() returns 
the intuitive non zero position when opening with 'a' on Python3 and on Python 
2.7 when using io.open so it's fixed for the future anyway.

--
nosy: +catalin.iacob

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



[issue17003] Unification of read() and readline() argument names

2013-01-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

n is the best choice IMO. size is ok too, although it may be confused with 
the byte-size of the result.

--

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



[issue17003] Unification of read() and readline() argument names

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which changes name of optional parameter of read(), read1(), 
peek(), and readline() methods to most common name size in the documentation 
and _pyio module. truncate() in _pyio fixed to conform with documentation. This 
changes are safe.

There is open question about readlines(). It's optional parameter named as:

hint in _pyio and the documentation;
size in bz2;
sizehint in codecs and mailbox.

--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file28798/io_parameter_names.patch

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



[issue17003] Unification of read() and readline() argument names

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 n is the best choice IMO.

Unfortunately most stdlib modules vote for size.

--

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



[issue15881] multiprocessing 'NoneType' object is not callable

2013-01-20 Thread Tres Seaver

Tres Seaver added the comment:

I can reproduce the bug against the 2.7 tip.

Reviewing the 2.7 patch:

- The 2.7 tip has 'Misc/ACKS' instead of 'Doc/ACKS.txt'.

- In 'Misc/ACKS', the line adding 'Chris McDonough' should add it in alpha 
order.

- The remainder of the patch looks correct, and applies cleanly to the tip of 
the 2.7 branch.

- After applying the patch to the 2.7 tip, I can no longer reproduce the bug.

- After applying the patch, the full test suite ('./python -m test.testall 
-j3') passes all tests.

--
nosy: +tseaver

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



[issue16042] smtplib: unlimited readline() from connection

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

mock_socket violates readline() contract. It can return more than size bytes, 
and this can break SMTP.readline().

--

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



[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Only a little of the existing logic is tied to the zipfile format.  Consider 
adding support for xz, tar, tar.gz, tar.bz2, etc.

In particular, xz has better compression, resulting in both space savings and 
faster load times.

--
messages: 180307
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Expand zipimport to include other compression methods
type: enhancement
versions: Python 3.4

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



[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Brian Curtin

Changes by Brian Curtin br...@python.org:


--
components: +Library (Lib)
nosy: +brian.curtin

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



[issue17002] html.entities ImportError in distutils2/pypi/simple.py on Python2.7

2013-01-20 Thread Éric Araujo

Éric Araujo added the comment:

Good call.  All function-level imports are avoided in d2 unless absolutely 
necessary, and this one slipped through the cracks.  distutils2 went from 
Python 2 to 3 to 2 and 3 again, so these things happen (and it’s one of the 
reasons why I’ve always insisted on trying to keep as much history as possible 
in one repo).

Will fix, as even though d2 will not continue to live as one monolithic 
project, the pypi submodule will certainly be extracted in a smaller lib 
reusable by other tools.

--
stage:  - test needed
versions: +3rd party -Python 2.7

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



[issue8745] zipimport is a bit slow

2013-01-20 Thread Serhiy Storchaka

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


--
nosy: +brian.curtin

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



[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Guido van Rossum

Guido van Rossum added the comment:

Oh, it needs a new patch -- the patch fails to apply in the 3.4
(default) branch.

--

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



[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

tar.* is not a good choice because it doesn't allow random access. Bare tar 
better than zip only in case when you need to save additional file attributes 
(Unix file access mode, times, owner, group, links). ZIP format supports all 
this too, but not zipfile module yet.

Adding bz2 or lzma compression to ZIP file shouldn't be too hard.

--
nosy: +nadeem.vawda, serhiy.storchaka
stage:  - needs patch

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



[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are some tests.

time 7z a -tzip -mx=0 python-0.zip $(find Lib -type f -name '*.py') /dev/null
time 7z a -tzip python.zip $(find Lib -type f -name '*.py') /dev/null
time 7z a -tzip -mx=9 python-9.zip $(find Lib -type f -name '*.py') /dev/null
time 7z a -tzip -mm=bzip2 python-bzip2.zip $(find Lib -type f -name '*.py') 
/dev/null
time 7z a -tzip -mm=bzip2 -mx=9 python-bzip2-9.zip $(find Lib -type f -name 
'*.py') /dev/null
time 7z a -tzip -mm=lzma python-lzma.zip $(find Lib -type f -name '*.py') 
/dev/null
time 7z a -tzip -mm=lzma -mx=9 python-lzma-9.zip $(find Lib -type f -name 
'*.py') /dev/null
time 7z t python-0.zip /dev/null
time 7z t python.zip /dev/null
time 7z t python-9.zip /dev/null
time 7z t python-bzip2.zip /dev/null
time 7z t python-bzip2-9.zip /dev/null
time 7z t python-lzma /dev/null
time 7z t python-lzma.zip /dev/null
time 7z t python-lzma-9.zip /dev/null
wc -c python*.zip

Results:

 pack* unpack   size
 time   time(MB)
store 0.50.2   19.42
deflate 60.44.59
deflate-max400.44.52
bzip2   62.14.45
bzip2-max  792.04.39
lzma   370.74.42
lzma-max   620.74.39

*) For pack time I take user time because 7-zip well parallelize deflate and 
bzip2 compression.

As you can see, a size difference between maximal compression with different 
methods only 3%. lzma decompress almost twice slower then deflate, and bzip2 
decompress 5 times slower. Python files are too small to get benefit from 
advanced compression.

--

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



[issue8745] zipimport is a bit slow

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry, Brian. Raymond is an initiator of issue17004.

--
nosy: +rhettinger -brian.curtin

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



[issue13405] Add DTrace probes

2013-01-20 Thread Trent Nelson

Changes by Trent Nelson tr...@snakebite.org:


--
nosy: +trent

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



[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 Here are some tests.

I think you want to put pyc files in the zip file as well.

--
nosy: +pitrou

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



[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

xz will likely be the best win -- it is purported to compress smaller than bz2 
while retaining the decompression speed of zip.

As Antoine says, the usual practice is to add py, pyc, and pyo files to the 
compressed library; otherwise, there is an added cost with Python tries to 
write a missing pyc/pyo file.

--

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



[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Guido van Rossum

Guido van Rossum added the comment:

Here's a new version of the patch.  (Will test on Windows next.)

--
Added file: http://bugs.python.org/file28799/runtime_wsapoll.patch

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



[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I recommend against this patch.  The code generated by functools.total_ordering 
is less efficient than the existing code and it doesn't handle the 
NotImplemented logic very well.

total_ordering() is a shortcut, not a best practice.

--
nosy: +rhettinger

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



[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Guido van Rossum

Guido van Rossum added the comment:

That compiles (after hacking the line endings).  One Tulip test fails, 
PollEventLooptests.testSockClientFail.  But that's probably because the 
PollSelector class hasn't been adjusted for Windows yet (need to dig this out 
of the Pollster code that was deleted when switching to neologix's Selector).

--

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



[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Guido van Rossum

Guido van Rossum added the comment:

That compiles (after hacking the line endings).  One Tulip test fails, 
PollEventLooptests.testSockClientFail.  But that's probably because the 
PollSelector class hasn't been adjusted for Windows yet (need to dig this out 
of the Pollster code that was deleted when switching to neologix's Selector).

--

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



[issue17005] Add a topological sort algorithm

2013-01-20 Thread Raymond Hettinger

New submission from Raymond Hettinger:

I suggest adding a topological sort algorithm to the standard library.

In addition to being a fundamental algorithm, it is immediately useful in 
demonstrating how the MRO computation works and for pure Python implementations 
of MRO logic.   IIRC, the pgen code was also expressed in pure Python for the 
same reason.

I've attached a first-draft of the algorithm and an alternative that only 
implements a topological merge.  This is just an early draft and there are a 
number of open points:

* which module to put it in
* a better implementation may be possible (perhaps using fewer dictionaries and 
sets).

--
files: mro_merge.py
messages: 180319
nosy: rhettinger
priority: low
severity: normal
status: open
title: Add a topological sort algorithm
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file28800/mro_merge.py

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



[issue15050] Python 3.2.3 fail to make

2013-01-20 Thread Ezio Melotti

Ezio Melotti added the comment:

I'm going to close this as out of date.  Feel free to reopen if it turns out 
that this is indeed a Python issue.

--
nosy: +ezio.melotti
resolution:  - out of date
stage:  - committed/rejected
status: open - closed

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



[issue17005] Add a topological sort algorithm

2013-01-20 Thread Christian Heimes

Christian Heimes added the comment:

Good idea!

I'm using http://pypi.python.org/pypi/topsort/0.9 for a couple of years. The 
initial code was written by Tim Peters.

--
nosy: +christian.heimes

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



[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Richard Oudkerk

Richard Oudkerk added the comment:

 That compiles (after hacking the line endings).  One Tulip test fails, 
 PollEventLooptests.testSockClientFail.  But that's probably because the 
 PollSelector class hasn't been adjusted for Windows yet (need to dig this 
 out of the Pollster code that was deleted when switching to neologix's 
 Selector).

Sorry I did not deal with this earlier.  I can make the modifications to 
PollSelector tommorrow.

Just to describe the horrible hack: every time poll() needs to be called we 
first check if there are any registered async connects.  If so then I first use 
select([], [], connectors) to detect any failed connections, and then use 
poll() normally.

This does mean that to detect failed connections we must never use too large a 
timeout with poll() when there are outstanding connects.  Of course one must 
decide what is an acceptable maximum timeout -- too short and you might damage 
battery life, too long and you will not get prompt notification of failures.

--

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



[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Well.

./python -m compileall $(find Lib -type f -name '*.py')
./python -O -m compileall $(find Lib -type f -name '*.py')

Tests:

FILES=$(find Lib -name '*.py' -o -name '*.py[co]')
time 7z a -tzip -mx=0 python-0.zip $FILES /dev/null
time 7z a -tzip python.zip $FILES /dev/null
time 7z a -tzip -mx=9 python-9.zip $FILES /dev/null
time 7z a -tzip -mm=bzip2 python-bzip2.zip $FILES /dev/null
time 7z a -tzip -mm=bzip2 -mx=9 python-bzip2-9.zip $FILES /dev/null
time 7z a -tzip -mm=lzma python-lzma.zip $FILES /dev/null
time 7z a -tzip -mm=lzma -mx=9 python-lzma-9.zip $FILES /dev/null
time 7z t python-0.zip /dev/null
time 7z t python.zip /dev/null
time 7z t python-9.zip /dev/null
time 7z t python-bzip2.zip /dev/null
time 7z t python-bzip2-9.zip /dev/null
time 7z t python-lzma.zip /dev/null
time 7z t python-lzma-9.zip /dev/null
wc -c python*.zip

Results:

 pack  unpack   size
 time   time(MB)
store 1.60.565.4
deflate190.917.5
deflate-max   1340.917.2
bzip2  214.216.5
bzip2-max 2944.116.3
lzma  1202.315.9
lzma-max  2042.315.8

All numbers are about 3x larger. lzma-max is 8% less than deflate-max but 2.5 
times slower. Bzip2 is out of the game.

--

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



[issue17004] Expand zipimport to include other compression methods

2013-01-20 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Agreed it doesn't look very promising.

--

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



[issue15881] multiprocessing 'NoneType' object is not callable

2013-01-20 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek

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



[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Guido van Rossum

Guido van Rossum added the comment:

Ow. How painful. I'll leave this for you to do. Note that this also
requires separating EVENT_WRITE from EVENT_CONNECT -- I am looking
into this now, but I am not sure how far I will get with this.

--

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



[issue7353] cporting docs recommend using Include/intobject.h, which was removed in 3.1?

2013-01-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6df456f8fc6d by Stefan Krah in branch '3.3':
Issue #7353: Remove references to Include/intobject.h in the C-porting howto.
http://hg.python.org/cpython/rev/6df456f8fc6d

--
nosy: +python-dev

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



[issue7353] cporting docs recommend using Include/intobject.h, which was removed in 3.1?

2013-01-20 Thread Stefan Krah

Changes by Stefan Krah stefan-use...@bytereef.org:


--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
versions: +Python 2.7, Python 3.3, Python 3.4 -Python 3.1, Python 3.2

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



[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2013-01-20 Thread Guido van Rossum

Guido van Rossum added the comment:

(FWIW, I've got the EVENT_CONNECT separation done.)

--

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



[issue16507] Patch selectmodule.c to support WSAPoll on Windows

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

Charles-François Natali added the comment:

Time for a stupid question from someone who doesn't know anything about 
Windows: if WSAPoll() is really terminally broken, is it really worth the 
hassle exposing it and warping the API?
AFAICT, FD_SETSIZE is already bumped to 512 on Windows, and Windows select() is 
limited by the fd_set size, not the maximum descriptor: so what exactly does 
WSAPoll() bring over select() on Windows?
(Especially if there are plans to support IOCP, wouldn't that make WSAPoll() 
obsolete?)

--
nosy: +neologix

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



[issue17005] Add a topological sort algorithm

2013-01-20 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger

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



[issue17005] Add a topological sort algorithm

2013-01-20 Thread Eric V. Smith

Eric V. Smith added the comment:

+1

I'll note (by inspection only) your example code doesn't work under Python 3.x! 
:)

(print as a statement)

--
nosy: +eric.smith

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