[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-08-17 Thread Xiang Zhang

Xiang Zhang added the comment:

Victor, upload a new patch, changing the test case to the approach you prefer. 
;)

--
Added file: http://bugs.python.org/file44137/issue27558_v3.patch

___
Python tracker 

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



[issue27714] some test_idle tests are not re-runnable, producing false failures with regrtest -w option

2016-08-17 Thread Ned Deily

Ned Deily added the comment:

"Could you try the comment out test of macosx call for test_autocomplete 
(around line 30 to 35) in 2.7 and 3.5?"

Commenting out the mac.setupApp call in the test setup class did not appear to 
affect the running of the tests for either 2.7 or 3.5.

--

___
Python tracker 

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



[issue27598] Add SizedIterable to collections.abc and typing

2016-08-17 Thread Guido van Rossum

Guido van Rossum added the comment:

Ping -- I'd really like to see this happening, with "Collection" as the name.

--

___
Python tracker 

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



[issue27506] make bytes/bytearray delete a keyword argument

2016-08-17 Thread Martin Panter

Martin Panter added the comment:

I can look at enhancing the tests at some stage, but it isn’t a high priority 
for me.

Regarding translate() with no arguments, it makes sense if you see it as a kind 
of degenerate case of neither using a translation table, nor any set of bytes 
to delete:

x.translate() == x.translate(None, b"")

I admit it reads strange and probably isn’t useful. If people dislike it, it 
might be easiest to just add the keyword support and keep the first parameter 
as mandatory:

without_nulls = bytes_with_nulls.translate(None, delete=b"\x00")

--

___
Python tracker 

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



[issue27789] test_asyncio Resource Warnings

2016-08-17 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue27749] multprocessing errors on Windows: WriteFile() argument 1 must be int, not None; OSError: handle is closed

2016-08-17 Thread wevsty

wevsty added the comment:

A similar situation also occurs in the following Linux,A similar situation on 
stackoverflow

http://stackoverflow.com/questions/29277150/python-3-4-multiprocessing-bug-on-lock-acquire-typeerror-integer-required

--

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-17 Thread David Hagen

David Hagen added the comment:

> Secondarily, the doesn't seem to be any use case that can't be readily 
> covered by the existing classes.

The use case that doesn't have a clean interface in 3.5 at the moment is the 
most common use case of enums: just a collection of named objects of given 
type; I don't care about the values because they don't really have values apart 
from their object identities.

When writing enums in Rust, Swift, C#, etc., the bare identifier not only saves 
typing--it allows the developer to explicitly indicate that the underlying 
value has no meaning. (It may be better to use "object()" rather than an 
integer on AutoEnum, but that is not very important.)

It was said that Python has this feature already:

> Yes, Python 3.4 too: Animal = Enum('Animal', 'ant bee cat dog')

I will concede that this can do what I want. I hope others will concede that 
this is not a clean interface. The class name is duplicated and the members are 
regexed out of a space-delimited string. This same argument could be made to 
deprecate the unnecessary "class" keyword in favor of the "type" function.

I will also concede that there is some deep magic going on in AutoEnum and that 
magic should be avoided when it obscures. I personally think the only people 
who will be truly surprised will be those who already know Python at a deep 
enough level to know that deep magic must be required here. Everyone else will 
see "Enum" and a list of bare identifiers, and correctly conclude that this is 
your basic enum from everyone other language.

Perhaps an ideal solution would be an enum keyword:

enum PrimaryColor:
red
blue
green

But that's not happening ever.

The next best solution is the current implementation:

class PrimaryColor(AutoEnum):
red
blue
green

But because of the magic, it only barely beats out what I think is the other 
great solution already mentioned here:

class PrimaryColor(AutoEnum):
red = ()
blue = ()
green = ()

These two solutions are isomorphic. Both save the developer from having to 
provide a (possibly meaningless) value. Both let docstrings be added. Both 
provide the ability to reorganize without renumbering. The last one trades 
magic for boilerplate.

I'll keep using them from the aenum package if they don't make it into 3.6, but 
I think this is a fundamental enough construct that it belongs in the standard 
library. It is hard to convince tool maintainers to fully support these until 
they are blessed here.

--
nosy: +David Hagen

___
Python tracker 

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



[issue27643] test_ctypes fails on AIX with xlc

2016-08-17 Thread Martin Panter

Changes by Martin Panter :


--
stage:  -> patch review

___
Python tracker 

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



[issue27643] test_ctypes fails on AIX with xlc

2016-08-17 Thread Martin Panter

Martin Panter added the comment:

Michael, byref() is just a helper for passing an object’s address to a C 
function. Calling func(byref(b), ...) in Python is equivalent to the C code

unpack_bitfields(, ...)

I still think the root problem is in unpack_bitfields(). When compiled with 
XLC, your experiments confirm that it always returns unsigned values, and with 
GCC, it returns signed values.

It looks like you can detect XLC with the __IBMC__ and __xlC__ macros (not sure 
if there is a practical difference). So perhaps we can fix this with

#ifndef __xlC__

--

___
Python tracker 

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



[issue27787] Avoid test_main() in test_httplib; gc.collect() dangling threads

2016-08-17 Thread Martin Panter

Martin Panter added the comment:

Yes I agree it would make sense to separate the test_httplib changes from the 
general change. I thought this task would be a very easy change, and noticed it 
wasn’t that simple the last minute.

I would like to adjust the cleanup call to

self.addCleanup(thread.join, float(1))

That should be a better equivalent to what @reap_threads does. Or I can just 
use @reap_threads directly on test_response_fileno(), if people prefer.

--

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 617104a6b759 by Alexander Belopolsky in branch 'default':
Issue #24773: Include Tallinn 1999-10-31 transition in tests.
https://hg.python.org/cpython/rev/617104a6b759

--

___
Python tracker 

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



[issue27791] test_threading: test_threads_join_2() failed with "Fatal Python error: Py_EndInterpreter: not the last thread"

