[issue16594] SocketServer should set SO_REUSEPORT along with SO_REUSEADDR when present

2012-12-02 Thread Andy Zeldis

New submission from Andy Zeldis:

On BSD (including Mac OS X) SO_REUSEPORT should be specified along with 
SO_REUSEADDR to match behavior on Linux (and possible Windows). This is needed 
to have multiple listeners to a UDP broadcast.

I discovered this when using PyOSC. Attached is an example modified to subclass 
SocketServer with a workaround. It should be possible to start multiple 
instances of this program, all of which will receive messages to a broadcast 
address (eg 255.255.255.255:7110).

This test uses Python 2.7 on OS X (despite the "python3" shebang line from the 
example)

--
components: Library (Lib)
files: osc-broadcast-rcv.py
messages: 176777
nosy: Andy.Zeldis
priority: normal
severity: normal
status: open
title: SocketServer should set SO_REUSEPORT along with SO_REUSEADDR when present
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file28183/osc-broadcast-rcv.py

___
Python tracker 

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



[issue16592] stringlib_bytes_join doesn't raise MemoryError on allocation failure

2012-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I wonder why I don't see a memory error in Python 3.3 or earlier. Any idea?

See issue #15958. Now join() accept arbitrary buffer objects, which can be 
modified during iteration, and therefore need a temporary list of Py_buffers.

--
nosy: +serhiy.storchaka
status: pending -> open

___
Python tracker 

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



[issue16592] stringlib_bytes_join doesn't raise MemoryError on allocation failure

2012-12-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Antoine, on Unix you can restrict the address space of a program to
> test the issue without almost crashing and OOMing your box. ;)

Ah, thanks, but I didn't crash and OOM it, since it has no swap: memory errors 
get raised quickly here :)

--

___
Python tracker 

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



[issue11908] Weird `slice.stop or sys.maxint`

2012-12-02 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue13555] cPickle MemoryError when loading large file (while pickle works)

2012-12-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
stage:  -> needs patch

___
Python tracker 

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



[issue10640] SystemError on pickling bytes >= 4GB

2012-12-02 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



[issue16592] stringlib_bytes_join doesn't raise MemoryError on allocation failure

2012-12-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: needs patch -> 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



[issue16585] surrogateescape broken w/ multibytecodecs' encode

2012-12-02 Thread Walter Dörwald

Walter Dörwald added the comment:

And returning bytes is documented in PEP 383, as an extension to the PEP 293 
machinery:

"""To convert non-decodable bytes, a new error handler ([2]) "surrogateescape" 
is introduced, which produces these surrogates. On encoding, the error handler 
converts the surrogate back to the corresponding byte. This error handler will 
be used in any API that receives or produces file names, command line 
arguments, or environment variables.

The error handler interface is extended to allow the encode error handler to 
return byte strings immediately, in addition to returning Unicode strings which 
then get encoded again (also see the discussion below)."""

--
nosy: +doerwalter

___
Python tracker 

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



[issue11344] Add os.path.splitpath(path) function

2012-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

splitpath() should be equivalent to followed code (but be non-recursive and 
more effective):

def splitpath(path):
head, tail = split(path)
if head == path:
return [head]
else:
return splitpath(head) + [tail]

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue11344] Add os.path.splitpath(path) function

2012-12-02 Thread Serhiy Storchaka

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



[issue10182] match_start truncates large values

2012-12-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks for the patch. For the record, the test passes successfully but it needs 
40 GB, not 4 GB:
http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%20bigmem%20custom/builds/3

--

___
Python tracker 

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



[issue16595] Add resource.prlimit

2012-12-02 Thread Christian Heimes

New submission from Christian Heimes:

Linux has an additional function to setrlimit and getrlimit which supports to 
query and/or modify resource limits of another process.

http://www.kernel.org/doc/man-pages/online/pages/man2/getrlimit.2.html

The patch implements resource.prlimit(pid, resource[, limits]) on all platforms 
that have a prlimit() function. I haven't included the regenerated configure 
script. You have to run autoreconf in order to test the new function.

--
assignee: christian.heimes
components: Extension Modules
files: prlimit.patch
keywords: patch
messages: 176783
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: Add resource.prlimit
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file28184/prlimit.patch

