[issue32662] Implement Server.serve_forever and corresponding APIs

2018-01-26 Thread STINNER Victor

STINNER Victor  added the comment:

test_asyncio.test_start_server_1() hangs on "s390x Debian 3.x" buildbot:
http://buildbot.python.org/all/#builders/13/builds/579

test_set_nodelay (test.test_asyncio.test_selector_events.TestSelectorUtils) ... 
ok
test_start_server_1 (test.test_asyncio.test_server.ProactorStartServerTests) 
... skipped 'Windows only'
Exception in thread test-client:
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/test_asyncio/functional.py",
 line 193, in run
self._prog(TestSocketWrapper(self._sock))
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/test_asyncio/test_server.py",
 line 44, in 
with self.tcp_client(lambda sock: client(sock, addr)):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/test_asyncio/test_server.py",
 line 19, in client
sock.connect(addr)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/threading.py", 
line 917, in _bootstrap_inner
self.run()
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/test_asyncio/functional.py",
 line 195, in run
self._test._abort_socket_test(ex)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/test_asyncio/functional.py",
 line 122, in _abort_socket_test
self.fail(ex)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/case.py", 
line 680, in fail
raise self.failureException(msg)
AssertionError: [Errno 111] Connection refused

Timeout (0:15:00)!
Thread 0x03fffcdcd710 (most recent call first):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/selectors.py", 
line 468 in select
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/asyncio/base_events.py",
 line 1555 in _run_once
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/asyncio/base_events.py",
 line 450 in run_forever
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/asyncio/base_events.py",
 line 482 in run_until_complete
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/test_asyncio/test_server.py",
 line 45 in test_start_server_1
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/case.py", 
line 615 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/case.py", 
line 663 in __call__
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/unittest/runner.py",
 line 176 in run
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/support/__init__.py",
 line 1861 in _run_suite
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/support/__init__.py",
 line 1951 in run_unittest
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/libregrtest/runtest.py",
 line 175 in test_runner
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/libregrtest/runtest.py",
 line 176 in runtest_inner
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/libregrtest/runtest.py",
 line 140 in runtest
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/libregrtest/main.py",
 line 291 in rerun_failed_tests
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/libregrtest/main.py",
 line 540 in _main
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/libregrtest/main.py",
 line 510 in main
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/libregrtest/main.py",
 line 585 in main
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/__main__.py", 
line 2 in 
  File "/home/dje/cpython-bui

[issue32662] Implement Server.serve_forever and corresponding APIs

2018-01-26 Thread STINNER Victor

STINNER Victor  added the comment:

The test fails differently on s390x SLES 3.x:
http://buildbot.python.org/all/#/builders/16/builds/576

...
test_force_close 
(test.test_asyncio.test_selector_events.SelectorTransportTests) ... ok
test_set_nodelay (test.test_asyncio.test_selector_events.TestSelectorUtils) ... 
ok
test_start_server_1 (test.test_asyncio.test_server.ProactorStartServerTests) 
... skipped 'Windows only'
test_start_server_1 (test.test_asyncio.test_server.SelectorStartServerTests) 
... Exception in thread test-client:
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_asyncio/functional.py",
 line 193, in run
self._prog(TestSocketWrapper(self._sock))
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_asyncio/test_server.py",
 line 44, in 
with self.tcp_client(lambda sock: client(sock, addr)):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_asyncio/test_server.py",
 line 19, in client
sock.connect(addr)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/threading.py", line 
917, in _bootstrap_inner
self.run()
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_asyncio/functional.py",
 line 195, in run
self._test._abort_socket_test(ex)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_asyncio/functional.py",
 line 122, in _abort_socket_test
self.fail(ex)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/unittest/case.py", 
line 680, in fail
raise self.failureException(msg)
AssertionError: [Errno 111] Connection refused

/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_asyncio/test_server.py:45:
 ResourceWarning: unclosed 
  self.loop.run_until_complete(main_task)
ERROR
test_start_unix_server_1 
(test.test_asyncio.test_server.SelectorStartServerTests) ... ok
test_start_tls_client_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests) 
... skipped 'Windows only'
test_start_tls_server_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests) 
... skipped 'Windows only'
test_start_tls_wrong_args 
(test.test_asyncio.test_sslproto.ProactorStartTLSTests) ... skipped 'Windows 
only'
test_start_tls_client_1 (test.test_asyncio.test_sslproto.SelectorStartTLSTests) 
... 
/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/collections/__init__.py:404:
 ResourceWarning: unclosed 
  result = _self._make(map(kwds.pop, field_names, _self))
Unhandled error in exception handler
context: {'message': 'Task was destroyed but it is pending!', 'task': .main() done, defined 
at 
/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_asyncio/test_server.py:31>
 wait_for=()]>>}
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/asyncio/base_events.py",
 line 1459, in call_exception_handler
self._exception_handler(self, context)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_asyncio/functional.py",
 line 22, in loop_exception_handler