2016-08-17 Thread Martin Panter

Martin Panter added the comment:

I just happened to notice this failure on 3.5 as well:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.5/builds/791/steps/test/logs/stdio

--
nosy: +martin.panter
versions: +Python 3.5

___
Python tracker 

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



[issue27784] Random failure of test_TCPServer() of test.test_socketserver.SocketServerTest and test_handle_accept() of test.test_asyncore.TestAPI_UseIPv6Select on FreeBSD buildbots

2016-08-17 Thread Martin Panter

Martin Panter added the comment:

I think I have seen these kind of errors pop up randomly on various tests on 
Free BSD buildbots (at least in the last few months or so).

Are the buildbots so overloaded that they drop localhost connections? Or are 
localhost TCP connections generally just that unreliable on Free BSD? Or is 
something else going on? I’m not faimilar with the OS.

This only seems to affect 3.6, not the equivalent 3.5 buildbot.

--
nosy: +martin.panter
versions: +Python 3.6

___
Python tracker 

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



[issue18295] Possible integer overflow in PyCode_New()

2016-08-17 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue27780] memory leaks in pgen build step abort build with address sanitizer enabled

2016-08-17 Thread Ned Deily

Ned Deily added the comment:

OK, that's not unreasonable and I see there have been earlier issues opened and 
addressed for similar problems (e.g. Issue18695).  Perhaps someone will want to 
dive in.

--
resolution: wont fix -> 
stage: resolved -> needs patch
status: closed -> open
title: Memory leak during Python build (from git c3ff7e7) on Debian 8.5 x64 -> 
memory leaks in pgen build step abort build with address sanitizer enabled
versions: +Python 3.6

___
Python tracker 

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



[issue27790] test_distutils spews linker messages on Windows

2016-08-17 Thread Steve Dower

Steve Dower added the comment:

It certainly looks like more than we used to get...

Ideally we'd capture the output from the build process and only write it out if 
the test failed. I'm not entirely sure why that isn't happening here. The 
warnings themselves are harmless (you get a nearly identical warning if you 
*don't* put /LTCG on the command line and need it - I'd guess there was a 
stalemate between two factions on the compiler team at some point and they 
resolved it with this warning).

--

___
Python tracker 

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



[issue26750] Mock autospec does not work with subclasses of property()

2016-08-17 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
stage: commit review -> resolved

___
Python tracker 

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



[issue27780] Memory leak during Python build (from git c3ff7e7) on Debian 8.5 x64

2016-08-17 Thread geeknik

geeknik added the comment:

FYI, I was only able to build Python with ASAN by passing 
ASAN_OPTIONS=detect_leaks=0 along with the make command, otherwise ASAN wanted 
to stop the build process as soon as it detected this leak.

--

___
Python tracker 

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



[issue26750] Mock autospec does not work with subclasses of property()

2016-08-17 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

inspect.isdatadescriptor() is better indeed.
(I was initially working on an old version of mock.py which does not import 
inspect, and I did not want to add the dependency there).

- inspect uses hasattr(type(obj)) instead of hasatr(obj). This is better, (but 
does not work for 2.x old-style classes)

- my patch tested for __del__... this is completely wrong, it should have been 
__delete__. oops.
inspect.isdatadescriptor() does not test for __delete__. This is insaccurate, 
but I doubt it will ever matter. This is only possible for Python-defined 
descriptors, the C implementation always exposes both __set__ and __delete__ 
when tp_set is filled.

IOW, I'm happy with the current state.

--

___
Python tracker 

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



[issue27780] Memory leak during Python build (from git c3ff7e7) on Debian 8.5 x64

2016-08-17 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report but, AFAIK, pgen is only used during the build of Python 
and pgen is not installed (by "make install").  This doesn't seem like it is 
worth worrying about.  Or am I missing something?  Feel free to reopen if so or 
if someone comes up with a patch.

--
nosy: +ned.deily
priority: normal -> low
resolution:  -> wont fix
stage:  -> 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



[issue27791] test_threading: test_threads_join_2() failed with "Fatal Python error: Py_EndInterpreter: not the last thread"

2016-08-17 Thread STINNER Victor

New submission from STINNER Victor:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.x/builds/4769/steps/test/logs/stdio

0:00:46 [ 41/402] test_threading crashed
Fatal Python error: Py_EndInterpreter: not the last thread

Current thread 0x000802006400 (most recent call first):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/support/__init__.py",
 line 2445 in run_in_subinterp
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_threading.py",
 line 877 in test_threads_join_2
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/case.py", 
line 600 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/case.py", 
line 648 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/suite.py", 
line 122 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/suite.py", 
line 84 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/suite.py", 
line 122 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/suite.py", 
line 84 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/suite.py", 
line 122 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/suite.py", 
line 84 in __call__
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/runner.py", 
line 176 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/support/__init__.py",
 line 1810 in _run_suite
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/support/__init__.py",
 line 1844 in run_unittest
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/runtest.py",
 line 179 in test_runner
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/runtest.py",
 line 180 in runtest_inner
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/runtest.py",
 line 133 in runtest
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/runtest_mp.py",
 line 71 in run_tests_slave
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/main.py",
 line 472 in _main
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/main.py",
 line 465 in main
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/main.py",
 line 527 in main
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/regrtest.py", 
line 46 in _main
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/regrtest.py", 
line 50 in 
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/runpy.py", line 
85 in _run_code
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/runpy.py", line 
184 in _run_module_as_main
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/runpy.py", line 
184, in _run_module_as_main
"__main__", mod_spec)
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/runpy.py", line 
85, in _run_code
exec(code, run_globals)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/__main__.py", 
line 2, in 
main()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/main.py",
 line 527, in main
Regrtest().main(tests=tests, **kwargs)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/main.py",
 line 465, in main
self._main(tests, kwargs)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/main.py",
 line 485, in _main
