[issue16858] tarfile silently hides errors

2013-01-04 Thread Марк Коренберг

Марк Коренберг added the comment:

Ups. hiding EOFHeaderError is not an error.
But handilng of other errors is not perfect. Please review TarFile.next() for 
cases where .tar file is corrupted. For example,

TruncatedHeaderError is re-raised only if problem at the start of the file. 
Really, it can appear in the (original) middle of the file.

--

___
Python tracker 

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



[issue16858] tarfile silently hides errors

2013-01-04 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lars.gustaebel
versions:  -Python 3.5

___
Python tracker 

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



[issue16859] tarfile.TarInfo.fromtarfile does not check read() return value

2013-01-04 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lars.gustaebel

___
Python tracker 

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



[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

--
assignee:  -> serhiy.storchaka
components: +Unicode
keywords: +3.3regression, patch
nosy: +ezio.melotti, serhiy.storchaka
stage:  -> patch review
Added file: http://bugs.python.org/file28555/unicode_append.patch

___
Python tracker 

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



[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-04 Thread Christian Heimes

Christian Heimes added the comment:

IMO the check is better performed a couple of lines later:

if (right == NULL || left == NULL || !PyUnicode_Check(left)) {

--
nosy: +christian.heimes

___
Python tracker 

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



[issue5309] setup.py doesn't parallelize extension module compilation

2013-01-04 Thread Christian Heimes

Christian Heimes added the comment:

+1

I think it's sufficient to parallelize the compilation step (.c -> .o) and 
ignore the linker step. Linking is usually so fast that it doesn't matter.

Idea:
* separate compile step from link step
* run all compile calls for all extensions in parallel until all objects of all 
extensions are generated
* do linking and error reporting in serial mode

--
nosy: +christian.heimes

___
Python tracker 

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



[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2013-01-04 Thread Stefan Krah

Stefan Krah added the comment:

Daniel Shahaf  wrote:
> Is there a requirement that it loads a particular module?  Would etree
> users notice the difference if pickle.load() returns an instance of the
> "other" Element implementation than the one they pickled?

Yes: If you send an "_elementtree.Element" pickle to another machine that
doesn't have a working C version, it can't be unpickled. As far as I know
the only way around that is to pickle as "xml.etree.ElementTree.Element".

--

___
Python tracker 

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



[issue16674] Faster getrandbits() for small integers

2013-01-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b0926ddcab5e by Serhiy Storchaka in branch 'default':
Issue #16674: random.getrandbits() is now 20-40% faster for small integers.
http://hg.python.org/cpython/rev/b0926ddcab5e

--
nosy: +python-dev

___
Python tracker 

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



[issue9720] zipfile writes incorrect local file header for large files in zip64

2013-01-04 Thread Nico Möller

Nico Möller added the comment:

I most definitely need a patch for 2.7.3 

Would be awesome if you could provide a patch for that version.

--
nosy: +Nico.Möller

___
Python tracker 

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



[issue16674] Faster getrandbits() for small integers

2013-01-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue16799] switch regrtest from getopt options to argparse Namespace

2013-01-04 Thread Kushal Das

Kushal Das added the comment:

The patches look good. Applied successfully and tests ran ok.

--
nosy: +kushaldas

___
Python tracker 

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



[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3cee61137598 by Serhiy Storchaka in branch '3.3':
Issue #16856: Fix a segmentation fault from calling repr() on a dict with
http://hg.python.org/cpython/rev/3cee61137598

New changeset fee4bc043d73 by Serhiy Storchaka in branch 'default':
Issue #16856: Fix a segmentation fault from calling repr() on a dict with
http://hg.python.org/cpython/rev/fee4bc043d73

--
nosy: +python-dev

___
Python tracker 

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



[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> IMO the check is better performed a couple of lines later:

Done.

Thank you for report, David.

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

___
Python tracker 

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



[issue16747] Remove 'file' type reference from 'iterable' glossary entry

2013-01-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dea89ee34402 by Chris Jerdonek in branch '2.7':
Issue #16747: Reflow iterable glossary entry to match 3.x change e19ed347523e.
http://hg.python.org/cpython/rev/dea89ee34402

--

___
Python tracker 

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



[issue16853] add a Selector to the select module

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

Charles-François Natali added the comment:

Here's a new version adressing Guido's comments (except for kqueue, for which 
I'll add support later when I can test it).

I'm also attaching a benchmark to compare the implementations: as noted by 
Guido, the complexity of select/poll/epoll are the theoretical ones: in real 
life, the syscall's cost is probably dwarfed by objects creation, etc.

Here's a run, for two ready FDs among 1018:
"""
$ ./python ~/selector_bench.py -r 2 -m 1018 -t socket 
Trying with 2 ready FDs out of 1018, type socket

0.056010190999586484

0.2639519829990604

1.1859817369986558
"""

So this can be interesting when a large number of FDs are monitored.

For sake of cmpleteness, for a sparse allocation (i.e. just a couple FDS 
allocated near FD_SETSIZE), there's not much gain:
"""
$ ./python ~/selector_bench.py -r 2 -m 1018 -t socket  -s
Trying with 2 FDs starting at 1018, type socket

0.06651040699944133

0.06033727799876942

0.0948788189998595
"""

Two points I'm not sure about:
- should EINTR be handled (i.e. retry, with an updated timeout). I'm tempted to 
say yes, because EINTR is just a pain the user should never be exposed with.
- what should be done with POLLNVAL and POLLERR? Raise an exception (that's 
what Java does, but since you can get quite quite easily it would be a pain to 
use), return a generic SELECT_ERR event? FWIW, twisted returns POLLERR|POLLNVAL 
as a CONNECTION_LOST event.

--
Added file: http://bugs.python.org/file28556/selector-2.diff

___
Python tracker 

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



[issue16853] add a Selector to the select module

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

Changes by Charles-François Natali :


Added file: http://bugs.python.org/file28557/selector_bench.py

___
Python tracker 

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



[issue16853] add a Selector to the select module

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

Changes by Charles-François Natali :


Removed file: http://bugs.python.org/file28553/selector-1.diff

___
Python tracker 

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



[issue9720] zipfile writes incorrect local file header for large files in zip64

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are second variant patches for 2.7 and 3.2.

--
Added file: http://bugs.python.org/file28558/zipfile_zip64_try_2-2.7.patch
Added file: http://bugs.python.org/file28559/zipfile_zip64_try_2-3.2.patch

___
Python tracker 

___diff -r c8e885ecbc89 Lib/zipfile.py
--- a/Lib/zipfile.pyThu Jan 03 20:34:19 2013 -0800
+++ b/Lib/zipfile.pyFri Jan 04 15:24:35 2013 +0200
@@ -316,7 +316,7 @@
 # compress_size Size of the compressed file
 # file_size Size of the uncompressed file
 
-def FileHeader(self):
+def FileHeader(self, zip64=None):
 """Return the per-file header as a string."""
 dt = self.date_time
 dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
@@ -331,12 +331,17 @@
 
 extra = self.extra
 
-if file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
-# File is larger than what fits into a 4 byte integer,
-# fall back to the ZIP64 extension
+if zip64 is None:
+zip64 = file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT
+if zip64:
 fmt = ' ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
+if not zip64:
+raise LargeZipFile("Filesize would require ZIP64 extensions")
+# File is larger than what fits into a 4 byte integer,
+# fall back to the ZIP64 extension
 file_size = 0x
 compress_size = 0x
 self.extract_version = max(45, self.extract_version)
@@ -1113,20 +1118,23 @@
 zinfo.CRC = 0
 self.filelist.append(zinfo)
 self.NameToInfo[zinfo.filename] = zinfo
-self.fp.write(zinfo.FileHeader())
+self.fp.write(zinfo.FileHeader(False))
 return
 
 with open(filename, "rb") as fp:
 # Must overwrite CRC and sizes with correct data later
 zinfo.CRC = CRC = 0
 zinfo.compress_size = compress_size = 0
-zinfo.file_size = file_size = 0
-self.fp.write(zinfo.FileHeader())
+# Compressed size can be larger than uncompressed size
+zip64 = self._allowZip64 and \
+zinfo.file_size * 1.05 > ZIP64_LIMIT
+self.fp.write(zinfo.FileHeader(zip64))
 if zinfo.compress_type == ZIP_DEFLATED:
 cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION,
  zlib.DEFLATED, -15)
 else:
 cmpr = None
+file_size = 0
 while 1:
 buf = fp.read(1024 * 8)
 if not buf:
@@ -1146,11 +1154,16 @@
 zinfo.compress_size = file_size
 zinfo.CRC = CRC
 zinfo.file_size = file_size
-# Seek backwards and write CRC and file sizes
+if not zip64 and self._allowZip64:
+if file_size > ZIP64_LIMIT:
+raise RuntimeError('File size has increased during 
compressing')
+if compress_size > ZIP64_LIMIT:
+raise RuntimeError('Compressed size larger than uncompressed 
size')
+# Seek backwards and write file header (which will now include
+# correct CRC and file sizes)
 position = self.fp.tell()   # Preserve current position in file
-self.fp.seek(zinfo.header_offset + 14, 0)
-self.fp.write(struct.pack(" ZIP64_LIMIT or \
+zinfo.compress_size > ZIP64_LIMIT
+if zip64 and not self._allowZip64:
+raise LargeZipFile("Filesize would require ZIP64 extensions")
+self.fp.write(zinfo.FileHeader(zip64))
 self.fp.write(bytes)
-self.fp.flush()
 if zinfo.flag_bits & 0x08:
 # Write CRC and file sizes after the file data
-self.fp.write(struct.pack("diff -r f81522ee5b37 Lib/zipfile.py
--- a/Lib/zipfile.pyThu Jan 03 20:34:40 2013 -0800
+++ b/Lib/zipfile.pyFri Jan 04 15:17:59 2013 +0200
@@ -326,7 +326,7 @@
 # compress_size Size of the compressed file
 # file_size Size of the uncompressed file
 
-def FileHeader(self):
+def FileHeader(self, zip64=None):
 """Return the per-file header as a string."""
 dt = self.date_time
 dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
@@ -341,12 +341,17 @@
 
 extra = self.extra
 
-if file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
-# File is larger than what fits into a 4 byte integer,
-# fall back to the ZIP64 extension
+if zip64 is None:
+zip64 = file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT
+if zip64:
 fmt = ' ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
+if not zip64:
+raise LargeZipFile("Filesize would require ZIP64 extensions")
+

[issue16850] Atomic open + close-and-exec

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

Charles-François Natali added the comment:

> Windows provides O_NOINHERIT (_O_NOINHERIT) flag which has a similar purpose.
>
>> ... and even then, many Unices don't support it.
>
> Yes, but I bet that more and more OSes will support it :-) For example, it 
> looks like O_CLOEXEC is part of the POSIX standard 2008:

Hum, OK, but many operating systems don't support it to this day.
So if we expose it and the underlying operating system doesn't support
it, do you want to fallback to fcntl (which wouldb't be atomic
anymore, but let's pretend the GIL protection is enough).

Also, I'm not sure exactly if this flag is useful enough to be
exposed: there are many flags that can be passed when opening a file:
O_DIRECT, O_SYNC, O_NONBLOCK, O_DSYNC...
Amusingly, Java exposes some of them (but not O_CLOEXEC):
http://docs.oracle.com/javase/7/docs/api/java/nio/file/StandardOpenOption.html

--

___
Python tracker 

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



[issue16853] add a Selector to the select module

2013-01-04 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue16850] Atomic open + close-and-exec

2013-01-04 Thread STINNER Victor

STINNER Victor added the comment:

> So if we expose it and the underlying operating system doesn't support
it, do you want to fallback to fcntl (which wouldb't be atomic
anymore, but let's pretend the GIL protection is enough).

At the beginning, I was convinced that the atomicity was important than the 
portability. But after having read that even fopen() uses a fallback, it is 
maybe much more convinient to have a fallback.

For example, it would be annoying that a program works on Linux 2.6.23, but not 
on Linux 2.6.22 whereas the atomicity is not a must-have. Said differently: the 
manual fallback described in msg178957 now seems annoying to me :-)

So let's say that a fallback is preferable to improve the portability, but that 
open(name, "e") would still fail with NotImplementedError if O_CLOEXEC, 
O_NOINHERIT and fcntl(FD_CLOEXEC) are all missing on a platform. I guess that 
all platform provide at least one flag/function.

You already implemented a similar fallback for subprocess: use pipe2(O_CLOEXEC) 
if available, or fallback to pipe()+fcntl(FD_CLOEXEC).

> I'm not sure exactly if this flag is useful enough to be exposed

I would like to benefit of the atomicity feature of O_CLOEXEC, without having 
to implement myself all the tricky things to check if the platform supports it 
or not.

O_CLOEXEC solves for example a race condition in tempfile._mkstemp_inner():

fd = _os.open(file, flags, 0o600)
_set_cloexec(fd)

--

___
Python tracker 

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



[issue16850] Atomic open + close-and-exec

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

Charles-François Natali added the comment:

> O_CLOEXEC solves for example a race condition in tempfile._mkstemp_inner():
>
> fd = _os.open(file, flags, 0o600)
> _set_cloexec(fd)

Hum...
"""
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -57,6 +57,8 @@
 _allocate_lock = _thread.allocate_lock

 _text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL
+if hasattr(_os, 'O_CLOEXEC'):
+_text_openflags |= _os.O_CLOEXEC
 if hasattr(_os, 'O_NOINHERIT'):
 _text_openflags |= _os.O_NOINHERIT
 if hasattr(_os, 'O_NOFOLLOW'):
"""

We should probably add this to 3.3 and default (IIRC O_CLOEXEC was
added to the os module in 3.3).
Also, I think O_NOFOLLOW is useless: if the file is created
(O_EXCL|O_CREAT), then by definition it's not a symlink (juste check
glibc's mkstemp() implementation, and it only passes O_CREAT|O_EXCL).

--

___
Python tracker 

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



[issue16860] Use O_CLOEXEC in the tempfile module

2013-01-04 Thread STINNER Victor

New submission from STINNER Victor:

os.O_CLOEXEC has been added to Python 3.3. This flag solves a race condition if 
the process is forked between open() and a call to fcntl() to set the 
FD_CLOEXEC flag.

The following patch written by neologix should fix this issue:
"""
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -57,6 +57,8 @@
 _allocate_lock = _thread.allocate_lock

 _text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL
+if hasattr(_os, 'O_CLOEXEC'):
+_text_openflags |= _os.O_CLOEXEC
 if hasattr(_os, 'O_NOINHERIT'):
 _text_openflags |= _os.O_NOINHERIT
 if hasattr(_os, 'O_NOFOLLOW'):
"""

The patch can be applied to Python 3.3 and 3.4.

--
components: Library (Lib)
messages: 179023
nosy: haypo, neologix
priority: normal
severity: normal
status: open
title: Use O_CLOEXEC in the tempfile module
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue16850] Atomic open + close-and-exec

2013-01-04 Thread STINNER Victor

STINNER Victor added the comment:

> We should probably add this to 3.3 and default (IIRC O_CLOEXEC was
added to the os module in 3.3).

I created the issue #16860. I just realized that tempfile doesn't use open() 
but os.open(), so this issue help to fix #16860.

--

___
Python tracker 

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



[issue16860] Use O_CLOEXEC in the tempfile module

2013-01-04 Thread STINNER Victor

STINNER Victor added the comment:

See also #16850 which proposes to expose O_CLOEXEC feature in the open() 
builtin function.

--

___
Python tracker 

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



[issue16860] Use O_CLOEXEC in the tempfile module

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

Charles-François Natali added the comment:

Here's the patch.
It also removes O_NOFOLLOW, which is basically useless (if the file is created 
with O_CREAT|O_EXCL, then by definition it's not a symlink).

--
keywords: +needs review, patch
type:  -> behavior
Added file: http://bugs.python.org/file28560/tempfile_cloexec.diff

___
Python tracker 

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



[issue16850] Atomic open + close-and-exec

2013-01-04 Thread STINNER Victor

STINNER Victor added the comment:

Here is a work-in-progress patch to test my idea: add "e" flag to open().

Limitations/TODO:

 * The unit test doesn't work on Windows (it requires fcntl)
 * "e" mode and the opener argument are exclusive: if O_CLOEXEC and 
O_NOINHERINT are missing, I don't see how the opener can be aware of the "e" 
flag. Or should we call fcntl(F_SETFD, flags|FD_CLOEXEC) after the opener? It 
would be strange: the opener is supposed to be the only one to decide how the 
file is opened, isn't it?
 * NotImplementedError is raised if O_CLOEXEC, O_NOINHERIT and fcntl() are 
missing

I only tested my patch on Linux (3.6).

--
keywords: +patch
Added file: http://bugs.python.org/file28561/open_mode_e.patch

___
Python tracker 

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



[issue16857] replace my email address on argparse howto with my website

2013-01-04 Thread Tshepang Lekhonkhobe

Tshepang Lekhonkhobe added the comment:

thanks

--

___
Python tracker 

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



[issue16860] Use O_CLOEXEC in the tempfile module

2013-01-04 Thread STINNER Victor

STINNER Victor added the comment:

> Here's the patch.

_set_cloexec() is still called whereas it is useless if the OS supports 
O_CLOEXEC... But the call must be kept because Linux < 2.6.23 just ignores 
O_CLOEXEC: we would have to check _fcntl.fcntl(fd, _fcntl.F_GETFD, 0) & 
_fcntl.FD_CLOEXEC to check if the kernel does really support O_CLOEXEC, which 
is overkill. The possibly useless syscall doesn't hurt.

> (if the file is created with O_CREAT|O_EXCL, then by definition it's not a 
> symlink).

Ah yes, because of O_EXCL.

The patch looks good to me!

--

___
Python tracker 

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



[issue15359] Sockets support for CAN_BCM

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

Charles-François Natali added the comment:

Brian, could you add tests to Lib/test/test_socket.py (look for CANTest, you 
should be able to complete them).

--

___
Python tracker 

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



[issue11477] Incorrect operand precedence when implementing sequences in C

2013-01-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Updated issue title to better describe the symptoms of the issue (and hopefully 
make it so I don't spend 5 minutes remembering the issue title every time I 
want to look at it...)

--
title: Bug in code dispatching based on internal slots -> Incorrect operand 
precedence when implementing sequences in C

___
Python tracker 

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



[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2013-01-04 Thread Eli Bendersky

Eli Bendersky added the comment:

On Jan 4, 2013 2:09 AM, "Stefan Krah"  wrote:
>
>
> Stefan Krah added the comment:
>
> Daniel Shahaf  wrote:
> > Is there a requirement that it loads a particular module?  Would etree
> > users notice the difference if pickle.load() returns an instance of the
> > "other" Element implementation than the one they pickled?
>
> Yes: If you send an "_elementtree.Element" pickle to another machine that
> doesn't have a working C version, it can't be unpickled. As far as I know
> the only way around that is to pickle as "xml.etree.ElementTree.Element".
>
> --
>

Yes this is a good point. Another thing to consider is that if both report
the same name then it will be possible to unpickle on a machine running 3.2

> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue14807] Move tarfile.filemode() into stat module

2013-01-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue9685] tuples should remember their hash value

2013-01-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Interpreter Core
type: resource usage -> performance
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue5066] IDLE documentation for Unix obsolete/incorrect

2013-01-04 Thread Todd Rovito

Todd Rovito added the comment:

A "ping" on this bug since it has not had any forward movement.  Can somebody 
please review and or commit?  Thanks.

--

___
Python tracker 

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



[issue12018] No tests for ntpath.samefile, ntpath.sameopenfile

2013-01-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Tests -Library (Lib)

___
Python tracker 

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



[issue16861] Portion of code example not highlighted in collections doc

2013-01-04 Thread Ramchandra Apte

New submission from Ramchandra Apte:

In 
http://docs.python.org/2/library/collections.html#namedtuple-factory-function-for-tuples-with-named-fields
 , a portion of the code example is not highlighted.
---
Happy, new, melodious, joyful, etc, boring new year.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 2.7

___
Python tracker 

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



[issue16861] Portion of code example not highlighted in collections doc

2013-01-04 Thread Ramchandra Apte

Changes by Ramchandra Apte :


--
nosy: ramchandra.apte
priority: normal
severity: normal
status: open
title: Portion of code example not highlighted in collections doc

___
Python tracker 

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



[issue9267] Update pickle opcode documentation in pickletools for 3.x

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue16550.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue12018] No tests for ntpath.samefile, ntpath.sameopenfile

2013-01-04 Thread Ronald Oussoren

Ronald Oussoren added the comment:

There are tests for samefile and sameopenfile in test_genericpath.GenericTest 
which is included by test_ntpath (NtCommonTest subclasses 
test_genericpath.CommonTest which again subclasses GenericTest).

I cannot easily test on Windows (the only windows systems I've easy access to 
are production boxes using py2.7), but if my analysis is correct this issue can 
be closed

--

___
Python tracker 

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



[issue12018] No tests for ntpath.samefile, ntpath.sameopenfile

2013-01-04 Thread Brian Curtin

Brian Curtin added the comment:

That's true of the default branch due to some changes I recently made in the 
implementation of the functions, but we should probably put tests into 3.2/3.3.

--

___
Python tracker 

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



[issue16862] FAQ has outdated information about Stackless

2013-01-04 Thread Ramchandra Apte

New submission from Ramchandra Apte:

The FAQ says "It’s [Stackless] still experimental but looks very promising." 
AFAIK, Stackless is mature.

--
assignee: docs@python
components: Documentation
messages: 179038
nosy: docs@python, ramchandra.apte
priority: normal
severity: normal
status: open
title: FAQ has outdated information about Stackless

___
Python tracker 

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



[issue16862] FAQ has outdated information about Stackless

2013-01-04 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Sorry, link here, 
http://docs.python.org/3/faq/design.html#can-t-you-emulate-threads-in-the-interpreter-instead-of-relying-on-an-os-specific-thread-implementation
 .

--

___
Python tracker 

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



[issue14807] Move tarfile.filemode() into stat module

2013-01-04 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Previous issue should have been fixed by now.
Closing.

--
status: pending -> closed

___
Python tracker 

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



[issue16863] Argparse tutorial outdated

2013-01-04 Thread Charlie Dimino

New submission from Charlie Dimino:

http://docs.python.org/2/howto/argparse.html

Error message in the first example is outdated, may indicate further out of 
date information on page.

Example:

The tutorial says:
prog.py: error: the following arguments are required: echo

When the actual error received is:
prog.py: error: too few arguments

--
assignee: docs@python
components: Documentation
messages: 179041
nosy: Charlie.Dimino, docs@python
priority: normal
severity: normal
status: open
title: Argparse tutorial outdated
versions: Python 2.7

___
Python tracker 

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



[issue16853] add a Selector to the select module

2013-01-04 Thread Guido van Rossum

Guido van Rossum added the comment:

Would it make sense to explore this in the Tulip project first?  It could be a 
new module, tulip/selector.py.  (Heck, I'll even give you commit privileges in 
Tulip.)

Also, I've heard (but don't know from personal experience) that Jython supports 
select but it takes only lists of socket objects, not file descriptors (which 
don't exist in Java).

Finally, what about Windows?

--

___
Python tracker 

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



[issue16863] Argparse tutorial outdated

2013-01-04 Thread R. David Murray

R. David Murray added the comment:

Ah, the whole tutorial is newish.  So this is a bug just in the 2.7 version of 
the tutorial (it doesn't match the 2.7 code), and yes, there may be other 
issues as well.

--

___
Python tracker 

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



[issue16863] Argparse tutorial outdated

2013-01-04 Thread R. David Murray

R. David Murray added the comment:

Actually it looks like it is future-dated.  The documented error message is the 
one you get from 3.3.  I guess someone backported a doc change for a feature 
change.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue16863] Argparse tutorial outdated

2013-01-04 Thread R. David Murray

R. David Murray added the comment:

See issue 14034.  Ezio apparently left the error messages unchanged on 
purpose...I'm not sure why.

--
assignee: docs@python -> 
nosy: +ezio.melotti, tshepang

___
Python tracker 

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



[issue16853] add a Selector to the select module

2013-01-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I've posted a review on Rietveld. Not sure the notification e-mail was sent 
since I got a weird response from the server.

> should EINTR be handled (i.e. retry, with an updated timeout). I'm tempted to 
> say
> yes, because EINTR is just a pain the user should never be exposed with.

You could add an optional argument to the select() method?

> what should be done with POLLNVAL and POLLERR? Raise an exception (that's 
> what Java 
> does, but since you can get quite quite easily it would be a pain to use), 
> return a 
> generic SELECT_ERR event?

I would say return SELECT_ERR.

> So this can be interesting when a large number of FDs are monitored.

The difference is impressive indeed.

--

___
Python tracker 

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



[issue10557] Malformed error message from float()

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Can this issue be closed?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16862] FAQ has outdated information about Stackless

2013-01-04 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue16863] Argparse tutorial outdated

2013-01-04 Thread Ezio Melotti

Ezio Melotti added the comment:

When I backported the patch I probably didn't want to try all the examples to 
see what the py2 error was.  In addition the py3 error is more clear even if it 
doesn't match what you actually get.
I think this can be closed as won't fix, unless someone wants to propose a 
patch.

--
type:  -> enhancement

___
Python tracker 

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



[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2013-01-04 Thread Jim Minter

New submission from Jim Minter:

sqlite3 doesn't populate the lastrowid member of the Cursor object when a SQL 
REPLACE statement is executed.

The following snippet doesn't work as I would expect:
cursor = db.execute("REPLACE INTO table(column) VALUES ('datum')")
print cursor.lastrowid  # prints None

The following snippet, with SQL which is in effect identical to SQLite, does 
work as expected:
cursor = db.execute("INSERT OR REPLACE INTO table(column) VALUES ('datum')")
print cursor.lastrowid  # prints some rowid

Looking at Modules/_sqlite/cursor.c, in _pysqlite_query_execute(), the 
following snippet is found:

if (!multiple && statement_type == STATEMENT_INSERT) {
Py_BEGIN_ALLOW_THREADS
lastrowid = sqlite3_last_insert_rowid(self->connection->db);
Py_END_ALLOW_THREADS
self->lastrowid = PyLong_FromLong((long)lastrowid);
} else {
Py_INCREF(Py_None);
self->lastrowid = Py_None;
}

I suggest this should read something like:
if (!multiple && (statement_type == STATEMENT_INSERT || statement_type == 
STATEMENT_REPLACE)) {
instead of:
if (!multiple && statement_type == STATEMENT_INSERT) {

Thanks,

Jim

--
components: Library (Lib)
messages: 179049
nosy: jim_minter
priority: normal
severity: normal
status: open
title: sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE 
statement
type: enhancement
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue9554] test_argparse.py: use new unittest features

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue16510.

--
nosy: +serhiy.storchaka
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue16861] Portion of code example not highlighted in collections doc

2013-01-04 Thread Ezio Melotti

Ezio Melotti added the comment:

The part that is not highlighted is not part of the code, but the output of the 
function.

--
nosy: +ezio.melotti
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue16863] Argparse tutorial outdated

2013-01-04 Thread Charlie Dimino

Charlie Dimino added the comment:

If it's okay, don't close this just yet. I'm new to this system but I'll submit 
a patch with any fixes to the tutorial I find.

--

___
Python tracker 

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



[issue16860] Use O_CLOEXEC in the tempfile module

2013-01-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 64883c614c88 by Charles-François Natali in branch 'default':
Issue #16860: In tempfile, use O_CLOEXEC when available to set the
http://hg.python.org/cpython/rev/64883c614c88

--
nosy: +python-dev

___
Python tracker 

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



[issue16860] Use O_CLOEXEC in the tempfile module

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

Charles-François Natali added the comment:

I've committed it only to default, since it's not really a bug, but rather an 
improvement (if we did consider this a "security" bug then it should also be 
backported to 2.7, 3.1, etc).

I'll wait a little before removing O_NOFOLLOW: I'm 99% sure it's useless, but 
just in case someone finds a really subtle reason to keep it...

--

___
Python tracker 

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



[issue12613] itertools fixer fails

2013-01-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +needs review
versions: +Python 3.4

___
Python tracker 

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



[issue16836] configure script disables support for IPv6 on a system where IPv6 is disabled

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

Changes by Charles-François Natali :


--
stage: needs patch -> commit review

___
Python tracker 

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



[issue16803] Make test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-01-04 Thread Ezio Melotti

Ezio Melotti added the comment:

Is the usual PEP 399 idiom enough, or is something more advanced required?

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue16748] Make CPython test package discoverable

2013-01-04 Thread Ezio Melotti

Ezio Melotti added the comment:

Feel free to add me to the nosy.

--

___
Python tracker 

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



[issue7378] unexpected truncation of traceback

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

3.1 gets only security fixes. In 2.7 and 3.2+ the bug has already fixed.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16864] sqlite3.Cursor.lastrowid isn't populated when executing a SQL REPLACE statement

2013-01-04 Thread R. David Murray

R. David Murray added the comment:

Considering that sqlite's 'replace' is a synonym for 'insert or replace', I 
think the logic error is actually in the detect_statement_type function.  Since 
actions are conditionally taken on the REPLACE statement type in the code, 
including at least one that adjusts the lastrowid, I don't think the fix for 
lastrowid is as simple as just always setting it.  But I'm not that familiar 
with sqlite internals, so perhaps someone with more knowledge will weigh in.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue8136] urllib.unquote decodes percent-escapes with Latin-1

2013-01-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
versions:  -Python 2.6

___
Python tracker 

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



[issue5066] IDLE documentation for Unix obsolete/incorrect

2013-01-04 Thread Zachary Ware

Zachary Ware added the comment:

Hi Todd, I can't commit, but I have a review in the works for you.

--
nosy: +zach.ware

___
Python tracker 

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



[issue16803] Make test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-01-04 Thread Brett Cannon

Brett Cannon added the comment:

With some tricky use of import_fresh_module() because importlib.__init__ does 
some masking trickery, it should ... I think. =)

--

___
Python tracker 

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



[issue1694663] Overloading int.__pow__ does not work

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This behavior doesn't reproduced more on 2.7 and 3.2+.

>>> class MyInt(int):
... __pow__ = int.__add__
... 
>>> i = MyInt(42)
>>> i**3
45

--
nosy: +serhiy.storchaka
resolution:  -> out of date
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16835] Update PEP 399 to allow for test discovery