self.loop.default_exception_handler(context)
AttributeError: 'NoneType' object has no attribute 'default_exception_handler'
ok
test_start_tls_server_1 (test.test_asyncio.test_sslproto.SelectorStartTLSTests) 
... ok
test_start_tls_wrong_args 
(test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... ok
test_cancel_handshake (test.test_asyncio.test_sslproto.SslProtoHandshakeTests) 
... ok
test_close_during_handshake 
(test.test_asyncio.test_sslproto.SslProtoHandshakeTests) .
...

==
ERROR: test_start_server_1 
(test.test_asyncio.test_server.SelectorStartServerTests)
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_asyncio/test_server.py",
 line 45, in test_start_server_1
self.loop.run_until_complete(main_task)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/asyncio/base_events.py",
 line 493, in run_until_complete
raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
--

--

___
Python tracker 

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



[issue32662] Implement Server.serve_forever and corresponding APIs

2018-01-26 Thread STINNER Victor

STINNER Victor  added the comment:

Just to be complete, the test also fails on x86 Gentoo Non-Debug with X 3.x:
http://buildbot.python.org/all/#/builders/99/builds/564

...
test_start_server_1 (test.test_asyncio.test_server.SelectorStartServerTests) 
... Exception in thread test-client:
Traceback (most recent call last):
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/functional.py",
 line 193, in run
self._prog(TestSocketWrapper(self._sock))
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_server.py",
 line 44, in 
with self.tcp_client(lambda sock: client(sock, addr)):
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_server.py",
 line 19, in client
sock.connect(addr)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/threading.py", line 
917, in _bootstrap_inner
self.run()
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/functional.py",
 line 195, in run
self._test._abort_socket_test(ex)
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/functional.py",
 line 122, in _abort_socket_test
self.fail(ex)
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py", 
line 680, in fail
raise self.failureException(msg)
AssertionError: [Errno 111] Connection refused

Timeout (0:15:00)!
Thread 0xb7d69700 (most recent call first):
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/selectors.py", line 
468 in select
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/asyncio/base_events.py",
 line 1555 in _run_once
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/asyncio/base_events.py",
 line 450 in run_forever
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/asyncio/base_events.py",
 line 482 in run_until_complete
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_asyncio/test_server.py",
 line 45 in test_start_server_1
...

--

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-01-26 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5187

___
Python tracker 

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



[issue32675] dict.__contains__(unhashable) raises TypeError where False was expected

2018-01-26 Thread xitop

New submission from xitop :

The `dict.__contains()` function does not fully comply with the description in 
the "Data Model" section of the official documentation, which states:
  "__contains__(self, item) ... Should return true if item is in self, false 
otherwise."

Basically the same is written in "Mapping Types - dict": "key in d - Return 
True if d has a key key, else False."

According to that, testing a presence of an unhashable object in a dict should 
return False. But it raises a TypeError instead.

Example:
  >>> () in {}
  False
but:
  >>> [] in {}
  Traceback (most recent call last):
File "", line 1, in 
  TypeError: unhashable type: 'list'

There is a related SO question:
  
https://stackoverflow.com/questions/48444079/unexpected-behaviour-of-dictionary-membership-check
currently without a clear answer whether it is a bug or desired behaviour 
supposed to expose programming errors. In the latter case, it seems to be not 
documented.

--
components: Interpreter Core
messages: 310751
nosy: xitop
priority: normal
severity: normal
status: open
title: dict.__contains__(unhashable) raises TypeError where False was expected
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



[issue32441] os.dup2 should return the new fd

2018-01-26 Thread STINNER Victor

STINNER Victor  added the comment:

The change introduced a warning. Can someone please take a look (and maybe fix 
it)?

./Modules/posixmodule.c: In function 'os_dup2_impl':
./Modules/posixmodule.c:7785:9: warning: 'res' may be used uninitialized in 
this function [-Wmaybe-uninitialized]
 int res;
 ^~~

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

___
Python tracker 

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



[issue32676] test_asyncio emits many warnings when run in debug mode

2018-01-26 Thread STINNER Victor

New submission from STINNER Victor :

vstinner@apu$ ./python -u -X dev -m test -v test_asyncio 2>&1|tee log

Tests which emit warnings:

test__sock_sendfile_native_failure 
(test.test_asyncio.test_base_events.BaseLoopSendfileTests) ...
/home/vstinner/prog/python/master/Lib/asyncio/selector_events.py:648: 
ResourceWarning: unclosed transport <_SelectorSocketTransport fd=11>
  source=self)
ok

test_start_tls_client_1 (test.test_asyncio.test_sslproto.SelectorStartTLSTests) 
...
Executing () created at 
/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_sslproto.py:202> 
took 0.205 seconds
ok

test_error_in_call_soon 
(test.test_asyncio.test_tasks.CTaskSubclass_PyFuture_Tests) ...
.coro() running, 
defined at 
/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_tasks.py:2089, 
created at 
/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_tasks.py:2096> was 
never yielded from
Coroutine object created at (most recent call last, truncated to 10 last lines):
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 122, in 
run
test(result)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 84, in 
__call__
return self.run(*args, **kwds)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 122, in 
run
test(result)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 84, in 
__call__
return self.run(*args, **kwds)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 122, in 
run
test(result)
  File "/home/vstinner/prog/python/master/Lib/unittest/case.py", line 663, in 
__call__
return self.run(*args, **kwds)
  File "/home/vstinner/prog/python/master/Lib/unittest/case.py", line 615, in 
run
testMethod()
  File "/home/vstinner/prog/python/master/Lib/unittest/mock.py", line 1191, in 
patched
return func(*args, **keywargs)
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_tasks.py", 
line 2096, in test_error_in_call_soon
self.new_task(self.loop, coro())
ok

test_error_in_call_soon 
(test.test_asyncio.test_tasks.CTask_CFuture_SubclassTests) ...
.coro() running, 
defined at 
/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_tasks.py:2089, 
created at 
/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_tasks.py:2096> was 
never yielded from
Coroutine object created at (most recent call last, truncated to 10 last lines):
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 122, in 
run
test(result)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 84, in 
__call__
return self.run(*args, **kwds)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 122, in 
run
test(result)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 84, in 
__call__
return self.run(*args, **kwds)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 122, in 
run
test(result)
  File "/home/vstinner/prog/python/master/Lib/unittest/case.py", line 663, in 
__call__
return self.run(*args, **kwds)
  File "/home/vstinner/prog/python/master/Lib/unittest/case.py", line 615, in 
run
testMethod()
  File "/home/vstinner/prog/python/master/Lib/unittest/mock.py", line 1191, in 
patched
return func(*args, **keywargs)
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_tasks.py", 
line 2096, in test_error_in_call_soon
self.new_task(self.loop, coro())
ok

test_error_in_call_soon (test.test_asyncio.test_tasks.CTask_CFuture_Tests) ...
.coro() running, 
defined at 
/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_tasks.py:2089, 
created at 
/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_tasks.py:2096> was 
never yielded from
Coroutine object created at (most recent call last, truncated to 10 last lines):
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 122, in 
run
test(result)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 84, in 
__call__
return self.run(*args, **kwds)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 122, in 
run
test(result)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 84, in 
__call__
return self.run(*args, **kwds)
  File "/home/vstinner/prog/python/master/Lib/unittest/suite.py", line 122, in 
run
test(result)
  File "/home/vstinner/prog/python/master/Lib/unittest/case.py", line 663, in 
__call__
return self.run(*args, **kwds)
  File "/home/vstinner/prog/python/master/Lib/unittest/case.py", line 615, in 
run
testMethod()
  File "/home/vstinner/prog/python/master/Lib/unittest/mock.py", line 1191, in 
patched
return func(*args, **keywargs)
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_tasks.py", 
line 2096, in test_error_in_call_soon
self.new_task(self.loop, coro())
ok

test_context_3 (test.test_asyncio.test_tasks.CTask_PyFuture_Tests) ...

[issue32677] Add str.isascii()

2018-01-26 Thread INADA Naoki

New submission from INADA Naoki :

int() and str.is*** functions accepts other than ASCII.
But we want to accept only ASCII in some cases.  (e.g. ipaddress module)

We can use try-except to check ASCII, but it's inefficient.

try:
s.encode('ascii')
except UnicodeEncodeError:
ascii = False
else:
ascii = True

CPython can check string is ASCII efficiently.

(Voting on python-ideas ML now)

--
components: Interpreter Core
messages: 310754
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Add str.isascii()
type: enhancement
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



[issue32677] Add str.isascii()

2018-01-26 Thread STINNER Victor

STINNER Victor  added the comment:

> (Voting on python-ideas ML now)

https://mail.python.org/pipermail/python-ideas/2018-January/048737.html

--
nosy: +vstinner

___
Python tracker 

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



[issue32677] Add str.isascii()

2018-01-26 Thread INADA Naoki

Change by INADA Naoki :