self.run_tests()
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/main.py",
 line 413, in run_tests
run_tests_multiprocess(self)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/libregrtest/runtest_mp.py",
 line 221, in run_tests_multiprocess
raise Exception(msg)
Exception: Child error on test_threading: Exit code -6
*** Error code 1

--
components: Tests
keywords: buildbot
messages: 272995
nosy: haypo, koobs
priority: normal
severity: normal
status: open
title: test_threading: test_threads_join_2() failed with "Fatal Python error: 
Py_EndInterpreter: not the last thread"
versions: Python 3.6

___
Python tracker 

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



[issue27594] Assertion failure when running "test_ast" tests with coverage.

2016-08-17 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Ned, thank you for applying the patch!

I have discovered this same issue accidentally while playing with possible 
implementations of PEP 526. It appeared as a failure in
test_sys_settrace in my fork.

--

___
Python tracker 

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



[issue27706] Random.seed, whose purpose is purportedly determinism, behaves non-deterministically with strings due to hash randomization

2016-08-17 Thread Glyph Lefkowitz

Glyph Lefkowitz added the comment:

For what it's worth, I don't much care whether this is fixed or not; I ended up 
wanting to leak less information from the RNG output anyway so I wrote this:

https://gist.github.com/glyph/ceca96100a3049fefea6f2035abbd9ea

but I felt like it should be reported.

--

___
Python tracker 

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



[issue27594] Assertion failure when running "test_ast" tests with coverage.

2016-08-17 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report.  It looks the assert error is triggered by the new test 
case added in 59638baee25e for Issue13436.  Since that test case was only added 
for 3.6, I've only applied Ivan's suggested fix for 3.6 as well, although you 
could trigger the same assert in earlier releases.  Thanks, Ivan!

--
nosy: +ned.deily
resolution:  -> fixed
stage:  -> 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



[issue27790] test_distutils spews linker messages on Windows

2016-08-17 Thread Terry J. Reedy

New submission from Terry J. Reedy:

3.6, Win10, VS recently reinstalled to 'Update 3'.  I believe these messages 
are somewhat new.

0:01:00 [111/402] test_distutils failed (env changed)
xxmodule.c
   Creating library 
C:\Users\Terry\AppData\Local\Temp\tmpbjffnmc3\Debug\Users\Terry\AppData\Local\Temp\tmpbjffnmc3\xx_d.cp36-win32.lib
 and object 
C:\Users\Terry\AppData\Local\Temp\tmpbjffnmc3\Debug\Users\Terry\AppData\Local\Temp\tmpbjffnmc3\xx_d.cp36-win32.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
foo.c
   Creating library 
C:\Users\Terry\AppData\Local\Temp\tmp7302jrpo\tempt\Users\Terry\AppData\Local\Temp\tmp9132twos\foo_d.cp36-win32.lib
 and object 
C:\Users\Terry\AppData\Local\Temp\tmp7302jrpo\tempt\Users\Terry\AppData\Local\Temp\tmp9132twos\foo_d.cp36-win32.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
foo.c
   Creating library 
C:\Users\Terry\AppData\Local\Temp\tmp7302jrpo\tempt\Users\Terry\AppData\Local\Temp\tmp9132twos\foo_d.cp36-win32.lib
 and object 
C:\Users\Terry\AppData\Local\Temp\tmp7302jrpo\tempt\Users\Terry\AppData\Local\Temp\tmp9132twos\foo_d.cp36-win32.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
xxmodule.c
   Creating library 
C:\Users\Terry\AppData\Local\Temp\tmp9hq4ci8e\Debug\Users\Terry\AppData\Local\Temp\tmp9hq4ci8e\xx_d.cp36-win32.lib
 and object 
C:\Users\Terry\AppData\Local\Temp\tmp9hq4ci8e\Debug\Users\Terry\AppData\Local\Temp\tmp9hq4ci8e\xx_d.cp36-win32.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
foo.c
   Creating library 
C:\Users\Terry\AppData\Local\Temp\tmp3qv0ulce\tempt\Users\Terry\AppData\Local\Temp\tmph1jy_aqh\foo_d.cp36-win32.lib
 and object 
C:\Users\Terry\AppData\Local\Temp\tmp3qv0ulce\tempt\Users\Terry\AppData\Local\Temp\tmph1jy_aqh\foo_d.cp36-win32.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
foo.c
   Creating library 
C:\Users\Terry\AppData\Local\Temp\tmp3qv0ulce\tempt\Users\Terry\AppData\Local\Temp\tmph1jy_aqh\foo_d.cp36-win32.lib
 and object 
C:\Users\Terry\AppData\Local\Temp\tmp3qv0ulce\tempt\Users\Terry\AppData\Local\Temp\tmph1jy_aqh\foo_d.cp36-win32.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance
xxmodule.c
   Creating library build\temp.win32-3.6-pydebug\Debug\xx_d.cp36-win32.lib and 
object build\temp.win32-3.6-pydebug\Debug\xx_d.cp36-win32.exp
LINK : /LTCG specified but no code generation required; remove /LTCG from the 
link command line to improve linker performance

F:\Python\dev\36\build\test_python_3596>exit 1

F:\Python\dev\36\build\test_python_3596>exit 0
Warning -- files was modified by test_distutils

--
components: Distutils, Tests, Windows
messages: 272991
nosy: dstufft, eric.araujo, haypo, paul.moore, steve.dower, terry.reedy, 
tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: test_distutils spews linker messages on Windows

___
Python tracker 

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



[issue27746] ResourceWarnings in test_asyncio

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

I marked the issue #272989 as a duplicate of this one. Copy of the msg272986 by 
Terry J. Reedy:

3.6, Windows 10, debug build. The following appeared before and after pulling 
and rebuilding today. I am reporting as per Victor's request on pydev list.

0:00:22 [ 52/402] test_asyncio passed
F:\Python\dev\36\lib\asyncio\sslproto.py:329: ResourceWarning: unclosed 
transport 
  source=self)