___
Python tracker 

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



[issue10052] Python/dtoa.c:158: #error "Failed to find an exact-width 32-bit integer type" (FreeBSD 4.11 + gcc 2.95.4)

2012-12-02 Thread Mark Dickinson

Mark Dickinson added the comment:

Here's a patch (against the default branch).  It adds simple AC_CHECK_TYPE 
configure-time typechecks for uint32_t and friends.

--
Added file: http://bugs.python.org/file28185/issue10052.patch

___
Python tracker 

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



[issue16595] Add resource.prlimit

2012-12-02 Thread Christian Heimes

Christian Heimes added the comment:

prlimit() needs glibc 2.13+ (thanks Arfrever).

--

___
Python tracker 

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



[issue10182] match_start truncates large values

2012-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0edc92d78192 by Antoine Pitrou in branch '3.2':
Issue #10182: The re module doesn't truncate indices to 32 bits anymore.
http://hg.python.org/cpython/rev/0edc92d78192

New changeset 21ceee08a375 by Antoine Pitrou in branch '3.3':
Issue #10182: The re module doesn't truncate indices to 32 bits anymore.
http://hg.python.org/cpython/rev/21ceee08a375

New changeset e7104cc09d02 by Antoine Pitrou in branch 'default':
Issue #10182: The re module doesn't truncate indices to 32 bits anymore.
http://hg.python.org/cpython/rev/e7104cc09d02

--
nosy: +python-dev

___
Python tracker 

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



[issue10182] match_start truncates large values

2012-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset de0f38f9280e by Antoine Pitrou in branch '2.7':
Issue #10182: The re module doesn't truncate indices to 32 bits anymore.
http://hg.python.org/cpython/rev/de0f38f9280e

--

___
Python tracker 

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



[issue10182] match_start truncates large values

2012-12-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


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



[issue16585] surrogateescape broken w/ multibytecodecs' encode

2012-12-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee: docs@python -> 
components: +Library (Lib) -Documentation, Interpreter Core, Unicode

___
Python tracker 

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



[issue10052] Python/dtoa.c:158: #error "Failed to find an exact-width 32-bit integer type" (FreeBSD 4.11 + gcc 2.95.4)

2012-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6f9aba5f8d32 by Mark Dickinson in branch 'default':
Issue 10052: fix failed uint32_t / uint64_t / int32_t / int64_t detection on 
some platforms.
http://hg.python.org/cpython/rev/6f9aba5f8d32

--
nosy: +python-dev

___
Python tracker 

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



[issue10052] Python/dtoa.c:158: #error "Failed to find an exact-width 32-bit integer type" (FreeBSD 4.11 + gcc 2.95.4)

2012-12-02 Thread Mark Dickinson

Mark Dickinson added the comment:

Committed to default.  I want to look at the buildbot results and try some 
manual snakebite tests before deciding whether to backport.

--

___
Python tracker 

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



[issue10052] Python/dtoa.c:158: #error "Failed to find an exact-width 32-bit integer type" (FreeBSD 4.11 + gcc 2.95.4)

2012-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 48fbe78167cd by Mark Dickinson in branch '2.7':
Issue 10052: fix failed uint32_t / uint64_t / int32_t / int64_t detection on 
some platforms.
http://hg.python.org/cpython/rev/48fbe78167cd

--

___
Python tracker 

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



[issue10052] Python/dtoa.c:158: #error "Failed to find an exact-width 32-bit integer type" (FreeBSD 4.11 + gcc 2.95.4)

2012-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d82b73366227 by Mark Dickinson in branch '3.2':
Issue 10052: fix failed uint32_t / uint64_t / int32_t / int64_t detection on 
some platforms.
http://hg.python.org/cpython/rev/d82b73366227

New changeset 48de792747dc by Mark Dickinson in branch '3.3':
Issue 10052: merge fix from 3.2.
http://hg.python.org/cpython/rev/48de792747dc

New changeset 22d891a2d533 by Mark Dickinson in branch 'default':
Issue 10052: null merge from 3.3
http://hg.python.org/cpython/rev/22d891a2d533

--

___
Python tracker 

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



[issue10052] Python/dtoa.c:158: #error "Failed to find an exact-width 32-bit integer type" (FreeBSD 4.11 + gcc 2.95.4)

