[issue23512] The list of built-in functions is not alphabetical on https://docs.python.org/2/library/functions.html

2015-03-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

 It would be disconcerting if you went to this page looking for a builtin [and 
 had trouble finding it]

I agree with this premise.  Since Idle, and I presume other IDEs, color code 
apply, coerce, intern, and buffer as builtins indistinguishably from all the 
others, these 4 should somehow be easy to find in or just below the rest.  I 
have no particular opinion on the best way to do so.

--

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



[issue23512] The list of built-in functions is not alphabetical on https://docs.python.org/2/library/functions.html

2015-03-02 Thread Carlo Beccarini

Changes by Carlo Beccarini hackdiablo...@gmail.com:


Added file: http://bugs.python.org/file38307/functions.rst

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



[issue21342] multiprocessing RLock and Lock raise incorrect exceptions when releasing an unlocked lock.

2015-03-02 Thread Davin Potts

Davin Potts added the comment:

The discussion in issue23484 is leading to a recommendation that the docs be 
changed to reflect the actual behavior of multiprocessing's Lock and its close 
relatives.

As far back as 2.6.9, calling release() on an unlocked threading.Lock triggered 
a thread.error Exception whereas doing the same on multiprocessing.Lock 
triggered a ValueError.  This discrepancy in the behavior of Lock between 
modules turns out to not be a recent development.

If issue23484 moves forward with changing the documentation to reflect reality, 
this issue would be addressed as well.

--
dependencies: +SemLock acquire() keyword arg 'blocking' is invalid
nosy: +davin

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



[issue23512] The list of built-in functions is not alphabetical on https://docs.python.org/2/library/functions.html

2015-03-02 Thread Edward D'Souza

Edward D'Souza added the comment:

I think putting them in a separate table is good, but I think it makes more 
sense to appear right below the existing table at the top of the page. For 
better or worse, these non-essential functions are still builtins in Python 2.

It would be disconcerting if you went to this page looking for a builtin (eg. 
coerce) and couldn't find it at the top of the page with the other builtins.

Above all, the list of builtins should be accurate as to what builtins 
actually exist in Python 2.

--

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



[issue23505] Urlparse insufficient validation leads to open redirect

2015-03-02 Thread Yassine ABOUKIR

Yassine ABOUKIR added the comment:

For your information, this security issue has been assigned a CVE ID : 
CVE-2015-2104

--

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



[issue23505] Urlparse insufficient validation leads to open redirect

2015-03-02 Thread Yassine ABOUKIR

Yassine ABOUKIR added the comment:

Yes, exploiting this bug an attacker may redirect a specific vitim to a 
malicious website, in our case evil.com

 x = urlparse(evil.com)

///evil.com will be parsed as relative-path URL which is the correct expected 
behaviour

 print x
 ParseResult(scheme='', netloc='', path='//evil.com', params='', query='', 
 fragment='')

As you see two slashes are removed and it is marked as a relative-path URL but 
when we reconstruct the URL using urlunparse() function, the URL is treated as 
an absolute URL to which you will be redirected.

 x = urlunparse(urlparse(evil.com))
 urlparse(x)
ParseResult(scheme='', netloc='evil.com', path='', params='', query='', 
fragment='')

--

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



[issue21619] Cleaning up a subprocess with a broken pipe

2015-03-02 Thread Akira Li

Akira Li added the comment:

On Windows behavior
http://stackoverflow.com/questions/23688492/oserror-errno-22-invalid-argument-in-subprocess

--
nosy: +akira

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



[issue23567] os.stat() tuple access vs named attribute access int vs float

2015-03-02 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I missed that because i was looking for it to be called out under 2.7 os.stat() 
docs rather than under 2.7's os.stat_float_times() which is a method nobody is 
likely to read the documentation for as floats have been the default since 2.5.

The 2.7 docs are much less organized around this than the 3.x.

Adding that note in the same paragraph on 2.7's os.stat() docs would be 
sufficient.

For backward compatibility, the return value of stat() is also accessible as a 
tuple of at least 10 integers implies it, but doesn't explicitly call out the 
integer [ST_XXX] vs float .st_xxx difference as adding that sentence does.

--
versions:  -Python 3.4, Python 3.5

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