F:\Python\dev\36\lib\asyncio\sslproto.py:329: ResourceWarning: unclosed 
transport 
  source=self)
F:\Python\dev\36\lib\asyncio\sslproto.py:329: ResourceWarning: unclosed 
transport 
  source=self)

--

___
Python tracker 

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



[issue27789] test_asyncio Resource Warnings

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

Duplicate of issue #27746.

--
resolution:  -> duplicate
superseder:  -> ResourceWarnings in test_asyncio

___
Python tracker 

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



[issue27706] Random.seed, whose purpose is purportedly determinism, behaves non-deterministically with strings due to hash randomization

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> Changing the affected version to just 2.7.

Oh. The request looks like an enhancement. The problem is that if you add a new 
feature in Python 2.7.n+1, it's not available on Python 2.7.n. Support 2.7.n as 
well, you have to backport the code in your application.

I'm not sure that it's worth to add such enhancement to the random at this 
point in Python 2.

I suggest you to either upgrade to Python 3 (hello, Python 3!) or implement the 
SHA512 in your application. I expect that random.seed() in only called at one 
or maybe two places, so it shouldn't be hard to patch your code ;-)

In short, I suggest to close the issue as wont fix.

--

___
Python tracker 

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



[issue27594] Assertion failure when running "test_ast" tests with coverage.

2016-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1bf307f42a6b by Ned Deily in branch 'default':
Issue #27594: Prevent assertion error when running test_ast with coverage
https://hg.python.org/cpython/rev/1bf307f42a6b

--
nosy: +python-dev

___
Python tracker 

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



[issue27789] test_asyncio Resource Warnings

2016-08-17 Thread Terry J. Reedy

New submission from Terry J. Reedy:

3.6, Windows 10, debug build. The following appeared before and after pulling 
and rebuilding today. I am reporting as per Victor's request on pydev list.

0:00:22 [ 52/402] test_asyncio passed
F:\Python\dev\36\lib\asyncio\sslproto.py:329: ResourceWarning: unclosed 
transport 
  source=self)
F:\Python\dev\36\lib\asyncio\sslproto.py:329: ResourceWarning: unclosed 
transport 
  source=self)
F:\Python\dev\36\lib\asyncio\sslproto.py:329: ResourceWarning: unclosed 
transport 
  source=self)

--
components: Tests, asyncio
messages: 272986
nosy: giampaolo.rodola, gvanrossum, haypo, terry.reedy, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: test_asyncio Resource Warnings
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue27786] longobject.c: simplify x_sub(), inline _PyLong_Negate()

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka: "LGTM."

Oh, you posted your comment while I was pushing the patch after Brett wrote 
LGTM on the review (not on the bug tracker).

> Maybe use size_a instead of Py_SIZE(z)?
> And look at "sign". Currently it takes values 1 and -1. Is it worth to 
> replace it with boolean variable "negative"? Or Py_ssize_t variable size_z 
> that takes values size_a and -size_a?

Hum, I don't know what is the best. I don't think that it has an impact on 
performance. Feel free to modify directly the code, your proposed changes look 
safe and simple enough.

--

___
Python tracker 

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



[issue27788] platform module's version number doesn't match its docstring

2016-08-17 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

That must have been an oversight. __version__ should read '0.8.0'.

--

___
Python tracker 

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



[issue27645] Supporting native backup facility of SQLite

2016-08-17 Thread Cédric Krier

Changes by Cédric Krier :


--
nosy: +ced

___
Python tracker 

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



[issue27574] Faster parsing keyword arguments

2016-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, I came to conclusion than needed to push existing issues for separate 
files. I'm sure there are ready patches waiting for review. Now there is 
additional reason for converting to Argument Clinic. But some files contain 
only one PyArg_ParseTupleAndKeywords(), I think we can convert them in one 
patch.

--

___
Python tracker 

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



[issue18880] ssl.SSLSocket shutdown doesn't behave like socket.shutdown

2016-08-17 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +alex, dstufft, giampaolo.rodola, janssen
versions: +Python 3.6 -Python 2.6, Python 3.1

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> you ran your test script with the -m "run module as script" flag

Right, that was a mistest, so it looks like triple quotes do work.

I did notice that there's also an issue if one line reads, "red='hello'".

But really, the big issue is using a bare-identifier to fiat an attribute into 
existence.  That's a door that really shouldn't be opened.

Secondarily, the doesn't seem to be any use case that can't be readily covered 
by the existing classes.  There is no real need for the witchcraft and the 
departure from Python norms.

--

___
Python tracker 

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



[issue27574] Faster parsing keyword arguments

2016-08-17 Thread Brett Cannon

Brett Cannon added the comment:

I think for converting uses to Argument Clinic it can be done in a more 
iterative process on a per-module basis. How many modules do we have left to 
convert? If it isn't ridiculously huge we could open individual issues to 
convert them each.

--

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Raymond and Victor.

--
resolution:  -> fixed
stage:  -> 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



[issue27574] Faster parsing keyword arguments

2016-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I left this issue open for three reasons.

1. I had ideas and almost finished patch for different optimization. 
Unfortunately my hope was not justified, new implementation is slower. If I 
fail to fix it in few days, I'll close the issue.

2. For bikeshedding in case somebody want to suggest different names or 
interface.

3. I was going to convert most occurrences of PyArg_ParseTupleAndKeywords() to 
Argument Clinic for achieving larger effect of this optimization. But this 
patch was larger than I expected.

--

___
Python tracker 

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



[issue27786] longobject.c: simplify x_sub(), inline _PyLong_Negate()

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for the review Brett, I pushed my fix.

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

___
Python tracker 

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



[issue27782] Multi-phase extension module initialization, inconsistent exceptions and conflicts between code and PEP

2016-08-17 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks Petr. I'd appreciate it if you are willing to review the patch.