2012-12-02 Thread Mark Dickinson

Mark Dickinson added the comment:

Fixed in all branches.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue12812] libffi does not build with clang on amd64

2012-12-02 Thread koobs

koobs added the comment:

This is also an issue for clang builds of Python on FreeBSD and results in the 
_ctypes extension failing to compile (See: koobs-freebsd-clang buildbot)

The original mozilla patch (see References below) did not make it into the 
libffi 3.0.11 release, which has already been committed to the Cpython tree 
(see #15194)

Attached here is the original Mozilla patch to configure & configure.ac which I 
have included in a PR submitted to the FreeBSD ports tree for python27

The PR includes test builds with gcc and clang on multiple FreeBSD versions and 
architectures, along with a libffi unit test run with clang 
(http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/171768)

I propose this patch be committed to all branches to re-enable _ctypes 
extension builds with clang.

References:

- http://www.cygwin.com/ml/libffi-discuss/2011/msg00024.html
- https://bugzilla.mozilla.org/show_bug.cgi?id=631928
- https://github.com/atgreen/libffi/issues/21
- https://bugs.gentoo.org/show_bug.cgi?id=417179
- http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/171768

--
keywords: +patch
nosy: +koobs
Added file: http://bugs.python.org/file28186/libffi-3.0.11-clang.patch

___
Python tracker 

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



[issue12812] libffi does not build with clang on amd64

2012-12-02 Thread koobs

koobs added the comment:

Correction, the PR mentioned in the previous comment has been submitted for 
devel/libffi in the FreeBSD ports tree (update from 3.0.9 -> 3.0.11), not 
lang/python27

--

___
Python tracker 

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



[issue16556] Update string.Formatter.vformat documentation to say "**kwargs"

2012-12-02 Thread Taavi Burns

Taavi Burns added the comment:

Ah, yes, I could have been more clear that I wasn't even looking at the source 
code itself. :)

Thanks!

--
resolution: fixed -> 
status: closed -> open
versions:  -Python 3.2, Python 3.4

___
Python tracker 

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



[issue16556] Update string.Formatter.vformat documentation to say "**kwargs"

2012-12-02 Thread Taavi Burns

Taavi Burns added the comment:

Gak, sorry, didn't mean to change the status and resolution!

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue16416] Mac OS X: don't use the locale encoding but UTF-8 to encode and decode filenames

2012-12-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ping.

--

___
Python tracker 

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



[issue16585] surrogateescape broken w/ multibytecodecs' encode