[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-02 Thread STINNER Victor

New submission from STINNER Victor:

Currently, functions of the faulthandler module require a file-like object 
(with a fileno() method). It would be nice to accept also file descriptors 
(int).

Example of code using faulthandler which creates an useless file object just to 
pass a file descriptor:
https://github.com/nicoddemus/pytest-faulthandler/blob/master/pytest_faulthandler.py#L13

--
keywords: easy
messages: 237091
nosy: haypo
priority: normal
severity: normal
status: open
title: RFE: faulthandler.register() should support file descriptors
versions: Python 3.5

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



[issue23566] RFE: faulthandler.register() should support file descriptors

2015-03-02 Thread STINNER Victor

STINNER Victor added the comment:

Only faulthandler_get_fileno() should be modified, but a new unit test should 
be added.

--

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



[issue23567] os.stat() tuple access vs named attribute access int vs float

2015-03-02 Thread Gregory P. Smith

New submission from Gregory P. Smith:

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
 import os, stat
 os.stat('/')
posix.stat_result(st_mode=16877, st_ino=2, st_dev=64513L, st_nlink=29, 
st_uid=0, st_gid=0, st_size=4096, st_atime=1425341751, st_mtime=1424824650, 
st_ctime=1424824650)
 x =os.stat('/')
 x.st_mtime
1424824650.653934
 x[stat.ST_MTIME]
1424824650
 os.stat_result
type 'posix.stat_result'


I have also confirmed the same behavior in 3.4.2.

This may be intentional.  Tuple [stat.ST_XXX] access to the stat return value 
is the old legacy way to access these prior to Python 2.2 when the stat_result 
object was introduced.  At that point they were likely all ints.

The os.stat_float_times() API exists to change the behavior of stat_result 
objects to return ints instead of floats by default, but the behavior of the 
tuple indexed values is always ints.

We need to explicitly document this behavior difference.  Changing the legacy 
tuple indexing behavior to return a float would likely break code.

Why file this?  We just ran into a bug due to code comparing a [stat.ST_MTIME] 
value to a stored stat_result.st_mtime thus continually reporting a difference 
due to the precision difference between the two but the numeric comparison 
doing its job regardless.

--
components: Library (Lib)
messages: 237099
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: os.stat() tuple access vs named attribute access int vs float
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

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



[issue23567] os.stat() tuple access vs named attribute access int vs float

2015-03-02 Thread STINNER Victor

STINNER Victor added the comment:

It's already documented:

https://docs.python.org/dev/library/os.html#os.stat_result

For compatibility with older Python versions, accessing stat_result as a tuple 
always returns integers.

--
nosy: +haypo

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



[issue23505] Urlparse insufficient validation leads to open redirect

2015-03-02 Thread Yassine ABOUKIR

Yassine ABOUKIR added the comment:

When you directly type //evil.com or evil.com in Firefox URL bar you will 
be redirect to evil.com and that is very known, read this : 

http://homakov.blogspot.com/2014/01/evolution-of-open-redirect-vulnerability.html

Here is a video demonstration of the vulnerability : http://youtu.be/l0uDAqpRPpo

--

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



[issue23564] Patch fixing sanity check for ordered fd sequence in _posixsubprocess.c

2015-03-02 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +gregory.p.smith

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



[issue23285] PEP 475 - EINTR handling

2015-03-02 Thread STINNER Victor

STINNER Victor added the comment:

Note: I found the bug while working on a patch for #22181.

My test is this shell script:

$ while true; do ./python -c 'import os, signal; 
signal.setitimer(signal.ITIMER_REAL, 0.001, 0.0001); 
signal.signal(signal.SIGALRM, lambda *args: print(., end=)); 
print(urandom); x=os.urandom(5000); print(ok); signal.alarm(0)'; if [ $? 
-ne 142 -a $? -ne 0 ]; then break; fi done  

The test calls print() in a signal handler which can likely create a reentrant 
call, which is forbidden. But Python handles this case, it's fine.

After removing all debug prints and reverting the fix on fileio.c, the test 
doesn't crash with the assertion error anymore. Before, an assertion failed 
because fileio_write() returned Py_None with an exception set.

--

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



[issue23505] Urlparse insufficient validation leads to open redirect

2015-03-02 Thread STINNER Victor

STINNER Victor added the comment:

 This can be practically exploited this way : 
 http://example.com/login?next=/evil.com

Can you please elaborate on the exploit part? 

In Firefox, the etc/passwd link shows me my local file /etc/passwd. Ok, 
but how is it an issue?

//etc/passwd also shows me file:etc/passwd.

The OWASP article on Open Redirect shows example to redirect to a different 
website. Can you should an example how redirect to a website and not a file:// 
URL?

https://www.owasp.org/index.php/Open_redirect

--
nosy: +haypo

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



[issue23494] adding timedelta to datetime object is not timezone aware

2015-03-02 Thread Akira Li

Akira Li added the comment:

pytz explicitly documents this case (crossing DST boundary). There is 
tz.normalize() method.

 the tzinfo object is responsible for handling daylight savings time.  This 
 looks like a bug in pytz.

Are any of tzinfo methods even called during `before + timedelta(days=2)`?

Also a DST transition is not the only reason the utc offset or tzname may 
change.

--
nosy: +akira

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



[issue17352] Be clear that __prepare__ must be declared as a class method

2015-03-02 Thread Ethan Furman

Ethan Furman added the comment:

Should __prepare__ be special-cased as a classmethod, like __new__ is?  Is 
there any reason to ever have __prepare__ /not/ be a classmethod?

--

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



[issue23505] Urlparse insufficient validation leads to open redirect

2015-03-02 Thread STINNER Victor