Upload a patch to fix this, along with tests and doc updating.

But here is something different. In PEP489, it is explicitly stated that 
"Py_mod_create slot is not responsible for setting import-related attributes 
specified in PEP 451 (such as __name__ or __loader__ ) on the new module". So 
when an object(even ModuleType instances) is returned, it's __name__ attribute 
is not set and we can't rely on it (which means we can't even use 
PyModule_GetNameObject). I then use the name attribute of the spec. Looking 
forward to feedback.

--
keywords: +patch
Added file: http://bugs.python.org/file44136/issue27782.patch

___
Python tracker 

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



[issue27786] longobject.c: simplify x_sub(), inline _PyLong_Negate()

2016-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset be9dc240bf28 by Victor Stinner in branch 'default':
Issue #27786: Simplify x_sub()
https://hg.python.org/cpython/rev/be9dc240bf28

--
nosy: +python-dev

___
Python tracker 

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



[issue27786] longobject.c: simplify x_sub(), inline _PyLong_Negate()

2016-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

Maybe use size_a instead of Py_SIZE(z)?

And look at "sign". Currently it takes values 1 and -1. Is it worth to replace 
it with boolean variable "negative"? Or Py_ssize_t variable size_z that takes 
values size_a and -size_a?

--

___
Python tracker 

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



[issue27755] Retire DynOptionMenu with a ttk Combobox

2016-08-17 Thread Mark Roseman

Mark Roseman added the comment:

Justin, as you say, I think your patch is entirely reasonable as an interim 
step, as eventually doing a broader improvement on the preferences dialog as 
suggested in #24781 makes sense. 

My reworked version used Combobox in similar ways; I think we can safely do 
away with the wrapper class and just use the ttk widget directly in the dialog 
(as the widget already handles the dynamic changes to the list, which the old 
tk_optionMenu didn't)

--

___
Python tracker 

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



[issue27706] Random.seed, whose purpose is purportedly determinism, behaves non-deterministically with strings due to hash randomization

2016-08-17 Thread Glyph Lefkowitz

Glyph Lefkowitz added the comment:

Changing the affected version to just 2.7.

--
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue27706] Random.seed, whose purpose is purportedly determinism, behaves non-deterministically with strings due to hash randomization

2016-08-17 Thread Glyph Lefkowitz

Glyph Lefkowitz added the comment:

It does seem to be stable on python 3, but on python 2.7 it's definitely a 
problem:

$ python -Rc "import random; r=random.Random('abc'); print(''.join(map(str, 
(r.randrange(10) for x in range(10, hash('abc'))"
('9553343809', -1972659830997666042)
$ python -Rc "import random; r=random.Random('abc'); print(''.join(map(str, 
(r.randrange(10) for x in range(10, hash('abc'))"
('5519010739', 5520208254012363023)
$ python -Rc "import random; r=random.Random('abc'); print(''.join(map(str, 
(r.randrange(10) for x in range(10, hash('abc'))"
('7519888435', 3560222494758569319)
$ python -Rc "import random; r=random.Random('abc'); print(''.join(map(str, 
(r.randrange(10) for x in range(10, hash('abc'))"
('9612648103', 4134882069837806740)

--

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-17 Thread Ethan Furman

Ethan Furman added the comment:

Raymond, I appreciate your review and your poll.  I am open to removing 
AutoEnum, but would like to give it a couple more weeks of review.  (I'll post 
on py-dev.)

The only point you made that I will firmly refute is the "unexpected breakage": 
you ran your test script with the -m "run module as script" flag, which is what 
caused the problem.

--

___
Python tracker 

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



[issue27181] Add geometric mean to `statistics` module

2016-08-17 Thread Mark Dickinson

Mark Dickinson added the comment:

> self.assertEqual(self.nroot(x**12, 12), float(x))
> AssertionError: 1.1865 != 1.1868

That looks like a case where the test should simply be weakened to an 
`assertAlmostEqual` with a suitable tolerance; there's no strong reason to 
expect that `nroot` will give a faithfully rounded result in this case or any 
other.

--

___
Python tracker 

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



[issue27786] longobject.c: simplify x_sub(), inline _PyLong_Negate()

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

Updated patch.

--
Added file: http://bugs.python.org/file44135/x_sub-2.patch

___
Python tracker 

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



[issue27785] Module platform: Versions of Windows

2016-08-17 Thread Steve Dower

Steve Dower added the comment:

Platform module version 1.0.8 added support for Windows 8.1 and later. You 
actually downgraded to 1.0.7, which is why you lost functionality.

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

___
Python tracker 

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



[issue27786] longobject.c: simplify x_sub(), inline _PyLong_Negate()

2016-08-17 Thread Brett Cannon

Brett Cannon added the comment:

That works too. :)

--

___
Python tracker 

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



[issue27786] longobject.c: simplify x_sub(), inline _PyLong_Negate()

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> I would add a comment as to why the assertion is there, otherwise it seems 
> somewhat random that it exists.

Hum. Maybe it's even better to remove the assertion :-)

--

___
Python tracker 

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



[issue27786] longobject.c: simplify x_sub(), inline _PyLong_Negate()

2016-08-17 Thread Brett Cannon

Brett Cannon added the comment:

I would add a comment as to why the assertion is there, otherwise it seems 
somewhat random that it exists.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

2016-08-17 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue27785] Module platform: Versions of Windows

2016-08-17 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue27785] Module platform: Versions of Windows

2016-08-17 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue27788] platform module's version number doesn't match its docstring

2016-08-17 Thread Brett Cannon

New submission from Brett Cannon:

Not sure if it's worth keeping the version number around, but ATM the module 
has __version__ set to 1.0.7 while the docstring mentions a 1.0.8.

--
components: Library (Lib)
messages: 272964
nosy: brett.cannon, lemburg
priority: normal
severity: normal
status: open
title: platform module's version number doesn't match its docstring
versions: Python 3.6