2013-01-04 Thread Ezio Melotti

Ezio Melotti added the comment:

Attached a new patch.

--
Added file: http://bugs.python.org/file28562/issue16835-3.diff

___
Python tracker 

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



[issue16835] Update PEP 399 to allow for test discovery

2013-01-04 Thread Zachary Ware

Zachary Ware added the comment:

Looks good to me :)

--

___
Python tracker 

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



[issue13094] Need Programming FAQ entry for the behavior of closures

2013-01-04 Thread Ezio Melotti

Ezio Melotti added the comment:

Attached a new patch.

--
Added file: http://bugs.python.org/file28563/issue13094-2.diff

___
Python tracker 

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



[issue16799] start using argparse.Namespace in regrtest

2013-01-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks.  Andrew, could you also take a quick look at this?

--
title: switch regrtest from getopt options to argparse Namespace -> start using 
argparse.Namespace in regrtest

___
Python tracker 

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



[issue1617161] Instance methods compare equal when their self's are equal

2013-01-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue16853] add a Selector to the select module

2013-01-04 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Is this currently being written from scratch? It shouldn't be IMO.
Instead I recommend using the existent Tornado or pyftpdlib IO loop as an 
example:

https://github.com/facebook/tornado/tree/master/tornado/platform
https://github.com/facebook/tornado/blob/master/tornado/ioloop.py#L544