STINNER Victor added the comment:

 urlparse(//evil.com)
ParseResult(scheme='', netloc='evil.com', path='', params='', query='', 
fragment='')

I see evil.com in the netloc field, ok. But Firefox doesn't use Python to parse 
and url, and typing //evil.com in the address bar converts the address to 
file:evil.com. Not a website, but a local file.

So I don't understand the redirection part. Could you maybe write a vulnerable 
CGI script to demonstrate the bug?

I wrote the following HTML file to try to understand the bug, but I was only 
able to show the content of my local file /etc/issue:

head
META http-equiv=refresh content=5;URL=etc/issue
/head
pa href=etc/issueissue/a/p

--

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



[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2015-03-02 Thread STINNER Victor

STINNER Victor added the comment:

Commit in the Linux kernel:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c6e9d6f38894798696f23c8084ca7edbf16ee895

--

Here is a patch to use the new getrandom() syscall of Linux 3.17 in the Python 
function os.urandom().

The function falls back to reading /dev/urandom if getrandom() is not supported 
(returns ENOSYS at runtime).

On my Linux 3.18, the EINTR path is never taken. But I was able to test it 
manually by setting flags to GRND_RANDOM (2) and injecting many signals using 
signal.setitimer(): see my http://bugs.python.org/issue23285#msg237100

--
keywords: +patch
Added file: http://bugs.python.org/file38310/random.patch

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



[issue23512] The list of built-in functions is not alphabetical on https://docs.python.org/2/library/functions.html

2015-03-02 Thread Carlo Beccarini

Changes by Carlo Beccarini hackdiablo...@gmail.com:


Removed file: http://bugs.python.org/file38305/functions.rst

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



[issue23550] Add to unicodedata a function to query the Quick_Check property for a character

2015-03-02 Thread Hammerite

Hammerite added the comment:

Here is an initial attempt at a patch that implements the new function.

Notes on this patch:

- The function as implemented here returns a string: Yes, No, or Maybe. 
In light of the fact that Python now has enums, it is probably more appropriate 
that unicodedata contain an enum (QuickCheckValue, say) that has Yes, No and 
Maybe as values, and that the function return values from the enum. However, I 
do not know how to implement this in C and I do not know where I might look for 
an example of where something like this is done (in C) already in the CPython 
codebase, so I have not done that.

- My example code in the initial message on this issue was in error, as it 
assumed that the new function would return a Boolean value. In fact, there are 
three possible return values (Yes, No and Maybe), and corrected code would test 
the return value for equality with a string (as I have implemented the 
function) or for equality or identity with an enum value.

- When I first generated a patch, it was very long and consisted mostly of 
changes to three generated header files; these changes accounted for a total of 
about 60,000 lines' worth of patch file and appeared to be almost entirely 
spurious. Although one or more of these header files will genuinely be 
generated differently on account of my changes (a new string array 
_PyUnicode_QuickCheckNames is now present, along the same lines as the 
pre-existing 'Names' arrays), I have omitted them from the diff for being 
extremely bulky and for being generated code in any case.

--
keywords: +patch
Added file: http://bugs.python.org/file38308/quick_check_x.patch

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



[issue23285] PEP 475 - EINTR handling

2015-03-02 Thread STINNER Victor

STINNER Victor added the comment:

The change on Modules/_io/fileio.c is wrong: functions may return None with an 
exception set. It is wrong because a function must return a result with no 
exception set, or NULL and an exception set.

Attached patch fixes this issue.

--
Added file: http://bugs.python.org/file38309/fileio.patch

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



[issue22801] collections.Counter, when empty, doesn't raise an error with = when other is an incompatible type

2015-03-02 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I see no reason pure python code to have to detect and report such oddities.
Closing as not worth it.

--
resolution:  - rejected
status: open - closed

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



[issue23505] Urlparse insufficient validation leads to open redirect

2015-03-02 Thread Martin Panter

Martin Panter added the comment:

Do you think it would be enough to ensure the urlparse() result remembers 
whether the empty “//” was present or not? In other words, something like the 
following mockup (based on the Issue 22852 proposal). An example vunerable 
program would help me understand this as well.

 urlparse(evil.com)
ParseResult(scheme=, netloc=, has_netloc=True, path=//evil.com, ...)
 urlunparse(_)
evil.com

Or would we still need special handling of a path that starts with a double 
slash despite that; either URL-encoding the second slash, or maybe just raising 
an exception? Consider that the components are already supposed to be 
URL-encoded, and you can still generate unexpected valid URLs by giving other 
invalid components, such as

 urlunparse((, netloc/with/path, /more/path, , , ))
'//netloc/with/path/more/path'

--

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



[issue23560] Group the docs of similar methods in stdtypes.rst

2015-03-02 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

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



[issue22555] Tracking issue for adjustments to binary/text boundary handling

2015-03-02 Thread Nick Coghlan

Nick Coghlan added the comment:

PEP 461 landed, restoring binary interpolation support: 
https://hg.python.org/cpython/rev/8d802fb6ae32

There are also some relevant around standardising the C.UTF-8 locale currently 
available on some Linux systems:

Fedora RFE: https://bugzilla.redhat.com/show_bug.cgi?id=902094
glibc RFE: https://sourceware.org/bugzilla/show_bug.cgi?id=17318
glibc-alpha discussion: 
https://sourceware.org/ml/libc-alpha/2015-02/msg00247.html

--

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



[issue23564] Patch fixing sanity check for ordered fd sequence in _posixsubprocess.c

2015-03-02 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Haha, yes, that description and patch look correct.  Thanks!

Fortunately this bug is low impact as this was just a sanity check and the 
calling code from subprocess.py was already passing the correct data in.

An ideal regression test: An explicit unittest that calls the _posixsubprocess 
API with some bad sequences of values in fds_to_keep and uses assertRaises to 
check for the appropriate ValueError(bad value(s) in fds_to_keep) coming out 
of it...

--
assignee:  - gregory.p.smith
priority: normal - low
stage:  - patch review
type:  - behavior

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



[issue21619] Cleaning up a subprocess with a broken pipe

2015-03-02 Thread Martin Panter

Martin Panter added the comment:

Thanks for that link; the answer by Eryksun 
https://stackoverflow.com/questions/23688492/oserror-errno-22-invalid-argument-in-subprocess#28020096
 is particularly enlightening. Apparently EINVAL actually represents an 
underlying broken pipe condition in Windows. Anyway, as far as the test is 
concerned, it doesn’t matter what particular exception is raised.

This still doesn’t explain Serhiy’s observation that sometimes no exception is 
raised at all, https://bugs.python.org/issue21619#msg236949. Does Windows 
sometimes not report broken pipe errors, or is my signalling logic not working 
and there is a race condition? The whole point of the test is to trigger an 
exception when stdin is closed, so it would be nice to be able to reliably do 
that on Windows.

--

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



[issue23362] integer overflow in string translate

2015-03-02 Thread Arfrever Frehtes Taifersar Arahesis

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


--
versions: +Python 3.3, Python 3.5

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



[issue23367] integer overflow in unicodedata.normalize

2015-03-02 Thread Arfrever Frehtes Taifersar Arahesis

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


--
versions: +Python 2.7, Python 3.3, Python 3.5

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



[issue21619] Cleaning up a subprocess with a broken pipe

2015-03-02 Thread STINNER Victor

STINNER Victor added the comment:

A few months ago, I modified Popen.communicate() to handle EINVAL on
Windows.

--

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



[issue23275] Can assign [] = (), but not () = []

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue22933] Misleading sentence in doc for shutil.move

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy
stage:  - needs patch

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



[issue22801] collections.Counter, when empty, doesn't raise an error with = when other is an incompatible type

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage: patch review - test needed

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



[issue22812] Documentation of unittest -p usage wrong on windows.

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage:  - needs patch
type:  - enhancement

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



[issue23559] [doc] inconsistent range example output

2015-03-02 Thread Georg Brandl

Georg Brandl added the comment:

The example is correct.  r is a range(0, 20, 2), whose last element is 18.

--
nosy: +georg.brandl
resolution:  - not a bug
status: open - closed

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



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy
stage:  - needs patch
type:  - enhancement
versions: +Python 2.7, Python 3.5

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



[issue20059] Inconsistent urlparse/urllib.parse handling of invalid port values?

2015-03-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM and I think it is worth to be applied to maintained releases.

--
nosy: +orsenthil
stage:  - commit review

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



[issue19075] Add sorting algorithm visualization to turtledemo

2015-03-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 596228491890 by Ethan Furman in branch 'default':
issue19075: add visual sorting algorithms to turtledemo; original code from 
Jason Yeo
https://hg.python.org/cpython/rev/596228491890

--
nosy: +python-dev

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



[issue23400] Inconsistent behaviour of multiprocessing.Queue() if sem_open is not implemented

2015-03-02 Thread Davin Potts

Davin Potts added the comment:

Attaching a further revised patch for 3.4 and 3.5/default, now with cleaned-up 
code style per the discussion in the review.

No changes are prompted for the patch to 2.7 as it only contained changes to 
the docs and nothing code-related.

Thanks again goes to Berker for the guidance.

--
Added file: 
http://bugs.python.org/file38306/issue23400_py35_and_py34_improveddocsandstyle.patch

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



[issue19075] Add sorting algorithm visualization to turtledemo

2015-03-02 Thread Ethan Furman

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


--
assignee:  - ethan.furman
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue23367] integer overflow in unicodedata.normalize

2015-03-02 Thread Benjamin Peterson

Benjamin Peterson added the comment:

True, but that could change and is not true in Python 2. I suppose we
could revert the change and add a static assertion.
On Mon, Mar 2, 2015, at 14:24, Serhiy Storchaka wrote:
 
 Serhiy Storchaka added the comment:
 
 Because isize is the size of real PyUnicode object. It's maximal value is
 PY_SSIZE_T_MAX - sizeof(PyASCIIObject) - 1.
 
 --
 
 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue23367
 ___

--

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



[issue23562] file.read() followed by file.write() result in incorrect behavior

2015-03-02 Thread Maxime S

New submission from Maxime S:

Observed Behavior:

$python3
Python 3.5.0a1+ (default, Mar  2 2015, 14:30:05) 
[GCC 4.6.3] on linux
Type help, copyright, credits or license for more information.
 f = open(test, w+)
 f.write(Hello World)
11
 f.seek(0)
0
 f.read(5)
'Hello'
 f.write( people)
7
 f.seek(0)
0
 f.read()
'Hello World people'


Expected Behavior

According to POSIX, the last f.read() should return Hello people, like in 
Python 2:


$ python2
Python 2.7.3 (default, Feb 27 2014, 20:00:17) 
[GCC 4.6.3] on linux2
Type help, copyright, credits or license for more information.
 f = open(test, w+)
 f.write(Hello World)
 f.seek(0)
 f.read(5)
'Hello'
 f.write( people)
 f.seek(0)
 f.read()
'Hello people'

Workaround:

f.seek(f.tell()) immediately after f.read(5) restore the correct behavior.

--
components: IO
messages: 237046
nosy: Maxime S
priority: normal
severity: normal
status: open
title: file.read() followed by file.write() result in incorrect behavior
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue23263] Python 3 gives misleading errors when validating unicode identifiers