___
Python tracker 

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



[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

2016-08-17 Thread Steve Dower

Steve Dower added the comment:

Ah I see, if we end up sticking with MBCS and offering a switch to enable 
UTF-8. In that case, we'll definitely ensure the flag is the same (but I'm 
hopeful we will just make the reliable behavior on Windows the default, so it 
won't matter).

--

___
Python tracker 

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



[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

Steve Dower added the comment:
> By portable, do you mean not using an environment variable?

I mean that "python3 -X utf8" should force sys.getfilesystemencoding()
to UTF-8 on UNIX/BSD, it would ignore the current locale setting.

--

___
Python tracker 

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



[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

2016-08-17 Thread Steve Dower

Steve Dower added the comment:

By portable, do you mean not using an environment variable?

Command line parsing is potentially affected by this on Windows - I'd have to 
look deeper - as command lines are provided as UTF-16. But we may not ever 
expose them as bytes.

I don't even know that this matters on the UNIX/BSD side as the file system 
encoding provided there is correct, no? It's just Windows where the file system 
encoding used for bytes doesn't match what the file system actually uses.

I was afraid a PEP would be necessary out of this, but I want to see how the 
python-dev discussion goes first.

--

___
Python tracker 

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



[issue27731] Opt-out of MAX_PATH on Windows 10

2016-08-17 Thread Steve Dower

Steve Dower added the comment:

No, the flag that we add to the binary is backwards compatible. Earlier 
versions will just ignore it.

--

___
Python tracker 

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



[issue9998] ctypes find_library should search LD_LIBRARY_PATH on Linux

2016-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 385181e809bc by Vinay Sajip in branch 'default':
Closes #9998: Allowed find_library to search additional locations for libraries.
https://hg.python.org/cpython/rev/385181e809bc

--
nosy: +python-dev
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



[issue23591] enum: Add Flags and IntFlags

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> The repr is better -- which patch did you test?

Sorry, I wasn't clear. I didn't test any patch :-) I expect (not
expected) better repr when changes will be applied, it's just a
remark...

--

___
Python tracker 

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



[issue27782] Multi-phase extension module initialization, inconsistent exceptions and conflicts between code and PEP

2016-08-17 Thread Petr Viktorin

Petr Viktorin added the comment:

Hi! I'm on a tight schedule this week, so I'm not looking into this in detail. 
But please let me know if you need any help and I'll raise the priority.

--

___
Python tracker 

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



[issue23591] enum: Add Flags and IntFlags

2016-08-17 Thread Ethan Furman

Ethan Furman added the comment:

The repr is better -- which patch did you test?

--

___
Python tracker 

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



[issue27787] Avoid test_main() in test_httplib; gc.collect() dangling threads

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

Your patch changes 3 different things. After the code review, I suggest to 
split it in two changes (fix test_httplib threading ripper, fix save_env, fix 
test_httplib main).

--
nosy: +haypo

___
Python tracker 

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



[issue27787] Avoid test_main() in test_httplib; gc.collect() dangling threads

2016-08-17 Thread Martin Panter

New submission from Martin Panter:

In Issue 12319, there are many iterations of a patch that adds a new TestCase 
subclass to Lib/test/test_httplib.py. However it never got run by the main 
regrtest infrastructure, because nobody remembered to add the class to the list 
of test classes. So I want to remove test_main(). It seems this would let the 
classes be automatically discovered (like normal unittest usage).

I understand @reap_threads is to avoid background threads continuing between 
tests (especially when a test fails). I improved the cleanup of the background 
thread in one test. There are three other test methods using 
test.ssl_servers.make_https_server(), which also runs a background thread, but 
that already seems to clean itself up properly, via 
case.addCleanup(server.join).

I found that the test infrastructure randomly complained about dangling threads 
without @reap_threads. It uses a set of weak references to thread objects. The 
solution seems to be to call gc.collect() before checking. This is what 
@reap_threads does, so maybe my patch would eliminate the need for 
@reap_threads in other test files as well. In fact, if everybody called join() 
on their threads, we may be able to eliminate @reap_threads altogether.

--
components: Tests
files: httplib-tests.patch
keywords: patch
messages: 272954
nosy: martin.panter
priority: normal
severity: normal
stage: patch review
status: open
title: Avoid test_main() in test_httplib; gc.collect() dangling threads
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file44134/httplib-tests.patch

___
Python tracker 

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



[issue24853] Py_Finalize doesn't clean up PyImport_Inittab

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

The issue was fixed by a previous change, maybe the issue #27736.

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

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> Raymond, what are your thoughts about the version of AutoEnum that requires 
> that a bare tuple be used as the value.  It has been in the Python docs since 
> 3.4 and was actually the original request of this issue: 
> https://docs.python.org/library/enum.html#autonumber

Well, I suggest to keep it as a recipe in the doc ;-)

--

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> It's not just C that has enums where you can define a unique group of names 
> and omit the values ...

Yes, Python 3.4 too: Animal = Enum('Animal', 'ant bee cat dog')

https://docs.python.org/dev/library/enum.html#functional-api

--

___
Python tracker 

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



[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> I suspect we'll have to go to Guido to get a ruling on the default, but I'll 
> add an environment variable to switch.

If you go in this direction, I would like to follow you for the
UNIX/BSD side to make the switch portable. I was thinking about "-X
utf8" which avoids to change the command line parser.

If we agree on a plan, I would like to write it down as a PEP since I
expect a lot of complains and questions which I would prefer to only
answer once (see for example the length of your thread on python-ideas
where each people repeated the same things multiple times ;-))

--

___
Python tracker 

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



[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> Is there a surrogatepass option?

I'm talking about error handlers of Python codecs: text.encode('utf8',
'surrogatepass')

--

___
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-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> floor_nroot does arithmetic with integers of bit-length approximately 54*n.

Oh, I see.

But maybe the Decimal is fast enough for such giant numbers, since we
can control the precision?

--

___
Python tracker 

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



[issue24853] Py_Finalize doesn't clean up PyImport_Inittab

2016-08-17 Thread Xiang Zhang

Xiang Zhang added the comment:

> initialize/run script/finalize will crash the second time

I don't think so since we already get a test case in test_capi that does 
init/fini repeatedly. It does not crash.

So I agree to close this one.

--

___
Python tracker 

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



[issue27698] socketpair not in socket.__all__ on Windows

2016-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ac2bc921169c by Victor Stinner in branch '3.5':
Issue #27698: Add socketpair to socket.__all__ on Windows
https://hg.python.org/cpython/rev/ac2bc921169c

--
nosy: +python-dev

___
Python tracker 

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



[issue27698] socketpair not in socket.__all__ on Windows

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

The issue should now be fixed by my change. Thanks for the bug report!

--
nosy: +haypo
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue27725] Use Py_SIZE(x) instead of x->ob_size

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> However, compiling ONLY the file Objects/longobject.c with -qalias=noansi did 
> fix the issue on AIX. That could be the same on Linux.