http://code.google.com/p/pyftpdlib/source/browse/trunk/pyftpdlib/ioloop.py?spec=svn1144&r=1135#266

...and modify the central polling method so that it returns a list of (fd, 
events) instead of calling handler methods.
Everything (except Windows support) is already in place and they have been 
tested extensively.

Exploring this into Tulip would be important IMO, as it would help figuring out 
whether the API is good enough to support what this component aims to achieve: 
being a generic poller upon which to build async IO loops.

--

___
Python tracker 

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



[issue1611154] os.path.exists("file/") failure on Solaris 9

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch need be revised for 3.3+.

--
nosy: +jcea, serhiy.storchaka
versions: +Python 3.3, Python 3.4 -Python 3.1

___
Python tracker 

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



[issue16863] Python 2 error in Argparse tutorial

2013-01-04 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
title: Argparse tutorial outdated -> Python 2 error in Argparse tutorial

___
Python tracker 

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



[issue6157] Tkinter.Text: changes for bbox, debug, and edit methods.

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
nosy: +serhiy.storchaka
stage: patch review -> commit review
versions: +Python 3.3, Python 3.4 -Python 3.1

___
Python tracker 

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



[issue4350] Remove dead code from Tkinter.py

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. However I am not sure should this issue be classified as "behavior" or 
"enhancement". Removed code is not usable in Tk versions which supported in 
Python 2.7 and 3.2+ and can be removed safely.