2015-03-02 Thread STINNER Victor

STINNER Victor added the comment:

 The attached patch attempts to clarify this by providing a different error 
 when the start character is invalid.

I dislike the patch. The error message invalid character in identifier is 
correct. I don't want to modify so much code for a little better error message.

If you start to use non-ASCII identifier, you are probably already aware that 
you may get some issues. I close the issue.

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

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



[issue19035] tokenize.generate_tokens treat '\f' symbol as the end of file (when reading in unicode)

2015-03-02 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Ha!  Apparently this bug broke coverage for the Mailman 3 source code:

https://bitbucket.org/ned/coveragepy/issue/360/html-reports-get-confused-by-l-in-the-code

--

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



[issue19035] tokenize.generate_tokens treat '\f' symbol as the end of file (when reading in unicode)

2015-03-02 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
nosy: +barry

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



[issue23561] a little typo in dis.rst; need a non-trivial preceding dot

2015-03-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 10b563c32f9d by Benjamin Peterson in branch '3.4':
link to the correct dis method or function (closes #23561)
https://hg.python.org/cpython/rev/10b563c32f9d

New changeset 760f222103c7 by Benjamin Peterson in branch 'default':
merge 3.4 (#23561)
https://hg.python.org/cpython/rev/760f222103c7

--
nosy: +python-dev
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue23562] file.read() followed by file.write() result in incorrect behavior

2015-03-02 Thread STINNER Victor

STINNER Victor added the comment:

This issue is probably a duplicate of the issue #12215 (see also #12513 for the 
codecs moduile).

