[issue10808] ssl unwrap fails with Error 0

2016-09-17 Thread Martin Panter

Martin Panter added the comment:

I understand this condition happens when the local end calls unwrap(), but the 
low-level socket connection has already been shut down from the remote end. If 
the remote is too slow, I get ConnectionResetError instead.

There is some discussion of this at 
. I 
tend to agree with Antoine that unfortunately there is not much Python can do 
without help from Open SSL. I.e. can we rely on SSL_shutdown() always setting 
errno = 0 to indicate Python should raise SSLEOFError, or should Open SSL add 
some new way of indicating this condition?

--
nosy: +martin.panter

___
Python tracker 

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



[issue28193] Consider using lru_cache for the re.py caches

2016-09-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added comments on Rietveld.

--

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-09-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Also, please take a look at resizing.  It looks like it is doing way too much 
work.  The original keys, values, and hashes shouldn't move at all, only the 
indices array needs to updated.

Here is the pure python version from the original proof-of-concept at 
https://code.activestate.com/recipes/578375

def _resize(self, n):
'''Reindex the existing hash/key/value entries.
   Entries do not get moved, they only get new indices.
   No calls are made to hash() or __eq__().

'''
n = 2 ** n.bit_length() # round-up to power-of-two
self.indices = self._make_index(n)
for index, hashvalue in enumerate(self.hashlist):
for i in Dict._gen_probes(hashvalue, n-1):
if self.indices[i] == FREE:
break
self.indices[i] = index
self.filled = self.used

Likewise, it looks like there is room for improvement in dict_copy().  It can 
memcpy() all four arrays and then incref all the keys.  That should be 
considerably faster than zeroing new arrays and applying re-insertion logic.

--

___
Python tracker 

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



[issue27716] http.client truncates UTF-8 encoded headers

2016-09-17 Thread Martin Panter

Martin Panter added the comment:

Thanks to the fix for Issue 22233, now the response is parsed more sensibly, 
and the body can be read. The 0x85 byte now gets decoded with Latin-1:

>>> print(ascii(resp.getheader("Link")[:100]))
';
 rel="alternate"; hreflang="zh-Hans", 

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



[issue28134] socket.socket(fileno=fd) does not work as documented

2016-09-17 Thread Martin Panter

Martin Panter added the comment:

Personally, I’m not too enthusiastic, because it is rather magical, and does 
not work in all cases. It seems more like a feature than a bug fix. But I have 
rarely used the fileno=... parameter, and it shouldn’t have much negative 
impact, so I’m not too fussed.

According to Issue 27377, these are some cases where parts won’t work:

* Windows and OS X (and older versions of Linux and BSD) don’t have SO_PROTOCOL
* getsockname() not guaranteed to work on unbound sockets, especially on 
Windows, and Free BSD with SCTP sockets

Also, if we are going to read SO_PROTOCOL when fileno=... is given, why not 
also read it in the normal case when proto=0 (unspecified) is given?

--

___
Python tracker 

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



[issue27761] Private _nth_root function loses accuracy

2016-09-17 Thread Tim Peters

Tim Peters added the comment:

Let me clarify something about the extended algorithm:  the starting guess is 
no longer the most significant source of error.  It's the `mul(D(x), pow(D2, 
e))` part.  `D(x)` is exact, but `pow(D2, e)` may not be exactly representable 
with 26 decimal digits, and the multiplication may also need to round.  Those 2 
operations may each suffer a half ulp error (but "ulp" in this case is 1 in the 
26th decimal digit).

The rough error analysis is straightforward to extend, but I used wxMaxima to 
do the Taylor expansions and to ensure I didn't drop any terms.  

So suppose that instead of exactly x*2**e we get x*2**e*(1+r1) for some small 
|r1| (on the order of 10**-25), and instead of the exact n'th root `t` the 
starting guess g = t*(1+r2) for some small |r2| (on the order of 2**-50).  Then 
the mathematical value of the corrected `g` is `t` times (dropping terms higher 
than quadratic in `r1` and `r2`):

1   + r1/n   - (n-1)/n * r1*r2   + (n-1)/2 * r2**2

The largest term (besides 1) by far is now `r1/n` (assuming a 
not-insanely-large `n`).  But that's still "way at the end" of the 
extended-precision decimal format, which _should be_ ;-) intuitively obvious.  
It's too small to have a direct effect on the last bit of the 53-bit result 
(but can certainly affect "close call" rounding cases).

--

___
Python tracker 

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



[issue28164] _PyIO_get_console_type fails for various paths

2016-09-17 Thread Eryk Sun

Eryk Sun added the comment:

> check that a handle is actually a real console handle or 
> what type it is

Did you mean a path here? Certainly you can check a handle, but that means 
opening the path twice.

You can use GetFullPathName to classify the path, and then use GetFullPathName 
again when opening it. Keep the original path as the `name`. When classifying 
the path, ignore the DOS-device prefix, "\\.\" or "\\?\", if present, and do a 
case-insensitive match for CON, CONIN$, or CONOUT$.

GetFullPathName transforms paths containing the "CON" device, e.g. "C:\Temp\con 
  :.spam  " =>  "\\.\CON". This ignores trailing spaces and anything after the 
first "." or ":" in the last component. It also translates forward slashes, 
e.g. "//./con" => "\\.\con". On Windows 8+ it also works with CONIN$ and 
CONOUT$, transforming them to "\\.\CONIN$" and "\\.\CONOUT$". 

This is reliable on Windows 8+, without having to also call GetFullPathName 
again when opening the path. The problem with Windows Vista and 7 is a speed 
hack it has. In these older versions, opening the console has to be handled 
specially by the function OpenConsoleW, so like you have to do here, in Windows 
7 there's an internal BaseIsThisAConsoleName function to classify a path. 

This function always checks for "CON", "CONIN$", or "CONOUT$" (case 
insensitive). But it also matches "\\.\CON" and in some cases also "CON" in the 
last component. Since BaseIsThisAConsoleName always has to be called, the path 
search could hurt performance. So there's a dubious hack to only look for "CON" 
if the path starts with "\", "c", or "C" or ends with "n", "N", "or ":". Thus 
"C:\temp\con  " opens the console because it starts with "C", but not 
"Z:\temp\con  " because it starts with "Z" and ends with a space.

--
status: closed -> open

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2016-09-17 Thread Martin Panter

Martin Panter added the comment:

This patch ports the logic written for Issue 26662 to Python 2. Basically, 
configure searches for commands called python2.7, python2, and python (in order 
of priority), and sets PYTHON_FOR_GEN to the result. PYTHON_FOR_GEN could be 
overridden by the user if desired. If no Python command is found, the build 
fails with an error message:

Cannot generate /home/proj/python/cpython/Python/Python-ast.c, python not found 
!
To skip re-generation of /home/proj/python/cpython/Python/Python-ast.c run 
 or .
Otherwise, set python in PATH and run configure or run .
--- Python/Python-ast.c ---
*** [Python/Python-ast.c] Error code 1

However if it finds “python” and that turns out to be version 3, it will still 
have the same problem as now, and you will have to manually use “make touch” or 
similar.

--
Added file: http://bugs.python.org/file44732/PYTHON_FOR_GEN.patch

___
Python tracker 

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



[issue27932] platform.win32_ver() leaks in 2.7.12

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

Phew. Doing that in a reasonable way for all the active versions was a pain, 
but I think I managed it.

In short:
* 2.7 gets the fix proposed by Eryk Sun
* 3.5 gets a private sys.getwindowsversion()._platform_version member
* 3.6+ gets a public/documented sys.getwindowsversion().platform_version member

AFAICT the implementation is solid, but please shout if you spot anything 
weird/wrong.

--
stage:  -> commit review
versions: +Python 3.7

___
Python tracker 

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



[issue27932] platform.win32_ver() leaks in 2.7.12

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset db4b254f5df4 by Steve Dower in branch '3.5':
Issue #27932: Prevent memory leak in win32_ver().
https://hg.python.org/cpython/rev/db4b254f5df4

New changeset 14fca2c8eb36 by Steve Dower in branch '3.6':
Issue #27932: Prevent memory leak in win32_ver().
https://hg.python.org/cpython/rev/14fca2c8eb36

New changeset 19ceb5034fe5 by Steve Dower in branch 'default':
Issue #27932: Prevent memory leak in win32_ver().
https://hg.python.org/cpython/rev/19ceb5034fe5

--

___
Python tracker 

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



[issue10109] itertools.product with infinite iterator cause MemoryError.

2016-09-17 Thread Tim Peters

Tim Peters added the comment:

Lucas, I largely agree, but it is documented that the various combinatorial 
generators emit items in a particular lexicographic order.  So that is 
documented, and programs definitely rely on it.

That's why, in an earlier comment, Terry suggested that perhaps `product()` 
could make a special case of its (and only its) first argument (and only when 
repeat=1).  Each element of the first iterable is needed only once (although it 
may copied into any number of outputs), so there's no actual need to make a 
tuple of it first.  The implementation is just simpler and clearer by treating 
all arguments alike.

Which is a good enough reason for me - and the "use cases" for an unbounded 
first argument look exceptionally weak to me.

--

___
Python tracker 

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



[issue27932] platform.win32_ver() leaks in 2.7.12

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9b0d661a16de by Steve Dower in branch '2.7':
Issue #27932: Prevent memory leak in win32_ver().
https://hg.python.org/cpython/rev/9b0d661a16de

--

___
Python tracker 

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



[issue28110] launcher.msi has different product codes between 32 and 64-bit

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dd7e3c81c4f0 by Steve Dower in branch '3.6':
Fixes bad merge for issue #28110
https://hg.python.org/cpython/rev/dd7e3c81c4f0

New changeset f4cdc125ed52 by Steve Dower in branch 'default':
Fixes bad merge for issue #28110
https://hg.python.org/cpython/rev/f4cdc125ed52

--

___
Python tracker 

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



[issue28110] launcher.msi has different product codes between 32 and 64-bit

2016-09-17 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.7

___
Python tracker 

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



[issue10109] itertools.product with infinite iterator cause MemoryError.

2016-09-17 Thread Lucas Wiman

Lucas Wiman added the comment:

It is quite thrifty with memory compared to the size of the search space O(n*k) 
memory for a search space of size O(n**k).

I think a reasonable expectation for itertools.product is that it should 
_eventually_ reach any element in the search space. The only way to maintain 
that expectation for infinite iterators would be be to use a Cantor-style 
zig-zag enumeration. Even for your example of searching over a single infinite 
iterator, you could end up exploring dates in the order (2010, 0), (2011, 0), 
(2012, 0), ... by switching the ordering of inputs. You'd never hit the rare 
date unless it happened on the first day of a year. 

There's no way to have special behavior _only_ for infinite iterators, since an 
infinite iterator is indistinguishable from a long-finite one due to the 
halting problem, so this would require changing the behavior for finite 
iterators too. While the output ordering is not explicitly documented, the 
current search order is probably depended on by plenty of existing programs, 
and has less surprise than a Cantor enumeration.

So the only use case where the lazy enumeration matters is if:
1. You have one or more _very_ large iterators.
2. You _do not care_ what order they are searched in, or even if all possible 
tuples appear in the output.
3. Despite not caring about the output ordering, you still only want a few 
examples.

I'm struggling to think of cases where that would come up.

--

___
Python tracker 

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



[issue28110] launcher.msi has different product codes between 32 and 64-bit

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 13001cf82931 by Steve Dower in branch '3.5':
Issue #28110: launcher.msi has different product codes between 32-bit and 64-bit
https://hg.python.org/cpython/rev/13001cf82931

New changeset f0fbb09e2d90 by Steve Dower in branch '3.6':
Issue #28110: launcher.msi has different product codes between 32-bit and 64-bit
https://hg.python.org/cpython/rev/f0fbb09e2d90

New changeset 64d6e96819a0 by Steve Dower in branch 'default':
Issue #28110: launcher.msi has different product codes between 32-bit and 64-bit
https://hg.python.org/cpython/rev/64d6e96819a0

--
nosy: +python-dev

___
Python tracker 

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



[issue10109] itertools.product with infinite iterator cause MemoryError.

2016-09-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> What's the major objection to making all of the itertools functions 
> "maximally lazy"?

It complicates the code and provides nearly zero benefit in practical use cases 
of the combinatoric functions.

--

___
Python tracker 

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



[issue28176] Fix callbacks race in asyncio.SelectorLoop.sock_connect

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8417873f2eac by Berker Peksag in branch '3.5':
Issue #28176: Increase timeout for test_sock_connect_sock_write_race
https://hg.python.org/cpython/rev/8417873f2eac

New changeset b5a08d5db05b by Berker Peksag in branch '3.6':
Issue #28176: Merge from 3.5
https://hg.python.org/cpython/rev/b5a08d5db05b

New changeset eb306c20de20 by Berker Peksag in branch 'default':
Issue #28176: Merge from 3.6
https://hg.python.org/cpython/rev/eb306c20de20

--

___
Python tracker 

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



[issue28193] Consider using lru_cache for the re.py caches

2016-09-17 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
keywords: +patch
Added file: http://bugs.python.org/file44731/re_repl_cache.diff

___
Python tracker 

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



[issue10109] itertools.product with infinite iterator cause MemoryError.

2016-09-17 Thread Robert Xiao

Robert Xiao added the comment:

It wouldn't be that complicated to have the combinatorial functions be lazy too 
- I feel like there's some value to be had there.

What's the major objection to making all of the itertools functions "maximally 
lazy"?

--

___
Python tracker 

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



[issue28192] Don't import readline in isolated mode

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

Turned out that we really only need to check for sys.__interactivehook__, which 
made it much easier to write the tests.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue28192] Don't import readline in isolated mode

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5761294bb877 by Steve Dower in branch '3.6':
Issue #28192: Adds tests for hook in isolated mode
https://hg.python.org/cpython/rev/5761294bb877

New changeset 6c7a8a012669 by Steve Dower in branch 'default':
Issue #28192: Adds tests for hook in isolated mode
https://hg.python.org/cpython/rev/6c7a8a012669

--

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-17 Thread Xavion

Changes by Xavion :


Added file: http://bugs.python.org/file44730/Test-2-gc.log

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-17 Thread Xavion

Changes by Xavion :


Added file: http://bugs.python.org/file44729/Test-2-no-gc.log

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-17 Thread Xavion

Changes by Xavion :


Added file: http://bugs.python.org/file44727/Test-1-no-gc.log

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-17 Thread Xavion

Changes by Xavion :


Added file: http://bugs.python.org/file44726/Test-2.py

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-17 Thread Xavion

Changes by Xavion :


Added file: http://bugs.python.org/file44728/Test-1-gc.log

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-17 Thread Xavion

Changes by Xavion :


Added file: http://bugs.python.org/file44724/Test.sh

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-17 Thread Xavion

Changes by Xavion :


Added file: http://bugs.python.org/file44725/Test-1.py

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-17 Thread Xavion

Xavion added the comment:

I put them into an archive so that the folder hierarchy would be preserved.  
Doing it that way makes it faster for you guys to run the tests at your end.

Nonetheless, I will post the seven (7) files individually as well.  It doesn't 
look like I can upload more than one at a time, so get ready for a few emails!

--
Added file: http://bugs.python.org/file44723/Memory-Leak-Test.zip

___
Python tracker 

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



[issue27354] SSLContext.load_verify_locations cannot handle paths on Windows which cannot be encoded using mbcs

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

I haven't tracked it down in 1.1, but in 1.0.2 OpenSSL handles ASCII, UTF-8 and 
mbcs/ANSI paths explicitly: 
https://github.com/openssl/openssl/blob/OpenSSL_1_0_2-stable/crypto/bio/bss_file.c#L138

So for 3.6 and later, if we're encoding the paths with fsencode(), it'll be 
fine, but we could also use utf-8 unconditionally.

Doing a search of the codebase though, there's only the one place that does 
this and everywhere else just uses fopen() without attempting to decode. I 
don't think we're exposing many of those publicly though.

--

___
Python tracker 

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



[issue28191] Support RFC4985 SRVName in SAN name

2016-09-17 Thread Christian Heimes

Changes by Christian Heimes :


--
keywords: +patch
Added file: http://bugs.python.org/file44722/Add-RFC4985-SRVName-to-SAN.patch

___
Python tracker 

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



[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

The fix here was changing "n > 0 && buf[len] == '\x1a'" into "n == 0 || 
buf[len] == '\x1a'" when returning an empty bytes. Previously we were falling 
into the conversion code which wasn't happy with n == 0.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue28164] _PyIO_get_console_type fails for various paths

2016-09-17 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> fixed
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue28163] WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle

2016-09-17 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue28161] Opening CON for write access fails

2016-09-17 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> fixed
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

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



[issue28161] Opening CON for write access fails

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d0bab9fda568 by Steve Dower in branch '3.6':
Issue #28161: Opening CON for write access fails
https://hg.python.org/cpython/rev/d0bab9fda568

New changeset 187a114b9ef4 by Steve Dower in branch 'default':
Issue #28161: Opening CON for write access fails
https://hg.python.org/cpython/rev/187a114b9ef4

--
nosy: +python-dev

___
Python tracker 

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



[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d0bab9fda568 by Steve Dower in branch '3.6':
Issue #28161: Opening CON for write access fails
https://hg.python.org/cpython/rev/d0bab9fda568

New changeset 187a114b9ef4 by Steve Dower in branch 'default':
Issue #28161: Opening CON for write access fails
https://hg.python.org/cpython/rev/187a114b9ef4

--
nosy: +python-dev

___
Python tracker 

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



[issue28164] _PyIO_get_console_type fails for various paths

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d0bab9fda568 by Steve Dower in branch '3.6':
Issue #28161: Opening CON for write access fails
https://hg.python.org/cpython/rev/d0bab9fda568

New changeset 187a114b9ef4 by Steve Dower in branch 'default':
Issue #28161: Opening CON for write access fails
https://hg.python.org/cpython/rev/187a114b9ef4

--
nosy: +python-dev

___
Python tracker 

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



[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-17 Thread Xavion

Changes by Xavion :


Removed file: http://bugs.python.org/file44708/Memory-Leak-Test.zip

___
Python tracker 

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



[issue28163] WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d0bab9fda568 by Steve Dower in branch '3.6':
Issue #28161: Opening CON for write access fails
https://hg.python.org/cpython/rev/d0bab9fda568

New changeset 187a114b9ef4 by Steve Dower in branch 'default':
Issue #28161: Opening CON for write access fails
https://hg.python.org/cpython/rev/187a114b9ef4

--
nosy: +python-dev

___
Python tracker 

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



[issue10109] itertools.product with infinite iterator cause MemoryError.

2016-09-17 Thread Tim Peters

Tim Peters added the comment:

I see nothing wrong with combinatorial generators materializing their inputs 
before generation.  Perhaps it should be documented clearly.  It's certainly 
not limited to `product()`.  For example,

>>> for i in itertools.combinations(itertools.count(), 2):
... print(i)

dies with MemoryError too.  But I expected that ;-)

--
nosy: +tim.peters

___
Python tracker 

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



[issue16293] curses.ungetch raises OverflowError when given -1

2016-09-17 Thread Berker Peksag

Berker Peksag added the comment:

This looks like a bug in ncurses 5.7 and a duplicate of issue 15037.

--
nosy: +berker.peksag
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> curses.unget_wch and test_curses fail when linked with ncurses 
5.7 and earlier
type:  -> behavior

___
Python tracker 

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



[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

Unfortunately, very hard to test this because it requires interacting with an 
actual console. But it's an easy fix.

--
assignee:  -> steve.dower
stage: test needed -> needs patch

___
Python tracker 

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



[issue28163] WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

I'll pass the "correct" flags, since the docs don't specify that they aren't 
used, which means one day they might become relevant.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue28164] _PyIO_get_console_type fails for various paths

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

I'll make it case insensitive, but unfortunately I can't find a good way to 
check that a handle is actually a real console handle or what type it is. Plus 
the way iomodule is designed we'd need to open it twice, which I'd rather not 
do.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-09-17 Thread Berker Peksag

Changes by Berker Peksag :


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

___
Python tracker 

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



[issue28193] Consider using lru_cache for the re.py caches

2016-09-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Since that time the logic of re._compile() was changed. Now it can't just be 
wrapped with lru_cache().

--

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 78efbf499611 by Berker Peksag in branch '3.5':
Issue #26384: Fix UnboundLocalError in socket._sendfile_use_sendfile
https://hg.python.org/cpython/rev/78efbf499611

New changeset 2156aa4050c7 by Berker Peksag in branch '3.6':
Issue #26384: Merge from 3.5
https://hg.python.org/cpython/rev/2156aa4050c7

New changeset 0d440fda8604 by Berker Peksag in branch 'default':
Issue #26384: Merge from 3.6
https://hg.python.org/cpython/rev/0d440fda8604

--
nosy: +python-dev

___
Python tracker 

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



[issue10109] itertools.product with infinite iterator cause MemoryError.

2016-09-17 Thread Robert Xiao

Robert Xiao added the comment:

I think this _is_ a bug. Most of the itertools are quite thrifty with memory, 
and exceptions are explicitly documented.

The itertools generally only require memory proportional to the number of 
iterations consumed. However, `itertools.product` requires an enormous up-front 
memory cost even if only a few iterations are performed. There are good reasons 
to extract only a few iterations from a `product` - for example, a search 
procedure where only the first item in the product is infinite:

for year, day in product(count(2010), range(365)):
if rare_event(year, day):
break

Or, in an application I recently tried, to count occurrences of something up to 
a limit:

prod = product(count(), range(n))
filtered = ifilter(pred, prod)
want = list(islice(filtered, 101))
if len(want) > 100:
print "Too many matches"

Having `product` greedily consume all of its input iterators is rather 
antithetical to the notion of itertools being lazy generators, and it breaks 
efficient composability with the other itertools.

The fix should be fairly straightforward: like tee, maintain lists of items 
already generated as the input iterators are exhausted, and add a note that 
"product"'s memory usage may slowly grow over time (as opposed to growing to 
maximum size immediately).

--
nosy: +nneonneo

___
Python tracker 

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



[issue24416] Return a namedtuple from date.isocalendar()

2016-09-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1 This looks like a reasonable and useful API improvement.

--
nosy: +rhettinger

___
Python tracker 

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



[issue28193] Consider using lru_cache for the re.py caches

2016-09-17 Thread Raymond Hettinger

New submission from Raymond Hettinger:

The last time we applied the LRU cache to the re.py module, the overhead of the 
pure python version resulted in a net performance decrease.  But now we have a 
highly performance C version and should consider reinstating the code.

--
assignee: serhiy.storchaka
components: Library (Lib)
messages: 276832
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Consider using lru_cache for the re.py caches
type: performance
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue28192] Don't import readline in isolated mode

2016-09-17 Thread Christian Heimes

Christian Heimes added the comment:

The robot didn't mention your merge because the tracker id was not in the 
submit messages. I just saw it on python-cvs.

How about a test in subprocess? You could drop a readline.py into 
Lib/tests/somedirectory and run sys.executable with 
cwd='Lib/tests/somedirectory').

--

___
Python tracker 

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



[issue28192] Don't import readline in isolated mode

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

Also, I think PEP 432 is the way to go about simplifying Py_Main, and I'm keen 
to see it happen (presumably for 3.7). But the time constraints make it hard, 
which is why Nick hasn't gotten it done yet either.

--

___
Python tracker 

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



[issue28192] Don't import readline in isolated mode

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

The NEWS change slipped into my following commit, and I just did the one merge.

Since you're here, any ideas on how to test this? Adding a readline.py during 
the test suite will affect any tests running in parallel...

--

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-09-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Yes, I missed seeing that.

--

___
Python tracker 

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



[issue28192] Don't import readline in isolated mode

2016-09-17 Thread Christian Heimes

Changes by Christian Heimes :


--
components: +Interpreter Core
type: behavior -> security

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-09-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--

___
Python tracker 

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



[issue28192] Don't import readline in isolated mode

2016-09-17 Thread Christian Heimes

Christian Heimes added the comment:

+1, but your patch is missing Misc/NEWS and a merge to 'default'. The code in 
Modules/main.c is getting harder to read, too.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-09-17 Thread Berker Peksag

Changes by Berker Peksag :


Added file: http://bugs.python.org/file44721/issue26384_v3.diff

___
Python tracker 

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



[issue28137] Windows sys.path file should be renamed

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

Decided to go with "DLLNAME._pth" or "EXENAME._pth", since using ".pth" with 
"import site" causes files to be reevaluated.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue28138] Windows _sys.path file should allow import site

2016-09-17 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue28137] Windows sys.path file should be renamed

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7b47c98f24da by Steve Dower in branch '3.6':
Issue #28137: Renames Windows path file to ._pth
https://hg.python.org/cpython/rev/7b47c98f24da

--
nosy: +python-dev

___
Python tracker 

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



[issue28192] Don't import readline in isolated mode

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b0350f351752 by Steve Dower in branch '3.6':
Issue #28192: Don't import readline in isolated mode
https://hg.python.org/cpython/rev/b0350f351752

--
nosy: +python-dev

___
Python tracker 

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



[issue28138] Windows _sys.path file should allow import site

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7b47c98f24da by Steve Dower in branch '3.6':
Issue #28137: Renames Windows path file to ._pth
https://hg.python.org/cpython/rev/7b47c98f24da

--
nosy: +python-dev

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-09-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Dict iterators already have __length_hint__. Dict views have __len__.

--

___
Python tracker 

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



[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-09-17 Thread Berker Peksag

Berker Peksag added the comment:

Thanks, Serhiy. Here's an updated patch.

--
versions: +Python 3.7
Added file: http://bugs.python.org/file44720/issue26384_v2.diff

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-09-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Also consider adding __length_hint__ to the various mapping views.  That would 
help with a common case of listing the view.

--

___
Python tracker 

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



[issue5309] distutils doesn't parallelize extension module compilation

2016-09-17 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

I have 2 complaints about this:

1 - doc is missing: the only way to be aware of this is either by reading the 
3.6 what's new doc or by checking the cmdline helper

2 - -j "N" parameter could be optional: if not specified os.cpu_count() can be 
used.

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue28192] Don't import readline in isolated mode

2016-09-17 Thread Steve Dower

Steve Dower added the comment:

Should also allow users to explicitly call site.enablerlcompleter() if they 
really want it.

--

___
Python tracker 

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



[issue27111] redundant variables in long_add and long_sub

2016-09-17 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue27111] redundant variables in long_add and long_sub

2016-09-17 Thread Mark Dickinson

Mark Dickinson added the comment:

Applied; thanks. (I left the braces in, following PEP 7 ("braces are strongly 
preferred").

--
nosy: +mark.dickinson
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue27111] redundant variables in long_add and long_sub

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0e585bce0bb1 by Mark Dickinson in branch 'default':
Issue #27111: Minor simplication to long_add and long_sub fast path code. 
Thanks Oren Milman.
https://hg.python.org/cpython/rev/0e585bce0bb1

--
nosy: +python-dev

___
Python tracker 

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



[issue28192] Don't import readline in isolated mode

2016-09-17 Thread Steve Dower

New submission from Steve Dower:

When running in isolated mode, readline should not be automatically imported 
(as it could conceivably be arbitrary code).

--
assignee: steve.dower
messages: 276816
nosy: steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: Don't import readline in isolated mode
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue27441] redundant assignments to ob_size of new ints that _PyLong_New returned

2016-09-17 Thread Mark Dickinson

Changes by Mark Dickinson :


--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue27441] redundant assignments to ob_size of new ints that _PyLong_New returned

2016-09-17 Thread Mark Dickinson

Mark Dickinson added the comment:

Changes to PyLong_FromUnsignedLong and PyLong_FromUnsignedLongLong applied. 
I've left the others; for the small int initialisation, that code isn't 
performance critical anyway, and I'm not entirely comfortable with assuming 
that PyObject_INIT_VAR will always handle negative sizes correctly. (The 
(ab)use of the sign bit of the ob_size field is something that's particular to 
the int type.)

--

___
Python tracker 

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



[issue27441] redundant assignments to ob_size of new ints that _PyLong_New returned

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 27a6ecf84f72 by Mark Dickinson in branch 'default':
Issue #27441: Remove some redundant assignments to ob_size in longobject.c. 
Thanks Oren Milman.
https://hg.python.org/cpython/rev/27a6ecf84f72

--
nosy: +python-dev

___
Python tracker 

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



[issue27441] redundant assignments to ob_size of new ints that _PyLong_New returned

2016-09-17 Thread Mark Dickinson

Mark Dickinson added the comment:

> Am I missing anything that might cause my patches to introduce a performance 
> penalty?

It's at least conceivable that code like

   Py_SIZE(v) = negative ? -ndigits : ndigits;

might be compiled to something branchless on some platforms (with some sets of 
compiler flags). The assembly you show demonstrates that that doesn't happen on 
your machine, but that doesn't say anything about other current or future 
machines.

I also prefer the original form for readability; so I agree with Serhiy that we 
shouldn't change it without evidence that the change improves performance.

I'll remove the two obviously redundant `Py_SIZE(v) = ...` operations in 
PyLong_FromUnsignedLong and PyLong_FromUnsignedLongLong.

--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue24780] difflib.ndiff produces unreadable output when input missing trailing newline

2016-09-17 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +loewis, tim.peters

___
Python tracker 

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



[issue28178] allow to cache_clear(some_key) in lru_cache

2016-09-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FYI, here is a starting point for rolling your own variants.  The OrderedDict 
makes this effortless.  http://pastebin.com/LDwMwtp8

--

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-09-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch Xiang Zhang! I missed this point. Here is fixed patch.

$ ./python -m perf timeit -s "d = dict.fromkeys(range(10**6))" -- "list(d)"
Python 3.5:Median +- std dev: 33.8 ms +- 0.7 ms
Python 3.6 unpatched:  Median +- std dev: 37.8 ms +- 0.5 ms
Python 3.6 patched:Median +- std dev: 34.0 ms +- 0.6 ms

$ ./python -m perf timeit -s "d = dict.fromkeys(range(10**6)); v = d.values()" 
-- "list(v)"
Python 3.5:Median +- std dev: 26.2 ms +- 0.7 ms
Python 3.6 unpatched:  Median +- std dev: 28.0 ms +- 0.6 ms
Python 3.6 patched:Median +- std dev: 26.1 ms +- 0.8 ms

$ ./python -m perf timeit -s "d = dict.fromkeys(range(10**6)); v = d.items()" 
-- "list(v)"
Python 3.5:Median +- std dev: 232 ms +- 6 ms
Python 3.6 unpatched:  Median +- std dev: 259 ms +- 6 ms
Python 3.6 patched:Median +- std dev: 249 ms +- 6 ms

$ ./python -m perf timeit -s "d = dict.fromkeys(range(10**6))" -- "set(d)"
Python 3.5:Median +- std dev: 68.3 ms +- 1.8 ms
Python 3.6 unpatched:  Median +- std dev: 68.1 ms +- 2.5 ms
Python 3.6 patched:Median +- std dev: 63.7 ms +- 1.5 ms

$ ./python -m perf timeit -s "from _testcapi import test_dict_iteration as t" 
-- "t()"
Python 3.5:Median +- std dev: 3.31 ms +- 0.10 ms
Python 3.6 unpatched:  Median +- std dev: 3.51 ms +- 0.09 ms
Python 3.6 patched:Median +- std dev: 3.43 ms +- 0.05 ms

--
Added file: http://bugs.python.org/file44719/dict_iter2.patch

___
Python tracker 

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



[issue28191] Support RFC4985 SRVName in SAN name

2016-09-17 Thread Christian Heimes

New submission from Christian Heimes:

The standard subject alternative DNS name contains only a relationship between 
a cert and a host name. A host may have multiple services like HTTPS web 
server, IMAP server, mail servers etc. https://tools.ietf.org/html/rfc4985 
defines a mechanism to define a relationship between a X.509 cert, a DNS name 
and a service, e.g. _https.www.example.org for service https on www.example.org.

OpenSSL is not yet able to convert a RFC4985 SRVName to a string. I have a 
patch, https://github.com/tiran/cpython/commits/feature/ssl_srvname

--
assignee: christian.heimes
components: SSL
messages: 276810
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: Support RFC4985 SRVName in SAN name
type: security
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue28179] Segfault in test_recursionlimit_fatalerror

2016-09-17 Thread Terry J. Reedy

Terry J. Reedy added the comment:

And the test passes on Windows on both versions.

--

___
Python tracker 

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



[issue28179] Segfault in test_recursionlimit_fatalerror

2016-09-17 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I also got the same result on 3.5 as 3.6.

--

___
Python tracker 

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



[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2016-09-17 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Hmmm, I don't know why Rietveld failed to recognize changes in configure. Maybe 
it's because I've modified the patch file manually?

--

___
Python tracker 

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




[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2016-09-17 Thread Chi Hsuan Yen

New submission from Chi Hsuan Yen:

In changeset 919259054621 (from issue12567) and 707761d59a4a (from issue15268), 
/usr/include/ncursesw was added to include paths in setup.py and configure.ac. 
This is wrong and breaks cross-compiling. For example, if   host has 
/usr/include/ncursesw/ncurses.h and target has $SYSROOT/include/ncurses.h, the 
build fails. An example can be found in [1].

My patch removes all references to /usr/include/ncursesw and uses a robust 
detection, which is suitable for both native builds and cross builds.

Added the authors of aforementioned changesets.

[1] https://s3.amazonaws.com/archive.travis-ci.org/jobs/159936249/log.txt

--
components: Build, Cross-Build
files: ncurses.patch
keywords: patch
messages: 276806
nosy: Alex.Willmer, Chi Hsuan Yen, doko, haypo
priority: normal
severity: normal
status: open
title: Cross-build _curses failed if host ncurses headers and target ncurses 
headers have different layouts
type: compile error
versions: Python 3.7
Added file: http://bugs.python.org/file44718/ncurses.patch

___
Python tracker 

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



[issue28178] allow to cache_clear(some_key) in lru_cache

2016-09-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with Nick that the API needs to be relatively simple.

The availability of a fast ordered dictionary now makes it very easy for people 
to roll their own customizations.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue28178] allow to cache_clear(some_key) in lru_cache

2016-09-17 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue27222] redundant checks and a weird use of goto statements in long_rshift

2016-09-17 Thread Mark Dickinson

Mark Dickinson added the comment:

Thanks for the patch and the thorough analysis!

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

___
Python tracker 

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



[issue27222] redundant checks and a weird use of goto statements in long_rshift

2016-09-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 21b70c835b5b by Mark Dickinson in branch 'default':
Issue #27222: various cleanups in long_rshift. Thanks Oren Milman.
https://hg.python.org/cpython/rev/21b70c835b5b

--
nosy: +python-dev

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-09-17 Thread Jim Fulton

Jim Fulton added the comment:

Yes, that change addresses this issue. Thanks!

Will this be backported?

--
resolution:  -> fixed

___
Python tracker 

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



[issue28189] dictitems_contains swallows compare errors

2016-09-17 Thread Xiang Zhang

New submission from Xiang Zhang:

Now, when compare errors raised during `in`, dict.keys(), dict.values() and set 
all propagate the errors. But dict.items() will swallow the errors(only key 
compare):

>>> class BadEq:
... def __hash__(self):
... return 7
... def __eq__(self, other):
... raise RuntimeError
... 
>>> k1, k2, v1, v2 = BadEq(), BadEq(), BadEq(), BadEq()
>>> d = {k1: v1}
>>> k2 in d.keys()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 5, in __eq__
RuntimeError
>>> v2 in d.values()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 5, in __eq__
RuntimeError
>>> k2 in {k1}
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 5, in __eq__
RuntimeError
>>> (k2, v2) in d.items()
False
>>> (k2, v1) in d.items()
False

dictitems_contains.patch tries to fix this.

--
components: Interpreter Core
files: dictitems_contains.patch
keywords: patch
messages: 276801
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: dictitems_contains swallows compare errors
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44717/dictitems_contains.patch

___
Python tracker 

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



[issue28178] allow to cache_clear(some_key) in lru_cache

2016-09-17 Thread Nick Coghlan

Nick Coghlan added the comment:

I'm wary of adding too much complexity to the standard cache API, especially 
when it's something that isn't found in 
http://boltons.readthedocs.io/en/latest/cacheutils.html either.

I do think it could be a good idea to provide some "See Also" links to 
alternate caching libraries for folks that are looking for features that 
standard implementation doesn't provide.

--

___
Python tracker 

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



[issue26149] Suggest PyCharm Community as an editor for Unix platforms

2016-09-17 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Forgot to change the title to Editors and IDEs.
Updated now.

Thanks.

--
Added file: http://bugs.python.org/file44716/docupdate4.patch

___
Python tracker 

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



[issue26149] Suggest PyCharm Community as an editor for Unix platforms

2016-09-17 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks for the feedback, Berker :)
I added some introductory statements, and added link to 
https://wiki.python.org/moin/IntegratedDevelopmentEnvironments

I'll be open to other suggestions as well

Thanks.

--
Added file: http://bugs.python.org/file44715/docupdate3.patch

___
Python tracker 

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



[issue28188] os.putenv should support bytes arguments on Windows

2016-09-17 Thread Eryk Sun

Changes by Eryk Sun :


--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file44714/issue_28188_01.patch

___
Python tracker 

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



[issue28188] os.putenv should support bytes arguments on Windows

2016-09-17 Thread Eryk Sun

New submission from Eryk Sun:

This suggestion may be controversial: os.putenv should decode bytes arguments 
as UTF-8, the new Windows filesystem encoding. Moreover, os.environb should 
also be implemented. This would be consistent with bytes support in os.spawnve 
and os.execve.

The controversial aspect, I think, is that this doesn't allow using arbitrary 
encodings for environment-variable names and values. The statement in the docs 
that os.environb allows one "to use a different encoding" than the filesystem 
encoding would have to be modified with a caveat that on wide-character 
platforms, such as Windows, using the filesystem encoding is mandatory.

--
messages: 276797
nosy: eryksun
priority: normal
severity: normal
stage: needs patch
status: open
title: os.putenv should support bytes arguments on Windows
type: enhancement
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-17 Thread Xiang Zhang

Xiang Zhang added the comment:

Victor, v3 now applies your suggestion.

--
Added file: http://bugs.python.org/file44713/issue28123_v3.patch

___
Python tracker 

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



[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-09-17 Thread Sohaib Ahmad

Sohaib Ahmad added the comment:

I finally found the actual problem causing the failure of second download. 
urlretrieve() works with FTP in PASV mode, and in PASV mode after sending the 
file to client, the FTP server sends an ACK that the file has been transferred. 
After the fix of issue1067702 socket was being closed without receiving this 
ACK.

Now, when a user tries to download the same file or another file from same 
directory, the key (host, port, dirs) remains the same so open_ftp() skips ftp 
initialization. Because of this skipping, previous FTP connection is reused and 
when new commands are sent to the server, server first sends the previous ACK. 
This causes a domino effect and each response gets delayed by one and we get an 
exception from parse227().

Expected response:
*cmd* 'RETR Contents-udeb-ppc64el.gz'
*resp* '150 Opening BINARY mode data connection for 
Contents-udeb-ppc64el.gz (26555 bytes).'
*resp* '226 Transfer complete.'

*cmd* 'TYPE I'
*resp* '200 Switching to Binary mode.'
*cmd* 'PASV'
*resp* '227 Entering Passive Mode (130,239,18,173,137,59).'

Actual response:
*cmd* 'RETR Contents-udeb-ppc64el.gz'
*resp* '150 Opening BINARY mode data connection for 
Contents-udeb-ppc64el.gz (26555 bytes).'

*cmd* 'TYPE I'
*resp* '226 Transfer complete.'
*cmd* 'PASV'
*resp* '200 Switching to Binary mode.'

I am attaching a new patch (urllib.patch) which fixes this problem by clearing 
the FTP server responses first if an existing connection is being used to 
download a file. Please review and let me know if it looks good.

--
Added file: http://bugs.python.org/file44712/urllib.patch

___
Python tracker 

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



[issue27973] urllib.urlretrieve() fails on second ftp transfer

2016-09-17 Thread Sohaib Ahmad

Changes by Sohaib Ahmad :


Removed file: http://bugs.python.org/file44692/urllib.patch

___
Python tracker 

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



  1   2   >