2012-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5c88c72dec60 by Benjamin Peterson in branch '3.3':
support encoding error handlers that return bytes (closes #16585)
http://hg.python.org/cpython/rev/5c88c72dec60

New changeset 2181c37977d3 by Benjamin Peterson in branch 'default':
merge 3.3 (#16585)
http://hg.python.org/cpython/rev/2181c37977d3

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> 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



[issue16585] surrogateescape broken w/ multibytecodecs' encode

2012-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 777aabdff35a by Benjamin Peterson in branch '3.3':
document that encoding error handlers may return bytes (#16585)
http://hg.python.org/cpython/rev/777aabdff35a

--

___
Python tracker 

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



[issue11908] Weird `slice.stop or sys.maxint`

2012-12-02 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: normal -> low

___
Python tracker 

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



[issue16579] .pyw disturb multiprocessing behavior

2012-12-02 Thread Richard Oudkerk

Changes by Richard Oudkerk :


--
nosy: +sbt

___
Python tracker 

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



[issue11908] Weird `slice.stop or sys.maxint`

2012-12-02 Thread Raymond Hettinger

Raymond Hettinger added the comment:

ysj:  The "equivalent" means "roughly equivalent" not "precisely equivalent".  
The purpose of the code in the docs is to help communicate what islice() is all 
about.  Practicality beats purity in this regard.  I know of no one who has 
ever been mislead by the islice() docs.

I don't really like the proposed patch -- it improves a bit on technical 
accuracy but forgoes readability and still falls short on what stop=None does 
and on which arguments are required.  

That said, I don't really like the current version of the "roughly equivalent 
code either".  It should probably be rewritten completely (no longer using 
slice() and it should show the actual looping logic.  For clarity, it may be 
helpful to split it into two code-equivalents, one for the finite case (where 
stop is specified) and one for the infinite case (where stop is None).  

As it stands, the examples are beating the code equivalent when it comes to 
communicating what islice() does.  I don't want to lengthen the code fragment 
unless it becomes *both* more communicative and more accurate.

--

___
Python tracker 

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



[issue16562] Optimize dict equality test

2012-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d12785ecca72 by Antoine Pitrou in branch 'default':
Issue #16562: Optimize dict equality testing.
http://hg.python.org/cpython/rev/d12785ecca72

--
nosy: +python-dev

___
Python tracker 

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



[issue16562] Optimize dict equality test

2012-12-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> The patch looks correct.  If the tests pass, go ahead and apply it.

Done.

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



[issue4844] ZipFile doesn't range check in _EndRecData()

2012-12-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

In test_damaged_zipfile:

+for N in range(len(s) - 2):
+with open(TESTFN, "wb") as f:
+f.write(s[:N])

why not `range(len(s))` instead?

--
nosy: +pitrou

___
Python tracker 

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



[issue6744] calling kevent repr raises a TypeError

2012-12-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thank you, Berker. I'm now closing the issue.

--
assignee: christian.heimes -> 
nosy: +pitrou
resolution:  -> out of date
stage:  -> committed/rejected
status: open -> closed
superseder:  -> select module - kevent ident field 64 bit issue

___
Python tracker 

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



[issue15727] PyType_FromSpecWithBases tp_new bugfix

2012-12-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Robin, do you remember which extension types were affected by this issue?

--
nosy: +pitrou
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue16594] SocketServer should set SO_REUSEPORT along with SO_REUSEADDR when present

2012-12-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +skrah

___
Python tracker 

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



[issue16525] wave file module does not support 32bit float format

2012-12-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +mark.dickinson
stage:  -> patch review

___
Python tracker 

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



[issue16587] Py_Initialize breaks wprintf on Windows

2012-12-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo

___
Python tracker 

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



[issue13120] Default nosigint option to pdb.Pdb() prevents use in non-main thread

2012-12-02 Thread icemac

icemac added the comment:

This bug bites me when developing with Pyramid using Python 3.2.
I'd like to get it solved generally as the patch works for me (Python 3.2.3)).

What needs to be done to get this patch into the version control system?

--
nosy: +icemac

___
Python tracker 

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



[issue11344] Add os.path.splitpath(path) function

2012-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The proposed patch adds effective implementations of mentioned above algorithm.

splitpath() can be used for consecutive implementation of relpath() and 
commonpath().

--
stage:  -> patch review

___
Python tracker 

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



[issue11344] Add os.path.splitpath(path) function

2012-12-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file28187/ospath_splitpath.patch

___
Python tracker 

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



[issue14621] Hash function is not randomized properly

2012-12-02 Thread Bob Ziuchkovski

Bob Ziuchkovski added the comment:

Why not redefine -R to mean "use secure hashing algorithms for built-in types"?

When specified, use hashing algorithms that are secure against 
denial-of-service and other known attacks, at the possible expense of 
performance.  When not specified, use whatever hashing algorithms provide the 
most sensible defaults for every-day use (basically hash the way python 
currently hashes).

Secure hashing would apply not just to strings but to numeric and other types 
as well.  This would break the invariant of `x == y implies hash(x) == hash(y)` 
for numeric types that Mark mentioned.  However, that seems like an 
implementation detail that python users shouldn't rely upon.

--
nosy: +Bob.Ziuchkovski

___
Python tracker 

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



[issue4844] ZipFile doesn't range check in _EndRecData()

2012-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I just copy it from Alan's test. Actually this is not needed, `range(len(s))` 
can be used.

--

___
Python tracker 

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



[issue8821] Range check on unicode repr

2012-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This patch is not needed for 3.3+. And for 2.7 and 3.2 it actually doesn't fix 
any bug in the current code.

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

___
Python tracker 

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2012-12-02 Thread Nadeem Vawda

Nadeem Vawda added the comment:

I've tried reimplementing LZMAFile in terms of the decompress_into()
method, and it has ended up not being any faster than the existing
implementation. (It is _slightly_ faster for readinto() with a large
buffer size, but all other cases it was either of equal performance or
significantly slower.)

In addition, decompress_into() is more complicated to work with than I
had expected, so I withdraw my objection to the approach based on
max_length/unconsumed_tail.


> unconsumed_tail should be private hidden attribute, which automatically 
> prepends any consumed data.

I don't think this is a good idea. In order to have predictable memory
usage, the caller will need to ensure that the current input is fully
decompressed before passing in the next block of compressed data. This
can be done more simply with the interface used by zlib. Compare:

while not d.eof:
output = d.decompress(b'', 8192)
if not output:
compressed = f.read(8192)
if not compressed:
raise ValueError('End-of-stream marker not found')
output = d.decompress(compressed, 8192)
# 

with:

# Using zlib's interface
while not d.eof:
compressed = d.unconsumed_tail or f.read(8192)
if not compressed:
raise ValueError('End-of-stream marker not found')
output = d.decompress(compressed, 8192)
# 


A related, but orthogonal proposal: We might want to make unconsumed_tail
a memoryview (provided the input data is know to be immutable), to avoid
creating an unnecessary copy of the data.

--

___
Python tracker 

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



[issue11204] re module: strange behaviour of space inside {m, n}

2012-12-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Library (Lib), Regular Expressions
nosy: +mrabarnett
type:  -> behavior
versions: +Python 3.2, 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



[issue13120] Default nosigint option to pdb.Pdb() prevents use in non-main thread

2012-12-02 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue11204] re module: strange behaviour of space inside {m, n}

2012-12-02 Thread Matthew Barnett

Matthew Barnett added the comment:

Interesting.

In my regex module (http://pypi.python.org/pypi/regex) I have:

bool(regex.match(pat, "bb", regex.VERBOSE)) # True
bool(regex.match(pat, "b{1,3}", regex.VERBOSE)) # False

because I thought that when the VERBOSE flag is turned on it should ignore 
whitespace except when it's inside a character class, so "b{1, 3}" would be 
treated as "b{1,3}".

Apparently re has another exception.

--

___
Python tracker 

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



[issue11204] re module: strange behaviour of space inside {m, n}

2012-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

$ echo 'baaa' | grep -o 'b\{1,3\}a'
bbba
$ echo 'baaa' | grep -o 'b\{1, 3\}a'
grep: Invalid content of \{\}
$ echo 'baaa' | egrep -o 'b{1,3}a'
bbba
$ echo 'baaa' | egrep -o 'b{1, 3}a'
$ echo 'bbb{1, 3}aa' | LC_ALL=C egrep -o 'b{1, 3}a'
b{1, 3}a

I.e. grep raises error and egrep chooses silent verbatim meaning. I don't know 
what any standards say about this.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue210599] bug (Incorrect signal processing) - Python 1.5.2 (PR#102)

2012-12-02 Thread Nurhusien Hasen

Nurhusien Hasen added the comment:

Find public sheard Admenstartion bug python serves

--
hgrepos: +163
nosy: +Nurhusien2
versions: +Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file28188/ipython07_pe-gr_cise.pdf

___
Python tracker 

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



[issue10631] ZipFile and current directory change

2012-12-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Library (Lib)
nosy: +serhiy.storchaka
versions: +Python 2.7, Python 3.2, 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



[issue10040] GZipFile failure on large files

2012-12-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16049] Create abstract base classes by inheritance rather than a direct invocation of __metaclass__

2012-12-02 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue16596] Skip stack unwinding when "next", "until" and "return" pdb commands executed