--
nosy: +haypo

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



[issue23312] google thinks the docs are mobile unfriendly

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue23192] Generator return value ignored in lambda function

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue23330] h2py.py regular expression missing

2015-03-02 Thread Thomas Roos

Thomas Roos added the comment:

works for me

--

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



[issue23320] devguide should mention rules about paragraph reflow in the documentation

2015-03-02 Thread Ezio Melotti

Ezio Melotti added the comment:

Agreed with what Georg said and I think the devguide can be update accordingly.

--
assignee:  - docs@python
components: +Documentation
keywords: +easy
nosy: +docs@python
stage:  - needs patch

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



[issue22785] range docstring is less useful than in python 2

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +benjamin.peterson
type:  - enhancement

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



[issue23541] Re module's match() fails to halt on a particular input

2015-03-02 Thread Serhiy Storchaka

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


--
resolution:  - wont fix
stage:  - resolved
status: open - closed

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



[issue23263] Python 3 gives misleading errors when validating unicode identifiers

2015-03-02 Thread Matt Bachmann

Matt Bachmann added the comment:

Alrighty. I'll investigate and see if I can cut down the code some. If I can't 
significantly I'll let the issue die quietly. I agree that it's a pretty 
nitpick ticket. 

I noticed it while doing some research into unicode and made the patch when I 
saw how languages like swift handle this case. 

Thanks for looking at it though!

--

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



[issue23330] h2py.py regular expression missing

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +loewis

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



[issue22813] No facility for test randomisation

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage:  - needs patch
type:  - enhancement

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



[issue22831] Use with to avoid possible fd leaks

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue23559] [doc] inconsistent range example output

2015-03-02 Thread Raphaël Bleuse

New submission from Raphaël Bleuse:

Reading the documentation for ranges (see 
https://docs.python.org/3.5/library/stdtypes.html#ranges), the example using a 
negative index output is inconsistent with the range effective behaviour.

One can read:

 r[-1]
18


while (in my understanding) it should be:

 r[-1]
8


Note the output should be 8 and not 18.

Raphaël

--
assignee: docs@python
components: Documentation
messages: 237029
nosy: bleuse, docs@python
priority: normal
severity: normal
status: open
title: [doc] inconsistent range example output
type: behavior
versions: Python 3.5

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



[issue23367] integer overflow in unicodedata.normalize

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
components: +Unicode
nosy: +ezio.melotti, haypo, serhiy.storchaka

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



[issue22942] Language Reference - optional comma

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +Joshua.Landau, neil.g

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



[issue23263] Python 3 gives misleading errors when validating unicode identifiers

2015-03-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Agreed with Ezio. Adding 7 new public names just to enhance one rare error 
message looks too hight cost. I am inclined to left all as is. Original message 
is not so bad.

--

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



[issue23330] h2py.py regular expression missing

2015-03-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

my be change the pattern to '([^\n]+)'?

--
nosy: +serhiy.storchaka

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



[issue23560] Group the docs of similar methods in stdtypes.rst

2015-03-02 Thread Ezio Melotti

New submission from Ezio Melotti:

The Doc/library/stdtypes.rst page describes in detail the built-in types and 
their methods.  As suggested in #21777 (see the comments on Rietveld), it might 
be a good idea to group the documentation of some similar methods, such as 
{r|l|}just, {r|l|}strip, {r|}partition, {r|}index, and {r|}find.

This will remove some duplication, make the page shorter and easier to 
navigate, and make the methods easier to discover.  Adding tables containing 
the methods for each types has also been proposed.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 237036
nosy: docs@python, ezio.melotti
priority: normal
severity: normal
stage: needs patch
status: open
title: Group the docs of similar methods in stdtypes.rst
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5

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



[issue21777] Separate out documentation of binary sequence methods

2015-03-02 Thread Ezio Melotti

Ezio Melotti added the comment:

 Zach, Ezio - if there are any other refactorings from the reviews that
 you'd like to pursue, consider pulling them out to separate issues so
 we don't forget about them.

See #23560.

--

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



[issue23561] a little typo in dis.rst; need a non-trivial preceding dot

2015-03-02 Thread Novice Live

New submission from Novice Live:

it is likely that the author of dis.rst omitted two non-trivial preceding dots.

in the 'Bytecode analysis' section,
both :meth:`dis` and :func:`dis` have no preceding dots before 'dis'.

the dots may be trivial elsewhere, but they are non-trivial here. 
otherwise, the hyperlinks will be unexpectedly targeted to the top of the dis 
module, rather than the corresponding dis method or function.

ref.
:meth:`.timeit`, where the 'timeit' was preceded by a dot, in timeit.rst.

:)

--
assignee: docs@python
components: Documentation
files: dis_typo.patch
keywords: patch
messages: 237039
nosy: docs@python, n0vicelive
priority: normal
severity: normal
status: open
title: a little typo in dis.rst; need a non-trivial preceding dot
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file38297/dis_typo.patch

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



[issue23192] Generator return value ignored in lambda function

2015-03-02 Thread Bruno Cauet

Bruno Cauet added the comment:

Here are the operations being emitted (line, macro used and eventual argument):

 f = lambda: (yield 5)
3487: ADDOP_O LOAD_CONST e-v.Num.n
3472: ADDOP YIELD_VALUE
1907: ADDOP_IN_SCOPE POP_TOP
4349: ADDOP_O LOAD_CONST Py_None
4350: ADDOP RETURN_VALUE
1457: ADDOP_O LOAD_CONST (PyObject*)co
1458: ADDOP_O LOAD_CONST qualname
1459: ADDOP_I MAKE_FUNCTION args
4349: ADDOP_O LOAD_CONST Py_None
4350: ADDOP RETURN_VALUE
 def g(): return (yield 5)