--
keywords: +patch
pull_requests: +5188
stage:  -> patch review

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-01-26 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5189

___
Python tracker 

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



[issue32675] dict.__contains__(unhashable) raises TypeError where False was expected

2018-01-26 Thread INADA Naoki

INADA Naoki  added the comment:

"Key must be hashable" is precondition of dict operations.

All operations for dict will raise TypeError for unhashable keys.
For example, d[k] will raise TypeError too, but document doesn't
mention about it:

"""
Return the item of d with key key. Raises a KeyError if key is not in the map.
"""
https://docs.python.org/3/library/stdtypes.html#dict

--
nosy: +inada.naoki

___
Python tracker 

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



[issue32378] test_npn_protocols broken with LibreSSL 2.6.1+

2018-01-26 Thread Bernard Spil

Bernard Spil  added the comment:

See also https://github.com/python/cpython/pull/5343

Note: I am Sp1l on Github, spil here, CLA has been signed.

--
nosy: +spil
pull_requests: +5190

___
Python tracker 

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



[issue32665] pathlib.Path._from_parsed_parts should call cls.__new__(cls)

2018-01-26 Thread qb-cea

qb-cea  added the comment:

Typo in the code of the previous comment:

- __slots__ = ("new_attr",)
+ __slots__ = ("_new_attr",)

--
type:  -> behavior

___
Python tracker 

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



[issue32678] Lazy import ast in inspect

2018-01-26 Thread INADA Naoki

New submission from INADA Naoki :

inspect imports ast but it's used only for creating signature.

But asyncio uses inspect module for unwrap(), isgenerator(), etc...
And ast module is relatively heavy for import.

This is output of python -Ximporttime -c 'import asyncio':

import time:   147 |147 | asyncio.constants
import time:  1456 |   1456 |   _ast
import time:   363 |   1818 | ast
...
import time:  1890 |   5152 |   inspect
...
import time:   303 |   5984 | asyncio.coroutines
...
import time:   731 |  37941 |   asyncio.base_events
...
import time:   375 |  41383 | asyncio

--
components: Library (Lib)
messages: 310759
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Lazy import ast in inspect
type: resource usage
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



[issue32678] Lazy import ast in inspect

2018-01-26 Thread INADA Naoki

Change by INADA Naoki :


--
keywords: +patch
pull_requests: +5191
stage:  -> patch review

___
Python tracker 

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



[issue32513] dataclasses: make it easier to use user-supplied special methods

2018-01-26 Thread Eric V. Smith

Eric V. Smith  added the comment:

Here's where I am on what methods are added under which circumstances. 
Hopefully these tables don't get mangled.

The more I think about what to do with hash and raising exceptions, the more I 
think that the right answer is to not raise any exceptions, and just follow the 
rule of "don't overwrite an attribute that the user specified". The uses of 
hash=True or hash=None are so specialized that users can be expected to 
understand the implications. The interaction among hash=, eq=, and frozen= are 
sufficiently complicated (see the last table below) that we don't need to add 
any more rules.

There are only 2 places below where exceptions are raised:

1. frozen=True and the user supplied __setattr__ or __delattr__. These methods 
are crucial for frozen-ness, so we must be able to add them.

2. order=True and the user supplied at least one of __lt__, __le__, __ge__, or 
__gt__. This is at Nick's request (see msg310464 in this issue). I'm not so 
sure about this one: if the user wants to explicitly ask that these methods be 
added (by specifying order=True, which is not the default), and they also 
specify some of the ordering function, then why not let them, and have 
dataclass add the missing ones as we normally would? But I'm not heavily 
invested in the outcome, as I don't see any reason to write such code, anyway. 
The only reason I'd suggest leaving it out is to avoid having to explain it in 
the documentation.

I have this all coded up and ready to create a PR, modulo a few more tests. 
I'll get it committed before Beta 1. Hopefully these tables answers the 
questions about the new proposal.

# Conditions for adding methods:
# added = method is added
#   = no action: method is not added
# raise = TypeError is raised
# None  = attribute is set to None

# __init__
#
#   +--- init= parameter
#   |
#   v|   yes   |   no|  <--- class has __init__?
# ---+-+-+
#  False | | |
# ---+-+-+
#  True  | | added   |  <- the default
# ---+-+-+

# __repr__
#
#   +--- repr= parameter
#   |
#   v|   yes   |   no|  <--- class has __repr__?
# ---+-+-+
#  False | | |
# ---+-+-+
#  True  | | added   |  <- the default
# ---+-+-+

# __setattr__
# __delattr__
#
#   +--- frozen= parameter
#   |
#   v|   yes   |   no|  <--- class has __setattr__ or __delattr__?
# ---+-+-+
#  False | | |  <- the default
# ---+-+-+
#  True  | raise * | added   |
# ---+-+-+
#
# * Raise because not adding these methods
#would break the "frozen-ness" of the class.

# __eq__
#
#   +--- eq= parameter
#   |
#   v|   yes   |   no|  <--- class has __eq__?
# ---+-+-+
#  False | | |
# ---+-+-+
#  True  | | added   |  <- the default
# ---+-+-+

# __lt__
# __le__
# __gt__
# __ge__
#
#   +--- order= parameter
#   |
#   v|   yes   |   no|  <--- class has any comparison method?
# ---+-+-+
#  False | | |  <- the default
# ---+-+-+
#  True  | raise * | added   |
# ---+-+-+
#
# * Raise because to allow this case would interfere with using
#functools.total_ordering.

# __hash__

#   +--- hash= parameter
#   |   +--- eq= parameter
#   |   |   +--- frozen= parameter
#   |   |   |
#   v|  v|  v|  yes  |  no   |  <--- class has __hash__?
# ---+---+---+---+---+
#  False | False | False |   |   |
# ---+---+---+---+---+
#  False | False | True  |   |   |
# ---+---+---+---+---+
#  False | True  | False |   |   |
# ---+---+---+---+---+
#  False | True  | True  |   |   |
# ---+---+---+---+---+
#  True  | False | False |   | added | Has no __eq__, but hashable
# ---+---+---+---+---+
#  True  | False | True  |   | added | Has no __eq__, but hashable
# ---+---+---+---+---+
#  True  | True  | False |   | added | Not frozen, but hashable
# ---+---+---+---+---+
#  True  | True  | True  |   | added | Frozen, so hashable
# ---+---+---+---+---+
#  None  | False | False |   |   | No __eq__, use the base class 
__hash__
# ---+---+---+---+---+
#  None  | False | True  |   |   | No __eq__, use the base class 
__hash__
# ---+---+---+---+---+
#  None  | True  | False |   | None  | <-- the default, not hashable
# ---+---+---+---+---+
#  None  | True  | True  |   | added | Frozen, so hashable
# ---+---+---+---+---+
#
# For boxe

[issue27931] Email parse IndexError <""@wiarcom.com>

2018-01-26 Thread Jay Yin

Jay Yin  added the comment:

https://github.com/python/cpython/pull/5329
this is the pending pull request for this

--
nosy: +jayyin11043

___
Python tracker 

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



[issue2793] Dictionary fails to index when adding list when in a deeply nested loop

2018-01-26 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
pull_requests:  -5177

___
Python tracker 

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



[issue32679] concurrent.futures should store full sys.exc_info()

2018-01-26 Thread Jonas H.

New submission from Jonas H. :

Use case: Try to get a future's result using 
concurrent.futures.Future.result(), and log the full exception if there was any.

Currently, only "excinst" (sys.exc_info()[1]) is provided with the 
Future.exception() method.

Proposal: Add new Future.exc_info() method that returns the full sys.exc_info() 
at the time of the exception.

--
components: Library (Lib)
messages: 310762
nosy: jonash
priority: normal
severity: normal
status: open
title: concurrent.futures should store full sys.exc_info()
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32679] concurrent.futures should store full sys.exc_info()

2018-01-26 Thread Jonas H.

Jonas H.  added the comment:

See also 
https://stackoverflow.com/questions/19309514/getting-original-line-number-for-exception-in-concurrent-futures
 for other people having the same problem

--

___
Python tracker 

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



[issue32680] smtplib SMTP instances missing a default sock attribute

2018-01-26 Thread Romuald Brunet

New submission from Romuald Brunet :

SMTP instances from the smtplib module are not creating their sock attribute 
consistently after __init__

When host is sent as parameter a sock object is created (and hopefully, 
connected)

When the host is not sent, the sock attribute doesn't exist at all

--
messages: 310764
nosy: Romuald
priority: normal
severity: normal
status: open
title: smtplib SMTP instances missing a default sock attribute

___
Python tracker 

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



[issue32680] smtplib SMTP instances missing a default sock attribute

2018-01-26 Thread Romuald Brunet

Change by Romuald Brunet :


--
keywords: +patch
pull_requests: +5192
stage:  -> patch review

___
Python tracker 

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



[issue32680] smtplib SMTP instances missing a default sock attribute

2018-01-26 Thread Romuald Brunet

Romuald Brunet  added the comment:

My use case:

try:
  s = SMTP('myhost')
  s.do_some_sending()
finaly:
  if s is not None and s.sock is not None:
s.quit()

But I realize just now that in that case, if s was initialized correctly, its 
sock was inevitably set

--

___
Python tracker 

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



[issue32681] Fix uninitialized variable in os_dup2_impl

2018-01-26 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

With the last revision, I get this warning from the compiler.

gcc -pthread -Wno-unused-result -Wsign-compare -g -Og -Wall -Wstrict-prototypes 
   -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration   -I. 
-I./Include-DPy_BUILD_CORE  -c ./Modules/_collectionsmodule.c -o 
Modules/_collectionsmodule.o
./Modules/posixmodule.c: In function ‘os_dup2_impl’:
./Modules/posixmodule.c:7785:9: warning: ‘res’ may be used uninitialized in 
this function [-Wmaybe-uninitialized]
 int res;
 ^~~

--
messages: 310767
nosy: matrixise
priority: normal
severity: normal
status: open
title: Fix uninitialized variable in os_dup2_impl

___
Python tracker 

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



[issue32681] Fix uninitialized variable in os_dup2_impl

2018-01-26 Thread STINNER Victor

STINNER Victor  added the comment:

I already reported the issue at:
https://bugs.python.org/issue32441#msg310752

I suggest to close this issue as a duplicate.

--
nosy: +vstinner

___
Python tracker 

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



[issue32681] Fix uninitialized variable in os_dup2_impl

2018-01-26 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
keywords: +patch
pull_requests: +5194
stage:  -> patch review

___
Python tracker 

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



[issue23080] BoundArguments.arguments should be unordered

2018-01-26 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I know there are other issues to remove OrderedDicts, so should this patch be 
used for BoundArguments?

--
nosy: +csabella

___
Python tracker 

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



[issue23080] BoundArguments.arguments should be unordered

2018-01-26 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue18533] Avoid error from repr() of recursive dictview

2018-01-26 Thread Senthil Kumaran

Senthil Kumaran  added the comment:


New changeset d7773d92bd11640a8c950d6c36a9cef1cee36f96 by Senthil Kumaran 
(bennorth) in branch 'master':
bpo-18533: Avoid RecursionError from repr() of recursive dictview (#4823)
https://github.com/python/cpython/commit/d7773d92bd11640a8c950d6c36a9cef1cee36f96


--
nosy: +orsenthil

___
Python tracker 

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



[issue18533] Avoid error from repr() of recursive dictview

2018-01-26 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I merged this one.  All the requirements were met.

@Terry / @ Cheryl - could you please review if I did it right?  Should this be 
backported to other Python versions?

--
resolution:  -> fixed
versions: +Python 3.7 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue32681] Fix uninitialized variable in os_dup2_impl

2018-01-26 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Yes, you can close it, but I don't understand why there is no fix for
this warning. my issue has a small PR, but the other issue on b.p.o, I
am not really sure about my fix... I just set the 'res' variable to 0
and avoid this kind of message. Is there an other way if I want to fix
it ?

--

___
Python tracker 

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



[issue32682] test_zlib improve version parsing

2018-01-26 Thread pmpp

New submission from pmpp :

On some OS like android 4.0+, system libz.so gives funny versions number that 
prevent test_zlib from correctly parse it from zlib.ZLIB_RUNTIME_VERSION

https://patch-diff.githubusercontent.com/raw/vstinner/cpython/pull/1.patch

seems to fix "1.2.8-linuxfoundation-mods-v1" and 
"1.2.8.f-linuxfoundation-mods-v1" cases as already encountered on an popular 
operating system and maybe others yet unknown.

--
components: Tests
messages: 310773
nosy: pmpp
priority: normal
severity: normal
status: open
title: test_zlib improve version parsing
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



[issue32682] test_zlib improve version parsing

2018-01-26 Thread pmpp

Change by pmpp :


--
keywords: +patch
pull_requests: +5195
stage:  -> patch review

___
Python tracker 

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



[issue32681] Fix uninitialized variable in os_dup2_impl

2018-01-26 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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



[issue32680] smtplib SMTP instances missing a default sock attribute

2018-01-26 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

You are right, but...

if there is an exception in the connect method before the init of
self.sock, the sock attribute will not exist and in this case, and only
in this case, there will be an exception in the close method.

your code will work fine if you use a try/finally but not in the case
where we use the with statement, for example.

with SMTP('myhost') as smtp:
   smtp.do_something()

If there is an exception in the __init__ of SMTP and self.sock is not
initialized -> traceback.

--
nosy: +matrixise

___
Python tracker 

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



[issue32513] dataclasses: make it easier to use user-supplied special methods

2018-01-26 Thread Eric V. Smith

Eric V. Smith  added the comment:

I'm working on a better formulation of the __hash__ issue, so don't invest much 
time in this until I post my next message. I'm going to re-organize the various 
tables to make them easier to read.

--

___
Python tracker 

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



[issue32513] dataclasses: make it easier to use user-supplied special methods

2018-01-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

Can you also clarify that this *never* looks at whether the method is
implemented in a superclass?

And clarify what happens with the __hash__ = None that's automatically
created when you define __eq__.

Please also repeat the default value of the flag in each case.

--

___
Python tracker 

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



[issue32206] Run modules with pdb

2018-01-26 Thread Jason R. Coombs

Change by Jason R. Coombs :


--
nosy: +jason.coombs

___
Python tracker 

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



[issue3177] Add shutil.open

2018-01-26 Thread Matej Cepl

Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue32677] Add.isascii() to str, bytes and bytearray

2018-01-26 Thread INADA Naoki

Change by INADA Naoki :


--
title: Add str.isascii() -> Add.isascii() to str, bytes and bytearray

___
Python tracker 

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



[issue25330] Docs for pkgutil.get_data inconsistent with semantics

2018-01-26 Thread Paul Ganssle

Paul Ganssle  added the comment:

I'm not sure if this warrants a separate issue, but I also notice this in the 
documentation:

> If the package cannot be located or loaded, or it uses a loader which does 
> not support get_data, then None is returned. In particular, the loader for 
> namespace packages does not support get_data.

But in reality this seems to raise a FileNotFoundError:


>>> import pkgutil
>>> data = pkgutil.get_data('dateutil.zoneinfo', 'dateutil-zoneinfo.tar.gz')
>>> len(data)
139671
>>> data = pkgutil.get_data('dateutil.zoneinfo', 'foo-bar.tar.gz')
FileNotFoundError: [Errno 2] No such file or directory: 
'/usr/lib/python3.6/site-packages/dateutil/zoneinfo/foo-bar.tar.gz'


Am I misunderstanding the documentation, or should the failure mode be 
corrected to specify that it raises an error?

--
nosy: +p-ganssle
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



[issue32640] Python 2.7 str.join documentation is incorrect

2018-01-26 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset f5e8f71fe339fe5e47c4d24ac2e5177fa3c02922 by Mariatta in branch 
'2.7':
[2.7] bpo-32640: Clarify the behavior of str.join and unicode object (GH-5333)
https://github.com/python/cpython/commit/f5e8f71fe339fe5e47c4d24ac2e5177fa3c02922


--

___
Python tracker 

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



[issue32640] Python 2.7 str.join documentation is incorrect

2018-01-26 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks!

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



[issue32206] Run modules with pdb

2018-01-26 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

Thanks for creating this functionality. I'm so excited to use it that I've 
published a backport [https://pypi.org/project/backports.pdb], which seems to 
work for at least the basic use cases on Python 2.7+.

--

___
Python tracker 

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



[issue32579] UUID module fix, uuid1 python module function

2018-01-26 Thread Ned Deily

Change by Ned Deily :


--
nosy: +barry
stage:  -> patch review

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-01-26 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-26 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset dba976b8a28d6e5daa66ef31a6a7c694a9193f6a by Yury Selivanov 
(Nathaniel J. Smith) in branch 'master':
bpo-32591: fix abort in _PyErr_WarnUnawaitedCoroutine during shutdown (#5337)
https://github.com/python/cpython/commit/dba976b8a28d6e5daa66ef31a6a7c694a9193f6a


--

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-26 Thread Yury Selivanov

Yury Selivanov  added the comment:

Nathaniel's latest PR looks good and fixes the crash.

FWIW losing some warnings during interpreter shutdown isn't exactly a new 
problem, therefore I think there's nothing wrong with the new API here.  For 
instance, I've seen asyncio's CoroWrapper losing warnings in the exact same 
fashion.

So I've merged Nathaniel's PR.  I think we can rollback the new API if we 
discover more problems during the beta-1 period.

--

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-26 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue18533] Avoid error from repr() of recursive dictview

2018-01-26 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5196

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

OK. I hope both of you keep an eye on this and actively try to test and
break it!

--

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-26 Thread Yury Selivanov

Yury Selivanov  added the comment:

> OK. I hope both of you keep an eye on this and actively try to test and
break it!

That's the plan!

--

___
Python tracker 

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



[issue18533] Avoid error from repr() of recursive dictview

2018-01-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Thank you for checking and merging.  In the future, we will be reminded to 
change '#' to 'GH-' in the title.  I only found out a couple of days ago that 
this is desired.

David, in msg193651, and Raymond, in msg193779, already suggested backporting.  
I added the 'needs backport' tags.

The auto backport for 3.6 worked.  You might want to checked the diff as well 
as test results.

As I expected from the fact that Ben once did a separate 2.7 version,  the auto 
backport for 2.7 failed.  Ben, since you know what code changes are needed, can 
you prepare a backport (cherry pick) PR?

--
assignee:  -> orsenthil
stage: patch review -> needs patch
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue32662] Implement Server.serve_forever and corresponding APIs

2018-01-26 Thread Yury Selivanov

Yury Selivanov  added the comment:

I think these failures were on the previous version of the test; i've fixed it 
last night and it shouldn't timeout this way anymore.

--

___
Python tracker 

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



[issue32571] Speed up and clean up getting optional attributes in C code

2018-01-26 Thread Yury Selivanov

Yury Selivanov  added the comment:

Closing this one now.  Thanks Serhiy and Inada-san!

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