2012-12-02 Thread Andrew Svetlov

New submission from Andrew Svetlov:

GvR in http://mail.python.org/pipermail/python-ideas/2012-November/017991.html 
has requested for improving pdb to jump over yield instead of following it.

--
components: Library (Lib)
messages: 176815
nosy: asvetlov, gvanrossum
priority: normal
severity: normal
status: open
title: Skip stack unwinding when "next",  "until" and "return" pdb commands 
executed
type: enhancement
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



[issue16597] close not being called with context manager on IOError when device is full.

2012-12-02 Thread John-John Tedro

New submission from John-John Tedro:

In 3.2.2 and 3.2.3 on linux64, when running the following code. 

try:
print("Writing to /dev/full")

with open("/dev/full", "w") as f:
 f.write("Write to full device")
except:
print("Catch, file closed?")

Using

strace -e close ~/usr/python3.2.3/bin/python3 test.py
...
Writing to /dev/full
Catch, file closed?
close(3)= 0

The file descriptor being used (3) to attempt writing to /dev/full is not 
closed until the process exits.

I expected this to be closed when leaving the context manager.

--
components: IO
messages: 176816
nosy: udoprog
priority: normal
severity: normal
status: open
title: close not being called with context manager on IOError when device is 
full.
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-02 Thread John-John Tedro