... 
3487: ADDOP_O LOAD_CONST e-v.Num.n
3472: ADDOP YIELD_VALUE
2533: ADDOP RETURN_VALUE
1457: ADDOP_O LOAD_CONST (PyObject*)co
1458: ADDOP_O LOAD_CONST qualname
1459: ADDOP_I MAKE_FUNCTION args
4349: ADDOP_O LOAD_CONST Py_None
4350: ADDOP RETURN_VALUE

So there's an extra POP_TOP + LOAD_CONST Py_NONE for the lambda version that 
throws away the 123 (in the exemple).

The attached patch (0001-...) fixes it. However please note that I'm not 
knowledgable about that part of the code and devised the patch empirically.
Moreover a test should probably added but I did not know where (test_dis? tried 
and failed... see patch 0002-...).

--
keywords: +patch
nosy: +bru
Added file: 
http://bugs.python.org/file38298/0001-lambda-generators-don-t-throw-away-stack-top.patch

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



[issue23192] Generator return value ignored in lambda function

2015-03-02 Thread Bruno Cauet

Changes by Bruno Cauet brunoca...@gmail.com:


Added file: 
http://bugs.python.org/file38299/0002-lambda-generator-fix-try-to-add-a-dis-test.patch

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



[issue22817] re.split fails with lookahead/behind

2015-03-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

re.split() with the r'(?CA)(?=GCTG)' pattern raises a ValueError in 3.5 (see 
issue22818). In future releases it could be changed to work with zero-width 
patterns (such as lookaround assertions).

--
resolution:  - wont fix
stage:  - resolved
status: open - closed

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



[issue22801] collections.Counter, when empty, doesn't raise an error with = when other is an incompatible type

2015-03-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Additional check is not for free.

$ ./python -m timeit -s from collections import Counter; a = Counter(); b = 
Counter(range(10)) -- a = b

Unpatched: 10 loops, best of 3: 8.4 usec per loop
Patched:   10 loops, best of 3: 9.7 usec per loop

--
nosy: +serhiy.storchaka

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



[issue23263] Python 3 gives misleading errors when validating unicode identifiers

2015-03-02 Thread Ezio Melotti

Ezio Melotti added the comment:

While the request is reasonable, the patch seems to touch quite some code.
Since this is just to improve an error message in a somewhat obscure corner 
case, I'm not sure it's worth applying it.

--
nosy: +serhiy.storchaka
stage:  - patch review
versions:  -Python 3.2, Python 3.3, Python 3.4, Python 3.6

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



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2015-03-02 Thread Mark Dickinson

Mark Dickinson added the comment:

I don't think we should close: the documentation as written explicitly says 
that the rules apply to both Decimal and float: The available presentation 
types for floating point and decimal values are   But the details listed 
for 'g' are incorrect.  We could either fix the description for 'g' to explain 
what happens for `Decimal`, or state up front that the table only applies 
directly to the `float` type, and that `Decimal` is similar but not identical.

--

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



[issue433030] SRE: Atomic Grouping (?...) is not supported

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue21293] Remove capsule hack from object.c?

2015-03-02 Thread Steve Dower

Steve Dower added the comment:

No current reasons I'm aware of (apart from not having a working up-to-date 
Windows buildbot right now - blocked on #23524) so I'd say go ahead. Pull it 
out and see what breaks.

The fact that the comment says pycapsule.o and not pycapsule.obj probably 
means this wasn't a Windows issue in the first place.

--

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



[issue23558] Unable to install Python 3.4.3 amd64 on Windows 8.1

2015-03-02 Thread Steve Dower

Steve Dower added the comment:

Glad you got it sorted out. I've done exactly the same thing too.

The 3.5 installer is designed to have no impact on earlier versions, and also 
has different default directories for 32-bit vs. 64-bit, which will help 
prevent these problems in the future.

--
resolution:  - not a bug
status: open - closed

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



[issue21293] Remove capsule hack from object.c?

2015-03-02 Thread Larry Hastings

Larry Hastings added the comment:

You give me too much credit.  I'm the chimp who put it there in the first 
place.  Though, admittedly, it was a copypaste job based on the ancient 
CObject.

My guess is this was very helpful in 1.4, or something.  ;-)

--

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



[issue18382] multiprocessing's overlapped PipeConnection issues on Windows 8

2015-03-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7401a28d3d41 by Steve Dower in branch '3.4':
Issue #18382: Zero-length messages are consumed by ReadFile on Windows 8 and 
later
https://hg.python.org/cpython/rev/7401a28d3d41

New changeset 6ccbcf1df7bd by Steve Dower in branch 'default':
Issue #18382: Zero-length messages are consumed by ReadFile on Windows 8 and 
later
https://hg.python.org/cpython/rev/6ccbcf1df7bd

--
nosy: +python-dev

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



[issue23451] Deprecation warnings building 3.5 Visual Studio Windows 8.1 64 bit

2015-03-02 Thread Steve Dower

Steve Dower added the comment:

The _WINSOCK_DEPRECATED_NO_WARNINGS question is still open, but the rest of the 
deprecations should be clear now.

--

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



[issue23563] Faster urllib.urlparse utility functions

2015-03-02 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch optimizes utility functions in the urllib.parse module.

$ ./python -m timeit -s from urllib.parse import splittype -- 
splittype('type:'+'x'*1000)
Unpatched: 10 loops, best of 3: 17 usec per loop
Patched:   10 loops, best of 3: 15 usec per loop

$ ./python -m timeit -s from urllib.parse import splithost -- 
splithost('//www.example.org:80/foo/bar/baz.html')
Unpatched: 10 loops, best of 3: 12.7 usec per loop
Patched:   10 loops, best of 3: 10.6 usec per loop