[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2018-01-26 Thread Matt Ripley

Matt Ripley  added the comment:

Hi Terry, Thanks for getting back to me on this. I tried all of the suggestions 
on the link that you sent to me and the python installer still will not install 
for me. I get the same errors.
I can install the conda python distributions. I only have these installation 
errors with the python.org installers. Other installers (not from python.org) 
install without error?

--

___
Python tracker 

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



[issue32670] Enforce PEP 479—StopIteration and generators—in Python 3.7 by default

2018-01-26 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 43c47fe09640c579462978ec16f81295f5857cde by Yury Selivanov in 
branch 'master':
bpo-32670: Enforce PEP 479. (#5327)
https://github.com/python/cpython/commit/43c47fe09640c579462978ec16f81295f5857cde


--

___
Python tracker 

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



[issue32670] Enforce PEP 479—StopIteration and generators—in Python 3.7 by default

2018-01-26 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah

Stefan Krah  added the comment:

Tests
-

I ran some of my own tests (not even close to all), they seem fine.

However, I could not find any tests for the added feature (safe
use with async) though. We would be adding a new feature without
tests.


Performance
---

I'm getting a large slowdown:

./python Modules/_decimal/tests/bench.py

bench.py


patched:[0.199, 0.206, 0.198, 0.199, 0.197, 0.202, 0.198, 0.201, 0.213, 
0.199]
status-quo: [0.187, 0.184, 0.185, 0.183, 0.184, 0.188, 0.184, 0.183, 0.183, 
0.185]

slowdown: > 10%


xwith.py


patched:[0.535, 0.541, 0.523]
status-quo: [0.412, 0.393, 0.375]

slowdown: > 30%



Given the performance issues I'm -1 for adding the feature at
this point.

--
Added file: https://bugs.python.org/file47410/xwith.py

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Yury Selivanov

Yury Selivanov  added the comment:

> However, I could not find any tests for the added feature (safe
> use with async) though. We would be adding a new feature without
> tests.

This is no problem, I can add a few async/await tests.


> I'm getting a large slowdown:
> ./python Modules/_decimal/tests/bench.py
> [..]
> patched:[0.199, 0.206, 0.198, 0.199, 0.197, 0.202, 0.198, 0.201, 0.213, 
> 0.199]
> status-quo: [0.187, 0.184, 0.185, 0.183, 0.184, 0.188, 0.184, 0.183, 0.183, 
> 0.185]

I'd like you to elaborate a bit more here.  First, bench.py produces a 
completely different output from what you've quoted.  How exactly did you 
compile these results?  Are those numbers results of Pi calculation or 
factorial?  Can you upload the actual script you used here (if there's one)?

Second, here's my run of bench.py with contextvars and without: 
https://gist.github.com/1st1/1187fc58dfdef86e3cad8874e0894938

I don't see any difference, left alone 10% slowdown.


> xwith.py
> 
>
> patched:[0.535, 0.541, 0.523]
> status-quo: [0.412, 0.393, 0.375]

This benchmark is specially constructed to profile creating decimal contexts 
and doing almost nothing with them.

I've optimized PEP 567 for contextvar.get() operation, not contextvar.set (it's 
hard to make hamt.set() as fast as dict.set()).  That way, if you have an some 
decimal code that performs actual calculations with decimal objects, the 
operation of looking up the current context is cheap.

It's hard to imagine a situation, where a real decimal-related code just 
creates decimal contexts and does nothing else with them.

--

___
Python tracker 

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



[issue32611] Tkinter taskbar icon (Windows)

2018-01-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

On Win10, with 3.5.4, 3.6.4, 3.7.0a4, the pinned IDLE icons on my taskbar look 
normal, with the notebook and snake icon.  Running

import tkinter as tk
r = tk.Tk()

stacks the edge of a shadow icon behind the IDLE icon.  When I mouse over the 
pair, the tkinter icon expand to a box with tk feather icon and 'tk' on the top 
title line and a blank white box.  Adding

tk.Label(r, text='jsfjlskjflsjflksjflkjsflkjsfljsfljslfjfs').pack()

shrinks the window to fit the label and the expanded icon has a shrunken box 
also.  Everything looks normal to me.

What windows version are you using?  What exact code do you run to get the 
effect you describe?  Can you describe what you see better?

--
components: +Tkinter
nosy: +serhiy.storchaka, terry.reedy

___
Python tracker 

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



[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2018-01-26 Thread Dan Snider

New submission from Dan Snider :

It doesn't even care if the result it gets from 
ob.__getattribute__("__class__") isn't a type.

Surely `isinstance` is intended to do what it is named and be guaranteed to 
return True if an object `ob` is an instance of class `cls`. There are already 
ways to trick `isinstance` into thinking objects are instances of types not 
present in its __mro__, ie with abstract base classes. All this does is 
introduce the possibility of bugs.

`inspect.isclass` in particular is affected. If there's some obscure use case 
for breaking `isinstance` in this manner, surely it shouldn't apply to 
`inspect.isclass` which according to its documentation, "Return true if the 
object is a class."

from inspect import isclass
class Liar:
def __getattribute__(self, attr):
if attr == '__class__':
return type
return object.__getattribute__(self, attr)

>>> islcass(Liar())
True

--
components: Interpreter Core, Library (Lib)
messages: 310793
nosy: bup
priority: normal
severity: normal
status: open
title: isinstance is calling ob.__getattribute__ as a fallback instead of 
object.__class__.__get__
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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah

Stefan Krah  added the comment:

On Fri, Jan 26, 2018 at 09:06:38PM +, Yury Selivanov wrote:
> This benchmark is specially constructed to profile creating decimal contexts 
> and doing almost nothing with the

It is not constructed at all.  It was the first thing I wrote down trying
to play a bit with speed.

Even the telco benchmark (where there's a lot of other stuff going
on) slows down by around 7-8%.

I did not hunt for these benchmarks. They are the first things I tried out.  I
cannot believe that you never saw a slowdown as claimed in your OP.

--

___
Python tracker 

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



[issue32613] Use PEP 397 py launcher in windows faq

2018-01-26 Thread Terry J. Reedy

Change by Terry J. Reedy :


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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

Guys. Please stop with the editorializing. "I cannot believe ..." (used
essentially by both of you) is not constructive.

--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah

Stefan Krah  added the comment:

Guido, I have the feeling that the feature -- about which I was actually
positive in the first place -- is being pushed aggressively with no
respect for the module author.

BTW, prec is changed quite frequently in decimal code, so if people
want infix notation they also have to use many with-statements.

--

___
Python tracker 

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



[issue32613] Use PEP 397 py launcher in windows faq

2018-01-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I am inclined to believe.  The answer to "How do I run a Python program under 
Windows?" should include how to use 'py'.  'python' will not work unless the 
install directory has been added to the path. Of course, 'py' does not work if 
its installation is unchecked.

The answer also has a box with a useless link (503 Service Unavailable) to a 
video 'Python Development on XP' that includes adding 'python' to the path.  
3.5+ do not run on xp.  This should be removed.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-26 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +5197

___
Python tracker 

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



[issue32446] ResourceLoader.get_data() should accept a PathLike

2018-01-26 Thread Jay Yin

Jay Yin  added the comment:

I'm taking a look now, this looks interesting

--
nosy: +jayyin11043

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

Stefan, I don't think a module author should retain veto over everything
affecting their code forever. (We've had spectacular process failures with
this in the past.) Please take a deep breath and patiently answer Yury's
questions. If you two can't agree on this, the status quo wins, but it will
be a blemish on your reputation if you just block it unilaterally. At the
very least help Yury reproduce your timing results -- at this point the
burden is on you since nobody else can reproduce them.

--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah

Stefan Krah  added the comment:

I have run about 1000 times more decimal benchmarks than both Yury and you.  
You attempt to hurt my reputation is laughable.

Show me some top-performance code that you have written.

--

___
Python tracker 

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



[issue32446] ResourceLoader.get_data() should accept a PathLike

2018-01-26 Thread Jay Yin

Jay Yin  added the comment:

this would extend to set and get data right?, also would it be good to use the 
current get_data() (one that reads only string) function for the overloaded one 
and extract the string path from the os.path object? or would we want the 
os.path object to be handled separately?

--

___
Python tracker 

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



[issue32446] ResourceLoader.get_data() should accept a PathLike

2018-01-26 Thread Jay Yin

Jay Yin  added the comment:

nvm I temporarily forgot I was working with python here, I'd need to use "is" 
to check what the entered "path" is huh?

--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Yury Selivanov

Yury Selivanov  added the comment:

Sorry Stefan, I never wanted this to look like "I'm pushing this without 
listening to Stefan".  I apologize if it looked that way.

I ran bm_telco on my machine before submitting the PR, and I indeed did not see 
any performance impact.  I'll try again.  I also have a idea of a 
micro-optimization that might make it a tiny bit faster.

--

___
Python tracker 

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



[issue32446] ResourceLoader.get_data() should accept a PathLike

2018-01-26 Thread Jay Yin

Jay Yin  added the comment:

I hope this isn't a dumb question but where is ResourceLoader.get_data() 
implemented, using ATOM to search the whole project and I can't seem to find it.

--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

Stefan this is unacceptable abuse. Please read the code of conduct.

--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah

Stefan Krah  added the comment:

Yury, would you be willing to work this out by email? -- I think it
was you who I discussed the context-subclassing with and that was
quite a pleasant experience.

--

___
Python tracker 

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



[issue32614] Fix documentation examples of using re with escape sequences

2018-01-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Definitely.  x.y code, including doc examples, should free of such warnings.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue32675] dict.__contains__(unhashable) raises TypeError where False was expected

2018-01-26 Thread R. David Murray

Change by R. David Murray :


--
resolution:  -> not a bug
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



[issue32446] ResourceLoader.get_data() should accept a PathLike

2018-01-26 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Hi Jay.  Thanks for your interest in contributing to Python!

Actually, I'm going to close this issue since we ultimately decided to 
deprecate the ResourceLoader ABC:

https://docs.python.org/3.7/library/importlib.html?highlight=resourceloader#importlib.abc.ResourceLoader

I'd also suggest that if you're interested in answering your questions for the 
curiosity, or want to contribute to Python in other areas, you should join the 
python-dev mailing list.

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Stefan Krah

Stefan Krah  added the comment:

Guido, I apologize for the outburst.  I had the impression that
msg310799 implicitly asserted my incompetence in benchmarking.

--

___
Python tracker 

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



[issue32615] Inconsistent behavior if globals is a dict subclass

2018-01-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I did take the code, and it would not run because of the indent.  With that 
fixed, it still did not run because the the indent in the quoted code fed to 
exec.  This does run:

import builtins
class K(dict):
def __getitem__(self, k):
if k not in builtins.__dict__:
print("get %s" % k)
return dict.__getitem__(self, k)
def __setitem__(self, k, v):
print("set %s" % k)
dict.__setitem__(self, k, v)
exec("""
foo = "bar"
foo
try:
qyz
except NameError:
pass
class K:
baz = foo
def f(ggg=foo): pass
def g(ggg=foo):
global f
f = 87
f
g()
""", K())

When I run in IDLE, which execs the entire code, so none is run at module 
level, I get the same result.  The same is true running directly in Python 
after wrapping the entire code with

exec('''
# and
''')

In this case, nothing other than the outer exec is run at module level.  So I 
am not sure there is a bug.  If you don't get a more definitive response here, 
I suggest posting to python-list for opinions on whether bug or feature.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Elvis Pranskevichus

Elvis Pranskevichus  added the comment:

FWIW, I ran bm_telco with pyperformance on a benchmark-tuned system and did not 
observe the slowdown.  Benchmarks were done on a release build 
(--enable-optimizations)

$ sudo (which python3) -m perf system tune

MASTER:

$ pyperformance run --python=envs/3.7-master-pgo-lto/prefix/bin/python3.7m 
--affinity=2,3 --rigorous --benchmarks=telco -o json/3.7-master.json
Python benchmark suite 0.6.1

[1/1] telco...
INFO:root:Running 
`/home/elvis/dev/python/performance/venv/cpython3.7-8cfe759dd297/bin/python -u 
/home/elvis/dev/python/performance/performance/benchmarks/bm_telco.py 
--rigorous --affinity=2,3 --output /tmp/tmpgszxc792`
.
telco: Mean +- std dev: 9.17 ms +- 0.32 ms


MASTER + contextvars patch:

$ pyperformance run 
--python=envs/3.7-master-pgo+lto+decimal-contextvars/prefix/bin/python3.7m 
--affinity=2,3 --rigorous --benchmarks=telco -o json/3.7-contextvars.json
Python benchmark suite 0.6.1

[1/1] telco...
INFO:root:Running 
`/home/elvis/dev/python/performance/venv/cpython3.7-8a6fbdee5a5b/bin/python -u 
/home/elvis/dev/python/performance/performance/benchmarks/bm_telco.py 
--rigorous --affinity=2,3 --output /tmp/tmp8y4mivnp`
.
telco: Mean +- std dev: 9.29 ms +- 0.19 ms


COMPARISON:

### telco ###
Mean +- std dev: 9.17 ms +- 0.32 ms -> 9.29 ms +- 0.19 ms: 1.01x slower
Not significant

--
nosy: +Elvis.Pranskevichus

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-26 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 226e50049da43097d89e9e99f9c55f212d1f7bd5 by Yury Selivanov in 
branch 'master':
bpo-32436: Make PyContextVar_Get a little bit faster (#5350)
https://github.com/python/cpython/commit/226e50049da43097d89e9e99f9c55f212d1f7bd5


--

___
Python tracker 

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



[issue32521] NIS module fails to build due to the removal of interfaces related to Sun RPC from glibc.

2018-01-26 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset 29a7df78277447cf6b898dfa0b1b42f8da7abc0c by Christian Heimes in 
branch 'master':
bpo-32521: nis libnsl (#5190)
https://github.com/python/cpython/commit/29a7df78277447cf6b898dfa0b1b42f8da7abc0c


--

___
Python tracker 

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



[issue32521] NIS module fails to build due to the removal of interfaces related to Sun RPC from glibc.

2018-01-26 Thread Christian Heimes

Change by Christian Heimes :


--
pull_requests: +5198

___
Python tracker 

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



[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2018-01-26 Thread R. David Murray

R. David Murray  added the comment:

I don't think this is a bug.  There are many ways to lie in Python.  If your 
object lies, it is on your head when things break :)  On the flip side, the 
ability to lie is very handy in many circumstances, and is often a case of duck 
typing rather than lying.  Unless I'm missing something, __getattribute__ is 
how attributes are accessed, so there would have to be a strong reason to 
deviate from that.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32521] NIS module fails to build due to the removal of interfaces related to Sun RPC from glibc.

2018-01-26 Thread Christian Heimes

Change by Christian Heimes :


--
pull_requests: +5199

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Elvis Pranskevichus

Elvis Pranskevichus  added the comment:

Likewise, on the same builds, running _decimal/tests/bench.py does not show a 
significant difference: 
https://gist.github.com/elprans/fb31510ee28a3aa091aee3f42fe65e00

--

___
Python tracker 

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



[issue15115] Duplicated Content-Transfer-Encoding header when applying email.encoders

2018-01-26 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +patch
pull_requests: +5200
stage: needs patch -> patch review

___
Python tracker 

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



[issue15115] Duplicated Content-Transfer-Encoding header when applying email.encoders

2018-01-26 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Hi David, 

I've made a pull request for the way I think you wanted this documented.  
Please take a look and let me know if it's even close to what you were 
suggesting.  Thanks!   :-)

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

Apologies accepted. I did not imply that -- I was simply stating that Yury
needed your help reproducing your result so he could do something about it.
It seems you two are taking this offline so I trust that there will be no
more barbs.

--

___
Python tracker 

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



[issue32545] Unable to install Python 3.7.0a4 on Windows 10 - Error 0x80070643: Failed to install MSI package.

2018-01-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Can one of the Windows experts look at the attached log?

--

___
Python tracker 

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



[issue32615] Inconsistent behavior if globals is a dict subclass

2018-01-26 Thread ppperry

ppperry  added the comment:

Uh, I'm not undertsanding the relevance of whether the code is run at 
module-level or not. It can't possibly be a feature that * some code * uses the 
overrides and *other code* doesn't.

--

___
Python tracker 

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



[issue32615] Inconsistent behavior if globals is a dict subclass

2018-01-26 Thread pmpp

Change by pmpp :


--
nosy: +pmpp

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread STINNER Victor

STINNER Victor  added the comment:

Since the root of the discussion is a performance regression, let me take a 
look since I also care of not regressing in term of performance. We (CPython 
core developers, as as team) spent a lot of time on optimizing CPython to make 
benchmarks like telco faster at each release. The good news is that Python 3.7 
*is* faster than Python 3.6 on telco. If I recall correctly, it's not because 
of recent optimizations in the decimal module, but more general changes like 
CALL_METHOD optimization!

Python master vs 3.6 (normalized on 3.6):

https://speed.python.org/comparison/?exe=12%2BL%2Bmaster%2C12%2BL%2B3.6&ben=670&env=1%2C2&hor=false&bas=12%2BL%2B3.6&chart=normal+bars

Graph of telco performance on master since April 2014 to January 2017:
https://speed.python.org/timeline/#/?exe=12&ben=telco&env=1&revs=50&equid=off&quarts=on&extr=on

20.2 ms => 14.1 ms, well done!

If you are curious of reasons why Python became faster, see my documentation:
http://pyperformance.readthedocs.io/cpython_results_2017.html

Or even my talk at Pycon 2017:
https://www.youtube.com/watch?v=d65dCD3VH9Q&t=957s

Sorry, I moved off topic. Let's move back to this measuring the performance of 
this issue...

--

I rewrote  xwith.py using my perf module to use CPU pinning (on my isolated 
CPUs), automatic calibration of the number of loops, ignore the first "warmup" 
value, spawn 20 processes, compute the average and standard deviation, etc. => 
see attached xwidth2.py

Results on my laptop with 2 physical cores isolated for best benchmark 
stability (*):

vstinner@apu$ ./python -m perf compare_to master.json pr5278.json 
Mean +- std dev: [master] 1.86 us +- 0.03 us -> [pr5278] 2.27 us +- 0.04 us: 
1.22x slower (+22%)

Note: master is the commit 29a7df78277447cf6b898dfa0b1b42f8da7abc0c and I 
rebased PR 5278 on top on this commit.

(*) 
http://perf.readthedocs.io/en/latest/run_benchmark.html#how-to-get-reproductible-benchmark-results

This is obvious the *worst* case: a *micro* benchmark using local contexts and 
modifying this local context. In this case, I understand that this 
microbenchmark basically measures the overhead of contextvars on modying a 
context.

The question here is if the bottleneck of applications using decimal is the 
code modifying the context or the code computing numbers (a+b, a*b, a/b, etc.).

Except for a few small projects, I rarely use decimal, so I'm unable to judge 
that.

But just to add my 2 cents, I never used "with localcontext()", I don't see the 
point of this tool in my short applications. I prefer to modify directly the 
current context (getcontext()), and only modify this context *once*, at 
startup. For example, set the rounding mode and set the precision, and that's 
all.

--

The Python benchmark suite does have a benchmark dedicated to the decimal 
module:
http://pyperformance.readthedocs.io/benchmarks.html#telco

I ran this benchmark on PR 5278:

vstinner@apu$ ./python -m perf compare_to telco_master.json telco_pr5278.json 
Benchmark hidden because not significant (1): telco

... not significant. Honestly, I'm not surprised at all:

* telco benchmark doesn't modify the context in the hot code, only *outside* 
the benchmark
* telco likely spends most of its runtime in computing numbers (sum += x; d = 
d.quantize(...), etc.) and converting Decimal to string. I don't know the 
decimal module, but I guess that it requires to *read* the current context. But 
getting the context is likely efficient and not significant compared to the 
cost of other operations.

FYI timings can be seen in verbose mode:

vstinner@apu$ ./python -m perf compare_to telco_master.json telco_pr5278.json -v
Mean +- std dev: [telco_master] 10.7 ms +- 0.4 ms -> [telco_pr5278] 10.7 ms +- 
0.4 ms: 1.00x faster (-0%)
Not significant!

--
nosy: +vstinner -Elvis.Pranskevichus
Added file: https://bugs.python.org/file47411/xwith2.py

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-26 Thread STINNER Victor

STINNER Victor  added the comment:

> Likewise, on the same builds, running _decimal/tests/bench.py does not show a 
> significant difference: 
> https://gist.github.com/elprans/fb31510ee28a3aa091aee3f42fe65e00

Note: it may be interesting to rewrite this benchmark my perf module to be able 
to easily check if a benchmark result is significant.

http://perf.readthedocs.io/en/latest/cli.html#perf-compare-to

"perf determines whether two samples differ significantly using a Student’s 
two-sample, two-tailed t-test with alpha equals to 0.95."

=> https://en.wikipedia.org/wiki/Student's_t-test


Usually, I consider that between 5% slower and 5% faster is not significant. 
But it depends how the benchmark was run, it depends on the type of benchmark, 
etc. Here I don't know bench.py so I cannot judge.

For example, for an optimization, I'm more interested by an optimization making 
a benchmark 10% faster ;-)

--

___
Python tracker 

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



[issue32615] Inconsistent behavior if globals is a dict subclass

2018-01-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I was referring back to your original a) and b) items.

Perhaps 'accidental' versus 'intentional, for whatever reason', would be the 
better contrast.

The weekly new issue report comes out on Fridays around noon eastern US.  I 
hope someone else clicks on this one.

I suggested the possibility of python-list because there would usually be 
people 'competing' to explain the puzzling behavior and check for obscure 
clauses on the reference.  In any case, some analysis would have to precede 
action.

--
nosy:  -pmpp

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-26 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
components: +macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



  1   2   >