Changes by John-John Tedro :


--
title: close not being called with context manager on IOError when device is 
full. -> file descriptor not being closed with context manager on IOError when 
device is full

___
Python tracker 

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



[issue16596] Skip stack unwinding when "next", "until" and "return" pdb commands executed

2012-12-02 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Patch attached.
It modifies "next", "return" and "until" commands behavior when they are 
executed if current debugged function is generator.
1. "next" skips stack unwindind if yield tries to follow it. Now it goes just 
to next executed line.
2. "until" does the same: skips all yields until target is reached.
3. "return" waits to return *from* generator (by explicit or implicit 
StopIteration or GeneratorExit exception) ignoring following yields inside 
generator.

--
keywords: +patch
Added file: http://bugs.python.org/file28189/issue16596.diff

___
Python tracker 

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



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-02 Thread John-John Tedro

John-John Tedro added the comment:

Originally discovered on 
http://stackoverflow.com/questions/13649330/what-happens-to-file-descriptors-in-python-3-when-close-fails

--

___
Python tracker 

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



[issue16596] Skip stack unwinding when "next", "until" and "return" pdb commands executed in generator context

2012-12-02 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
title: Skip stack unwinding when "next",  "until" and "return" pdb commands 
executed -> Skip stack unwinding when "next",  "until" and "return" pdb 
commands executed in generator context

___
Python tracker 

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



[issue11204] re module: strange behaviour of space inside {m, n}

2012-12-02 Thread Matthew Barnett

Matthew Barnett added the comment:

The question is whether re should always treat 'b{1, 3}a' as a literal, even 
with the VERBOSE flag.

I've checked with Perl 5.14.2, and it agrees with re: adding a space _always_ 
makes it a literal, even with the 'x' flag (/b{1, 3}a/x is treated as 
/b\{1,3}a/).

--

___
Python tracker 

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



[issue9674] make install DESTDIR=/home/blah fails when the prefix specified is /

2012-12-02 Thread Ron Hubbard

Ron Hubbard added the comment:

George.Peristerakis' patch works

please apply

--

___
Python tracker 

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



[issue16434] SocketServer call shutdown in the wrong way

2012-12-02 Thread Andrew Svetlov

Andrew Svetlov added the comment:

request should be socket.socket instance which definitely has shutdown method 
accepting socket.SHUT_WR.
I guest the problem not in stdlib but in your code or maybe in the Paste (I'm 
not familiar with it, sorry).

--

___
Python tracker 

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



[issue16434] SocketServer call shutdown in the wrong way

2012-12-02 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
stage: needs patch -> test needed

___
Python tracker 

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



[issue13120] Default nosigint option to pdb.Pdb() prevents use in non-main thread

2012-12-02 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Uploaded updated cumulative patch.

Can we apply the patch to 3.2 or at least to 3.3?

I see nothing wrong with it, but I'm ok with pushing to 3.4 only if we want to 
be extra careful.

--
assignee:  -> asvetlov
versions: +Python 3.4
Added file: http://bugs.python.org/file28190/issue13120.txt

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-12-02 Thread Andrew Svetlov

Andrew Svetlov added the comment:

After trying to make patch I've realized — better to leave current behavior as 
is and change documentation only.

--

___
Python tracker 

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



[issue16598] Docs: double newlines printed in some file iteration examples

2012-12-02 Thread Steven Kryskalla

New submission from Steven Kryskalla:

I heard someone complain about this code appearing in the official 
documentation in a few places:

for line in open("file.txt"):
print(line)

This code will print two newlines.

I went through the current "default" and "2.7" branches and changed the places 
where this occurred to use print(line, end="") for 3.x or "print line," for 2.x.

r80699.patch is for the "default" branch (3.x)
r80694.py27.patch is for the "2.7" branch