--
nosy: +georg.brandl, serhiy.storchaka
versions: +Python 3.3, Python 3.4 -Python 3.1

___
Python tracker 

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



[issue16853] add a Selector to the select module

2013-01-04 Thread Guido van Rossum

Guido van Rossum added the comment:

Giampaolo, there are many details in the Tornado and pyftpdlib I/O loops that 
may or may not be intentional.  I wrote the Tulip pollster from scratch but am 
looking to merge in relevant knowledge and features from Tornado, Twisted and 
pyftpdlib.  AFAIK the code here is mostly adapted from Tulip.  Please suggest 
specific features from Tornado or pyftpdlib that are currently missing.  
However I don't think we should just copy over the existing 3rd party code (if 
only because we're trying to write pure Python 3.3 code here, without 
historical baggage).

--

___
Python tracker 

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



[issue13094] Need Programming FAQ entry for the behavior of closures

2013-01-04 Thread R. David Murray

R. David Murray added the comment:

Looks good to me.

--

___
Python tracker 

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



[issue5066] IDLE documentation for Unix obsolete/incorrect

2013-01-04 Thread Todd Rovito

Todd Rovito added the comment:

Thanks much appreciated!

Sent from my iPhone

On Jan 4, 2013, at 1:07 PM, Zachary Ware  wrote:

> 
> Zachary Ware added the comment:
> 
> Hi Todd, I can't commit, but I have a review in the works for you.
> 
> --
> nosy: +zach.ware
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue16852] Fix test discovery for test_genericpath.py

2013-01-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It looks as v1.

--

___
Python tracker 

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



[issue16848] Mac OS X: python-config --ldflags and location of Python.framework

2013-01-04 Thread Ed Campbell

Changes by Ed Campbell :


--
nosy: +esc24

___
Python tracker 

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



[issue16853] add a Selector to the select module

2013-01-04 Thread Ross Lagerwall

Ross Lagerwall added the comment:

Interesting benchmark. There is no gain for epoll with a large number of
ready fds (as expected) but at least it is no worse than poll. Poll offers
a large improvement on select, in this case.

$ ./python selector_bench.py -r 2 -m 1000 -t pipe
Trying with 2 ready FDs out of 1000, type pipe

0.004317363000154728

0.08897221900042496

0.155811747055

$ ./python selector_bench.py -r 100 -m 1000 -t pipe
Trying with 100 ready FDs out of 1000, type pipe

0.1106707402169

0.18777027299984184

0.3015780589866

$ ./python selector_bench.py -r 1000 -m 1000 -t pipe
Trying with 1000 ready FDs out of 1000, type pipe