$ ./python -m timeit -s from urllib.parse import splithost -- 
splithost('//www.example.org:80')
Unpatched: 10 loops, best of 3: 9.34 usec per loop
Patched:   10 loops, best of 3: 9.09 usec per loop

$ ./python -m timeit -s from urllib.parse import splituser -- 
splituser('username:passw...@example.org:80')
Unpatched: 10 loops, best of 3: 8.76 usec per loop
Patched:   10 loops, best of 3: 3.1 usec per loop

$ ./python -m timeit -s from urllib.parse import splituser -- 
splituser('example.org:80')
Unpatched: 10 loops, best of 3: 5.89 usec per loop
Patched:   10 loops, best of 3: 1.98 usec per loop

$ ./python -m timeit -s from urllib.parse import splitpasswd -- 
splitpasswd('username:password')
Unpatched: 10 loops, best of 3: 7.38 usec per loop
Patched:   10 loops, best of 3: 3.08 usec per loop

$ ./python -m timeit -s from urllib.parse import splitpasswd -- 
splitpasswd('username')
Unpatched: 10 loops, best of 3: 5.35 usec per loop
Patched:   10 loops, best of 3: 1.92 usec per loop

$ ./python -m timeit -s from urllib.parse import splitnport -- 
splitnport('example.org:80')
Unpatched: 10 loops, best of 3: 13.2 usec per loop
Patched:   10 loops, best of 3: 6.58 usec per loop

$ ./python -m timeit -s from urllib.parse import splitnport -- 
splitnport('example.org')
Unpatched: 10 loops, best of 3: 6.03 usec per loop
Patched:   10 loops, best of 3: 2.37 usec per loop

$ ./python -m timeit -s from urllib.parse import splitquery -- 
splitquery('/path?query')
Unpatched: 10 loops, best of 3: 8.03 usec per loop
Patched:   10 loops, best of 3: 3.01 usec per loop

$ ./python -m timeit -s from urllib.parse import splitquery -- 
splitquery('/path')
Unpatched: 10 loops, best of 3: 5.21 usec per loop
Patched:   100 loops, best of 3: 1.91 usec per loop

$ ./python -m timeit -s from urllib.parse import splitvalue -- 
splitvalue('attr=value')
Unpatched: 10 loops, best of 3: 7.37 usec per loop
Patched:   10 loops, best of 3: 2.97 usec per loop

$ ./python -m timeit -s from urllib.parse import splitvalue -- 
splitvalue('attr')
Unpatched: 10 loops, best of 3: 5.13 usec per loop
Patched:   100 loops, best of 3: 1.9 usec per loop

This functions are not documented but used in the stdlib and third-party code.

--
assignee: serhiy.storchaka
components: Library (Lib)
files: urlparse_split_faster.patch
keywords: patch
messages: 237048
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Faster urllib.urlparse utility functions
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file38300/urlparse_split_faster.patch

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



[issue23539] Content-length not set for HTTP methods expecting body when body is None

2015-03-02 Thread R. David Murray

R. David Murray added the comment:

Don't break backward compatibility.  It's not like this was reported as a bug 
that caused a problem for real world code, it is about theoretical consistency. 
 The risk of breaking someone code is much higher than the benefit of any such 
consistency, when talking about a bug fix.

Aside from that, however, I see request.('GET', '/') and request.('GET', '/', 
'') as clearly *different* from an API call standpoint, so I would in any case 
preserve the existing behavior.

--

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



[issue23562] file.read() followed by file.write() result in incorrect behavior

2015-03-02 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
resolution:  - duplicate
status: open - closed
superseder:  - TextIOWrapper: issues with interlaced read-write

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



[issue18382] multiprocessing's overlapped PipeConnection issues on Windows 8

2015-03-02 Thread Steve Dower

Changes by Steve Dower steve.do...@microsoft.com:


--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-03-02 Thread Alex Shkop

Alex Shkop added the comment:

The issue occurs only if C implementation of _warnings is available. It is 
caused by re-use of global filters variable from _warnings when warnings is 
being re-imported.
So warnings modifies _warnings.filters on first import. Then, when you import 
warnings again it uses already modified version of _warnings.filters and adds 
same filter for the second time.

I attach a simple patch that prevents duplicates in filters. I'm not sure if 
this is a best way to fix the problem, but it works. It certainly affects 
performance of filterwarnings(), but there shouldn't be a lot of filters anyway.

Making filters a set() will solve the problem also, but will require API 
changes. Although I didn't find anywhere in documentation that warnings.filters 
should be a list, someone might rely on its .append() method.

--
nosy: +ashkop
Added file: http://bugs.python.org/file38301/issue18383_remove_dups.patch

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



[issue23451] Deprecation warnings building 3.5 Visual Studio Windows 8.1 64 bit

2015-03-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 57e2549cc9a6 by Steve Dower in branch 'default':
Issue #23451: Update pyconfig.h for Windows to require Vista headers and remove 
unnecessary version checks.
https://hg.python.org/cpython/rev/57e2549cc9a6

--
nosy: +python-dev

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



[issue9784] _msi.c warnings under 64-bit Windows

2015-03-02 Thread Steve Dower

Steve Dower added the comment:

We'd need a contributor agreement from Jon anyway, so unless he rejoins this 
thread and is willing to sign that, there's little point looking at the patch.

--

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



[issue23367] integer overflow in unicodedata.normalize