Nobody asked to only set the compiler file to only this file.

As we said, the issue is sprayed in all the C code base. The whole Python 2 
project has aliasing issues. Extension modules have same the issue.

--

___
Python tracker 

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-08-17 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for your review, Victor. :) Leave a reply.

--

___
Python tracker 

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



[issue27725] Use Py_SIZE(x) instead of x->ob_size

2016-08-17 Thread REIX Tony

REIX Tony added the comment:

OK.

However, compiling ONLY the file Objects/longobject.c with -qalias=noansi did 
fix the issue on AIX. That could be the same on Linux.

I haven't tried to use Py_SIZE() in all places where it should be used. Now 
trying to figure out why GCC behaves worst than XLC.

Anyway, I have a satisfactory work-around.
Thanks for your help !

--

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-17 Thread Emanuel Barry

Emanuel Barry added the comment:

I tend to like all things magic, but the more I think about it, and the less I 
like it being a part of the standard library. I've had a use for this feature 
before, and when I did, I cooked my own 12-lines subclass of EnumMeta and 
_EnumDict. Raymond's points are pretty spot-on, and I also think that this 
shouldn't go in the stdlib. There's still time.

While this particular flavour of magic sounds too, well, magic, for Python or 
even myself, I think a less magical approach can be taken. Namely, something 
like AutoNumberedEnum which requires values to be empty tuples is being 
explicit about what you want and not allowing typos in the class definition. 
Raymond's point about (temporarily) commenting out enum members breaking the 
order highlights this, and while this approach doesn't solve it, it makes it 
obvious that there is *something* that changed.

Another approach, which doesn't exclude the above, is to make EnumMeta and 
_EnumDict public and documented classes (!), thus allowing people like me to 
create their own blueberry-flavoured magic enumerations without any impact on 
the people who don't use my code. Or if I don't feel like reinventing the 
wheel, I can just pip install the module and use that instead.

I think that the whole idea of making enums in Python work like they do in C is 
looking at the problem from the wrong angle. It's true that Python takes some 
of its design from C, but naively trying to replicate C-like behaviour with 
C-like syntax doesn't work all the time. How often do beginners think 'x ^ y' 
means 'x to the power of y', and are then surprised by the behaviour?

I think this version of Enum raises the barrier to entry for new programmers. 
Enum is a nice feature, and it helps new and old programmers alike write 
clean(er) code for various purposes. When a programmer sees this use, they 
won't think "oh this must call __getitem__ and then assign an automatic value", 
they'll wonder "why is this code even running?". And then it's up to the 
Raymonds of this world to explain that Enum uses a metaclass (which, I'm sure, 
is not a topic they'll want to tackle by the time these programmers reach Enum) 
and that the mapping overloads __getitem__.

All in all, this magical approach is just too magical for Python. I understand 
that magic is fun to have and play with, but the standard libary isn't where 
you should keep your toys. I use a throwaway repo for all my magic 
this-is-not-a-good-idea-but-I-wanna-do-it-anyway ideas, and this is where I 
think such magic goes. It definitely doesn't belong in the standard library, 
within an arm's reach of the first curious programmer to wander there.

--
nosy: +ebarry

___
Python tracker 

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



[issue18880] ssl.SSLSocket shutdown doesn't behave like socket.shutdown

2016-08-17 Thread STINNER Victor

Changes by STINNER Victor :


--
type: behavior -> security

___
Python tracker 

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



[issue27682] wsgiref: Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-17 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Windows Error 10053, ConnectionAbortedError: [WinError 10053] An 
established connection was aborted by the software in your host machine -> 
wsgiref: Windows Error 10053, ConnectionAbortedError: [WinError 10053] An 
established connection was aborted by the software in your host machine

___
Python tracker 

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



[issue27725] Use Py_SIZE(x) instead of x->ob_size

2016-08-17 Thread Stefan Krah

Stefan Krah added the comment:

Agreed, the changes are too big for 2.7.

--
resolution:  -> wont fix
stage:  -> 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



[issue27731] Opt-out of MAX_PATH on Windows 10

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

Hum, but we use the same binary (.exe) for all Windows versions. Does it mean 
that we drop support for Windows < 10 in Python 3.6?

--
nosy: +haypo

___
Python tracker 

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

I reviewed  issue27558_v2.patch, see my comments.

--

___
Python tracker 

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



[issue27785] Module platform: Versions of Windows

2016-08-17 Thread R. David Murray

Changes by R. David Murray :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue27786] longobject.c: simplify x_sub(), inline _PyLong_Negate()

2016-08-17 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +Oren Milman

___
Python tracker 

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



[issue12319] [http.client] HTTPConnection.request not support "chunked" Transfer-Encoding to send data

2016-08-17 Thread Martin Panter

Martin Panter added the comment:

Patch 12 has the following changes:

* Change the chunked_encoding parameter to keyword-only
* Drop most of the change regarding the UpdatingFile test (see code review)
* Update the urlopen() TypeError to mention “data” may be a file object
* Fix and update the tests (they weren’t actually being run)
* Various minor documentation corrections, e.g. wrong parameter name.

I think there are a few of my comments to Demian’s patches that are still 
relevant, but they are just opportunities for improving the code (e.g. making 
the chunking iteration more efficient and readable). This version is hopefully 
“good enough”.

--
Added file: http://bugs.python.org/file44133/issue12319_12.patch

___
Python tracker 

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



[issue27725] Use Py_SIZE(x) instead of x->ob_size

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

I mean that fixing ob->ob_size in Objects/longobject.c is not enough. You 
should also fix C structures and fix all other C files in the code base... It's 
too late for such major refactoring in Python 2.

--

___
Python tracker 

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



[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

2016-08-17 Thread Steve Dower

Steve Dower added the comment:

Thanks for the regen. I don't think git format is the problem as most of my 
patches are fine, it's probably because it was in a patch queue and so the 
parent isn't actually a known commit. I haven't tested whether this works 
without my other console patches but I think it should.

Is there a surrogatepass option? If so, I'll definitely use that, as that'll 
fix the one remaining edge case.

I suspect we'll have to go to Guido to get a ruling on the default, but I'll 
add an environment variable to switch.

--

___
Python tracker 

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



[issue27725] Use Py_SIZE(x) instead of x->ob_size

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

I suggest to close this issue.

Aliasing issues are complex and simply cannot be fixed in Python 2. The root 
issue has been fixed in Python 3, it required to change the main C structures 
of Python objects.

The fix for your issue to already known, use -qalias=noansi with XLC.

--
nosy: +haypo

___
Python tracker 

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



[issue27786] longobject.c: simplify x_sub(), inline _PyLong_Negate()

2016-08-17 Thread STINNER Victor

New submission from STINNER Victor:

When reading the issue #27725, I saw that x_sub() of Objects/longobject.c is 
too careful just to change the sign of the newly created number: z cannot be 
shared at the end of the function, before z is normalized.

Attached patch simplifies the code.

See also the issue #27073, another similar simplification.

--
files: x_sub.patch
keywords: patch
messages: 272933
nosy: haypo, mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
status: open
title: longobject.c: simplify x_sub(), inline _PyLong_Negate()
versions: Python 3.6
Added file: http://bugs.python.org/file44132/x_sub.patch

___
Python tracker 

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



[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

2016-08-17 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-17 Thread John Hagen

John Hagen added the comment:

@Raymond, you raise valid concerns to be sure.  Hoping we can work something 
out.

@Ethan, what are your thoughts?


It's not just C that has enums where you can define a unique group of names and 
omit the values for clarity when they are not significant:  

C++: http://en.cppreference.com/w/cpp/language/enum
C#: https://msdn.microsoft.com/en-us/library/sbbt4032.aspx
Java: https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html
Rust: https://doc.rust-lang.org/book/enums.html

In my experience this is the most common and simple use case for enums.

Raymond, what are your thoughts about the version of AutoEnum that requires 
that a bare tuple be used as the value.  It has been in the Python docs since 
3.4 and was actually the original request of this issue: 
https://docs.python.org/library/enum.html#autonumber

It avoids many of the concerns that you've raised while still providing a way 
to create Enums in the normal class declaration method users would expect with 
a minimum amount of boilerplate.  Note that normally you want to use 
@enum.unique with a normal Enum, but AutoEnum also allows you to omit that 
boilerplate as you can't accidentally alias the values.

@enum.unique
class Color(enum.Enum):
aquamarine = 1
blue = 2
fushia = 3
# inserting a member here (perhaps because it's clearest to keep these in 
alphabetic order)
# results in having to increment all following members
...
green = 40
red = 41

vs.

class Color(enum.AutoEnum):
aquamarine = ()
blue = ()
fushia = ()
# inserting a member here (perhaps because it's clearest to keep these in 
alphabetic order)
# results in no refactoring
... (30+ more)
green = ()
red = ()

A big advantage of the class based Enums compared to the functional API is that 
you can clearly document an Enum and its members in way Sphinx can take 
advantage of and developers would be used to.


# Assuming tuple assignment version for this example.
class ClientOperationMode(enum.AutoEnum):
"""Modes of operations of the network client."""

push = ()
"""The client pushes data to the server automatically."""

pull = ()
"""The client pulls commands from the server."""

hybrid = ()
"""The client both pushes data and pulls for commands from the server."""

Sphinx will document this AutoEnum like a normal class, pulling in the class 
docstring, and attribute docstrings.

I don't see an obvious way to do this in the functional API docs: 
https://docs.python.org/library/enum.html#functional-api

--

___
Python tracker 

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



[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

Oops, I forget to close the issue.

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

___
Python tracker 

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



[issue27765] Accept UTF-8 encoded bytes as input to json.loads()

2016-08-17 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: needs patch -> resolved

___
Python tracker 

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



[issue27574] Faster parsing keyword arguments

2016-08-17 Thread STINNER Victor

STINNER Victor added the comment:

The issue can now be closed no?

--

___
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-08-17 Thread Mark Dickinson

Mark Dickinson added the comment:

Victor: by "way too slow", I really *do* mean way too slow. :-)

floor_nroot does arithmetic with integers of bit-length approximately 54*n. For 
small n, that's fine, but if someone tried to take the geometric mean of a list 
of 5 values (which it seems to me should be a perfectly reasonable 
use-case), floor_nroot would then be trying to do computations with 
multi-million-bit integers. The `a**(n-1)` operation in particular would be a 
killer for large `n`.

--

___
Python tracker 

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



[issue27599] Buffer overrun in binascii

2016-08-17 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue10976] accept bytes in json.loads()

2016-08-17 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



  1   2   >