1.08963231099915

1.69247998987

8.283167362000313

--

___
Python tracker 

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



[issue16853] add a Selector to the select module

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

Charles-François Natali added the comment:

Indeed, tornado and pyftpdlib implementations are much more complex,
have somewhat different APIs (i.e. only support FDs), have special
cases for older python versions, lack some newer features (e.g.
context manager).
The current code is much close to Tulip's.

> Exploring this into Tulip would be important IMO, as it would help figuring 
> out whether the API is good enough to support what this component aims to 
> achieve: being a generic poller upon which to build async IO loops.

That's indeed a good idea, there's no need to rush this in.

--

___
Python tracker 

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



[issue16835] Update PEP 399 to allow for test discovery

2013-01-04 Thread Brett Cannon

Brett Cannon added the comment:

LGTM as well. Feel free to commit it, Ezio, or assign to me and I will commit 
it later (probably this weekend).

--
assignee:  -> eric.araujo
nosy: +eric.araujo
stage: patch review -> commit review

___
Python tracker 

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



[issue16835] Update PEP 399 to allow for test discovery

2013-01-04 Thread Ezio Melotti

Ezio Melotti added the comment:

Done in http://hg.python.org/peps/rev/3740f42d3b94, thanks for the reviews!

--
assignee: eric.araujo -> ezio.melotti
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16853] add a Selector to the select module

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