2015-03-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 84025a32fa2b by Benjamin Peterson in branch '3.3':
fix possible overflow bugs in unicodedata (closes #23367)
https://hg.python.org/cpython/rev/84025a32fa2b

New changeset 90f960e79c9e by Benjamin Peterson in branch '3.4':
merge 3.3 (#23367)
https://hg.python.org/cpython/rev/90f960e79c9e

New changeset 93244000efea by Benjamin Peterson in branch 'default':
merge 3.4 (#23367)
https://hg.python.org/cpython/rev/93244000efea

New changeset 3019effc44f2 by Benjamin Peterson in branch '2.7':
fix possible overflow bugs in unicodedata (closes #23367)
https://hg.python.org/cpython/rev/3019effc44f2

--
nosy: +python-dev
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue23368] integer overflow in _PyUnicode_AsKind

2015-03-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Was fixed as part of issue23446.

--
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue23564] Patch fixing sanity check for ordered fd sequence in _posixsubprocess.c

2015-03-02 Thread Hisham Muhammad

New submission from Hisham Muhammad:

In Modules/_posixsubprocess.c, (the helper module for Lib/subprocess.py) 
there's a function called _sanity_check_python_fd_sequence which checks, as its 
comment says, if the fds in the sequence are all positive and sorted.

The check to verify if it is sorted is incorrect (missing the update to the 
prev_fd variable), and also it is missing a test to see if fd's are repeated 
(which they shouldn't be, so the test should use = rather than ). 

The attached patch, written against Python 3.4.3 source code, fixes it.

--
components: Extension Modules
files: python-3.4.3-_posixsubprocess.c.fix.patch
keywords: patch
messages: 237061
nosy: Hisham Muhammad
priority: normal
severity: normal
status: open
title: Patch fixing sanity check for ordered fd sequence in _posixsubprocess.c
versions: Python 3.4
Added file: 
http://bugs.python.org/file38302/python-3.4.3-_posixsubprocess.c.fix.patch

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



[issue23367] integer overflow in unicodedata.normalize

2015-03-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Actually integer overflow in the line

space = (isize  10 ? 10 : isize) + isize;

is not possible.

Integer overflows in PyMem_Malloc were fixed in issue23446.

--

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



[issue23362] integer overflow in string translate

2015-03-02 Thread Serhiy Storchaka

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


--
assignee:  - serhiy.storchaka

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



[issue23368] integer overflow in _PyUnicode_AsKind

2015-03-02 Thread Serhiy Storchaka

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


--
resolution: fixed - out of date

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



[issue23539] Content-length not set for HTTP methods expecting body when body is None

2015-03-02 Thread R. David Murray

R. David Murray added the comment:

Not to get into an API argument, but rather to convey some Python philosophy as 
I understand it: there *is* often a distinction in Python between the value 
'None' and a boolean-False-value like ''.  It is often the case in Python APIs 
that None means something different from other arguably-semantically-equivalent 
values.  In this case I believe it is entirely logical that 'None' (the default 
value) for a method that does not normally take a body and makes a distinction 
based on Content-Length (or some other header) makes sense, and that explicitly 
saying I want an empty body, including the standard headers is actually a 
sensible Python API.  If we were designing it from scratch with these issues in 
mind, we might well come up with exactly what we've got...or we might not, 
because wanting to specify an empty body on such a command is a really low 
probability event :)

Regardless, we're constrained by backward compatibility here, so the question 
is moot.

--

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



[issue21293] Remove capsule hack from object.c?

2015-03-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b22755f8ab5f by Larry Hastings in branch 'default':
Issue #21293: Remove unnecessary capsule hack.
https://hg.python.org/cpython/rev/b22755f8ab5f

--
nosy: +python-dev

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



[issue21293] Remove capsule hack from object.c?

2015-03-02 Thread Larry Hastings

Larry Hastings added the comment:

Yeah, I went ahead and checked this in.  I'm living life on the *edge*.

To the EXTREME!

--
assignee:  - larry
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue23368] integer overflow in _PyUnicode_AsKind

2015-03-02 Thread Serhiy Storchaka

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


--
assignee:  - serhiy.storchaka
nosy: +serhiy.storchaka

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



[issue23446] Use PyMem_New instead of PyMem_Malloc

2015-03-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be apply the fix to 3.3?

--

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



[issue23539] Content-length not set for HTTP methods expecting body when body is None

2015-03-02 Thread Demian Brecht

Demian Brecht added the comment:

 Aside from that, however, I see request.('GET', '/') and request.('GET', '/', 
 '') as clearly *different* from an API call standpoint, so I would in any 
 case preserve the existing behavior.

I do understand the case that the the two examples look different from a 
caller’s standpoint. However as a user, I’d expect the library to do the Right 
Thing due to a deeper understanding of the theory behind the API that I’m 
using. Perhaps it would have made more sense to default body to empty string 
rather than None in which case there wouldn’t be a need for this distinction.

That said, I do understand the reasoning behind not breaking backwards 
compatibility and it’s not a problem until reported and am not looking to get 
into an API design argument (especially for something as low impact as what I 
was proposing). So @James, I stand corrected :)

--

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



[issue23367] integer overflow in unicodedata.normalize

2015-03-02 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Why can't (isize  10 ? 10 : isize) + isize overflow?

--
nosy: +benjamin.peterson

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



[issue12067] Doc: remove errors about mixed-type comparisons.

2015-03-02 Thread Andy Maier

Andy Maier added the comment:

I have posted v14 of the patch (for the 3.5 'default' branch), based on 
Martin's v13. v14 addresses all comments Martin made, as described in my 
responses to them (see patch set 10).

On Issue 4395: That issue should be pursued in addition to this issue; it seems 
Martin's patch for it is complementary to the patch for this issue here.

On Issue 22000: I agree that that issue is addressed by the patch for this 
issue here.

All: Please review the v14 patch.

--

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



  1   2   >