--
assignee: docs@python
components: Documentation
files: r80699.patch
hgrepos: 164
keywords: patch
messages: 176824
nosy: docs@python, lost-theory
priority: normal
severity: normal
status: open
title: Docs: double newlines printed in some file iteration examples
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file28191/r80699.patch

___
Python tracker 

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



[issue16598] Docs: double newlines printed in some file iteration examples

2012-12-02 Thread Steven Kryskalla

Changes by Steven Kryskalla :


--
versions: +Python 2.7
Added file: http://bugs.python.org/file28192/r80699.patch

___
Python tracker 

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



[issue16598] Docs: double newlines printed in some file iteration examples

2012-12-02 Thread Steven Kryskalla

Changes by Steven Kryskalla :


Removed file: http://bugs.python.org/file28192/r80699.patch

___
Python tracker 

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



[issue16598] Docs: double newlines printed in some file iteration examples

2012-12-02 Thread Steven Kryskalla

Changes by Steven Kryskalla :


Added file: http://bugs.python.org/file28193/r80694.py27.patch

___
Python tracker 

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



[issue16581] define "PEP editor" in PEP 1

2012-12-02 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Attaching proposed patch.

The patch also makes some minor stylistic improvements and typo fixes (e.g. 
s/work flow/workflow/, s/we/the PEP editors/, and eliminating trailing 
whitespace on a few lines).

--
keywords: +patch
Added file: http://bugs.python.org/file28194/issue-16581-1.patch

___
Python tracker 

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



[issue16581] define "PEP editor" in PEP 1

2012-12-02 Thread Ezio Melotti

Ezio Melotti added the comment:

+PEP editorship is by invitation of the current editors.  The address
+ is a mailing list consisting of PEP editors.

The "consisting" doesn't sound too well to me, maybe "reserved to"?

+PEP-related email should be sent to this address (no cross-posting please).

emails?

--
nosy: +ezio.melotti
stage:  -> patch review

___
Python tracker 

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



[issue16581] define "PEP editor" in PEP 1

2012-12-02 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> The "consisting" doesn't sound too well to me, maybe "reserved to"?

"Reserved for" sounds good to me.  Originally I was thinking of "limited to" or 
"restricted to," but that had a connotation of exclusivity I wanted to avoid.

--

___
Python tracker 

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



[issue16587] Py_Initialize breaks wprintf on Windows

2012-12-02 Thread STINNER Victor

STINNER Victor added the comment:

_setmode(self->fd, O_BINARY) change was done in Python 3.2: see the issue 
#10841. This change introduced regressions:

 - #11272: "input() has trailing carriage return on windows", fixed in Python 
3.2.1
 - #11395: "print(s) fails on Windows with long strings", fixed in Python 3.2.1
 - #13119: "Newline for print() is \n on Windows, and not \r\n as expected", 
fixed in Python 3.3 (and will be fixed in Python 3.2.4)

In Python 3.1, _setmode(self->fd, O_BINARY) was already used when Python is 
called with the -u command line option.

_setmode() supports different options:

 - _O_BINARY: no conversion
 - _O_TEXT: translate "\n" with "\r\n"
 - _O_U8TEXT: UTF-8 without BOM
 - _O_U16TEXT: UTF-16 without BOM
 - _O_WTEXT: UTF-16 with BOM

I didn't try wprintf(). This function is not used in the Python source code 
(except in the Windows launcher, which is not part of the main interpreter).

I don't know how to fix wprintf().

--

___
Python tracker 

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



[issue11175] allow argparse FileType to accept encoding and errors arguments

2012-12-02 Thread Lucas Maystre

Lucas Maystre added the comment:

As per Ezio's comment, changed "l1" to "utf-8" in the example of the doc.

--
Added file: http://bugs.python.org/file28195/filetype11175.patch

___
Python tracker 

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



[issue16587] Py_Initialize breaks wprintf on Windows

2012-12-02 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue9674] make install DESTDIR=/home/blah fails when the prefix specified is /

2012-12-02 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-02 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue16049] Create abstract base classes by inheritance rather than a direct invocation of __metaclass__

2012-12-02 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2012-12-02 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue10631] ZipFile and current directory change

2012-12-02 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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