Charles-François Natali added the comment:

Ross, the select() result for a large number of ready FDs was completely skewed 
because of a bug spotted by Antoine (complexity was much worse than it ought to 
be).
Here are the results with the fix:
"""
$ ./python ~/selector_bench.py -r 10 -m 1000 -t socket
Trying with 10 ready FDs out of 1000, type socket

0.05156186099338811

0.23772043800272513

0.5181516080047004
$ ./python ~/selector_bench.py -r 100 -m 1000 -t socket
Trying with 100 ready FDs out of 1000, type socket

0.47576940699946135

0.645877062026

0.828609222000523
$ ./python ~/selector_bench.py -r 1000 -m 1000 -t socket
Trying with 1000 ready FDs out of 1000, type socket

4.970445963997918

5.7709292660001665

4.030775418999838
"""

With a large number of FDs, many of which are ready, select can be faster.
Here's the output of "strace -c -e select,poll,epoll_wait":
"""

% time seconds  usecs/call callserrors syscall
-- --- --- - - 
 83.860.000421   0  1024   epoll_wait
 16.140.81   0  1024   poll
  0.000.00   0  1024   select
-- --- --- - - 
100.000.000502  3072   total
"""

The systime is greater in epoll, but the systime is negligible, as show by 
'time':
"""

real0m14.856s
user0m14.289s
sys 0m0.340s
"""

The time is really spent in the interpreter.
I'll dig some more (even though I doubt having 1000/1000 ready FDs is a common 
use case).

Note that it doesn't change anything when a small number of FDs are ready:
"""

$ ./python ~/selector_bench.py -r 10 -m 1000 -t socket
Trying with 10 ready FDs out of 1000, type socket

0.05238822099636309

0.25595822899776977

0.5156362060006359
"""

--
Added file: http://bugs.python.org/file28564/selector-3.diff

___
Python tracker 

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



[issue16853] add a Selector to the select module

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

Changes by Charles-François Natali :


Removed file: http://bugs.python.org/file28556/selector-2.diff

___
Python tracker 

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



[issue8109] Server-side support for TLS Server Name Indication extension

2013-01-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is an updated patch with cyclic GC support, and other small things.

--
components: +Library (Lib) -Extension Modules
Added file: http://bugs.python.org/file28565/sni.patch

___
Python tracker 

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



[issue8109] Server-side support for TLS Server Name Indication extension

2013-01-04 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file28565/sni.patch

___
Python tracker 

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



[issue8109] Server-side support for TLS Server Name Indication extension

2013-01-04 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file28566/sni.patch

___
Python tracker 

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



[issue16865] ctypes arrays >=2GB in length causes exception

2013-01-04 Thread Jeffrey Bush

New submission from Jeffrey Bush:

The environment is Windows 8 Pro 64-bit running Python 64-bit in the WinPython 
distribution. Python is v2.7.3 built on Apr 10 2012. I first found this with 
create_string_buffer however I found out that it happens with an even simpler 
example.

The following code throws an AttributeException: class must define a _length_ 
attribute, which must be a positive integer.

import ctypes
c_char * int(2*1024*1024*1024) # 2GB, also fails with long() instead of int()

However the following works

import ctypes
c_char * int(2*1024*1024*1024-1) # 1 byte less than 2GB


This is the same with the other c_ types (not limited to size of memory since 
c_int * int(2*1024*1024*1024-1) works and would be nearly 4 times the size of 
the failed c_char one).

--
components: ctypes
messages: 179080
nosy: coderforlife
priority: normal
severity: normal
status: open
title: ctypes arrays >=2GB in length causes exception
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue16852] Fix test discovery for test_genericpath.py

2013-01-04 Thread Zachary Ware

Zachary Ware added the comment:

My apologies, I seem to have managed to rename the wrong file...

Here's the real v2 as v3, with the TestGenericTest comment pointing to this 
issue instead of 16748.

--
Added file: http://bugs.python.org/file28567/issue16852.v3.diff

___
Python tracker 

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



[issue14187] add "function annotation" entry to Glossary

2013-01-04 Thread Zachary Ware

Changes by Zachary Ware :


--
versions: +Python 3.4

___
Python tracker 

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



[issue16853] add a Selector to the select module

2013-01-04 Thread Ross Lagerwall

Ross Lagerwall added the comment:

> Ross, the select() result for a large number of ready FDs was
> completely skewed because of a bug spotted by Antoine (complexity
> was much worse than it ought to be).

Ah, that makes a little more sense now.

--

___
Python tracker 

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



[issue16865] ctypes arrays >=2GB in length causes exception

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

Martin v. Löwis added the comment:

Would you like to investigate a patch?

--
nosy: +loewis

___
Python tracker 

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



[issue16865] ctypes arrays >=2GB in length causes exception

2013-01-04 Thread Ezio Melotti

Ezio Melotti added the comment:

Note that adding support for >2GB arrays is a new feature and therefore can't 
go in 2.7 (but it would be OK for 3.4+).  The error message could be improved 
though.

--
nosy: +amaury.forgeotdarc, belopolsky, ezio.melotti, meador.inge

___
Python tracker 

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



[issue16865] ctypes arrays >=2GB in length causes exception

2013-01-04 Thread Jeffrey Bush

Jeffrey Bush added the comment:

I have no idea where I would start and don't have much time...

I am not so sure it is a new features. It seems that the ctypes system is 
internally using unsigned integers for length but should be using size_t (or at 
least ssize_t). Seems like a bug.

--

___
Python tracker 

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



  1   2   >