[issue34405] Upgrade to OpenSSL 1.1.0i / 1.0.2p

2018-09-11 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +8609

___
Python tracker 

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



[issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion

2018-09-11 Thread Nick Coghlan


Nick Coghlan  added the comment:

The entire change affecting the PEP 538 implementation in 
https://github.com/python/cpython/commit/9454060e84a669dde63824d9e2fcaf295e34f687#diff-8c018c3ada66d06c8e101e47a313c2c7
 needs to be reverted: the locale should be coerced before *ANY* calls are made 
to Py_DecodeLocale, as the whole point of the architecture of the PEP 
implementation was to ensure that *nothing ever gets decoded incorrectly in the 
first place*.

I just initially missed that in Victor's enthusiasm for fixing the incorrect 
decodings that can arise in the absence of locale coercion he'd *introduced* 
incorrect decoding into the locale coercion case.

--
nosy: +ncoghlan, ned.deily
priority: normal -> release blocker

___
Python tracker 

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



[issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion

2018-09-11 Thread Nick Coghlan


Nick Coghlan  added the comment:

(The one exception to "nothing gets decoded incorrectly" is that 
PYTHONCOERCECLOCALE itself is always interpreted as an ASCII field: the values 
that it checks for are actually ASCII byte sequences, not Unicode code points.

The documentation could definitely be much clearer on that point though, as 
even in the PEP it's only implied by the final paragraph in 
https://www.python.org/dev/peps/pep-0538/#legacy-c-locale-coercion-in-the-standalone-python-interpreter-binary
 which is mostly talking about the fact that this particular environment 
variable is still checked, even if you pass the -I or -E command line options.

--

___
Python tracker 

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



[issue34405] Upgrade to OpenSSL 1.1.0i / 1.0.2p

2018-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8610

___
Python tracker 

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



[issue34405] Upgrade to OpenSSL 1.1.0i / 1.0.2p

2018-09-11 Thread Ned Deily


Ned Deily  added the comment:


New changeset 3102e24d83315eee42a94c460956fbcb92ac510f by Ned Deily in branch 
'master':
bpo-34405: Update to OpenSSL 1.1.0i for macOS installer builds (GH-9166)
https://github.com/python/cpython/commit/3102e24d83315eee42a94c460956fbcb92ac510f


--

___
Python tracker 

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



[issue34443] enum repr should use __qualname__

2018-09-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> Serhiy, why should __qualname__ always be used together with __module__?

Because what is the purpose of using __qualname__?

--

___
Python tracker 

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2018-09-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The solution with fileno() is clever, but as was mentioned before, it doesn't 
work if stdin or stdout are not real files, but something like StringIO. It is 
not that in common use of argparse for parsing arguments in scripts they are 
redefined, but argparse can be used in uncommon environments, for example for 
emulating command line in the environment like IDLE which redefines standard 
streams. And I'm sure this will break third-party tests which main() with 
patched stdin/stdout for testing CLI. The initial solution proposed by Moritz 
is more reliable, although it doesn't fix an issues with closing stdin/stdout. 
But this is a different issue at all.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion

2018-09-11 Thread Nick Coghlan


Nick Coghlan  added the comment:

FWIW, this is also why I don't want PEP 432 to expose any wstr fields in the 
configuration settings: it means embedding applications have to figure out 
which encoding Python is expecting to be used for those fields.

Everything should be much cleaner if the public API requires those settings to 
be provided as Py_Unicode objects, and the core configuration step takes care 
of getting the C API to the point where the embedding application can create 
Py_Unicode objects for passing to later steps.

The fact that CPython itself currently uses wstr to configure these settings 
should be considered a legacy implementation detail that we do our best to hide 
from the public API.

--

___
Python tracker 

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



[issue34443] enum repr should use __qualname__

2018-09-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think using more longer name in repr and/or str for *instances* of enum 
classes is not good idea. They are already verbose, and this will make them 
more verbose.

Actually in some cases when enum instances are exposed as module globals, I 
would want to make them including the module name instead of the enum class 
name. For example:

>>> import socket
>>> socket.AF_UNIX

>>> print(socket.AF_UNIX)
AddressFamily.AF_UNIX

"socket.AF_UNIX" instead of "AddressFamily.AF_UNIX" would look better to me.

--

___
Python tracker 

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



[issue34579] test_embed.InitConfigTests fail on AIX

2018-09-11 Thread Eric Snow


Change by Eric Snow :


--
nosy: +eric.snow, vstinner

___
Python tracker 

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



[issue34405] Upgrade to OpenSSL 1.1.0i / 1.0.2p

2018-09-11 Thread Ned Deily


Ned Deily  added the comment:


New changeset 3235fac0d7d94ad6464a162261c18a424829d2e5 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
bpo-34405: Update to OpenSSL 1.1.0i for macOS installer builds (GH-9166) 
(GH-9167)
https://github.com/python/cpython/commit/3235fac0d7d94ad6464a162261c18a424829d2e5


--

___
Python tracker 

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



[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2018-09-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue4921] Object lifetime and inner recursive function

2018-09-11 Thread Eric Snow


Change by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue34443] enum repr should use __qualname__

2018-09-11 Thread Ethan Furman


Ethan Furman  added the comment:

Serhiy said:
---
> I think using more longer name in repr and/or str for *instances* of
> enum classes is not good idea. They are already verbose, and this
> will make them more verbose.

I'm okay with verbose reprs, as debugging is the primary feature for those (at 
least for me).  I'm not okay with __str__ being other than what it is now (but 
see below).

Serhiy also said:

> Actually in some cases when enum instances are exposed as module
> globals, I would want to make them including the module name instead
> of the enum class name. For example:
> 
> >>> import socket
> >>> socket.AF_UNIX
> 
> >>> print(socket.AF_UNIX)
> AddressFamily.AF_UNIX
>
> "socket.AF_UNIX" instead of "AddressFamily.AF_UNIX" would look better
> to me.

Since AddressFamily, and other stdlib converted constants, are created user 
`_convert`, I have no problem with that method also changing the __str__ to be 
`module.member' instead.

--

___
Python tracker 

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



[issue34641] Curiosity: f((a)=1) is not a syntax error -- why?

2018-09-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There seems to be some of the similar cases that have tests added as part of 
c960f26044edaea6669e60859ecf590c63c65e62 and the original error message added 
at 3e0055f8c65c407e74ce476b8e2b1fb889723514.

Existing tests : 

>>> f(x()=2)
Traceback (most recent call last):
SyntaxError: keyword can't be an expression
>>> f(a or b=1)
Traceback (most recent call last):
SyntaxError: keyword can't be an expression
>>> f(x.y=1)
Traceback (most recent call last):
SyntaxError: keyword can't be an expression


Thanks

--

___
Python tracker 

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



[issue33986] asyncio: Typo in documentation: BaseSubprocessTransport -> SubprocessTransport

2018-09-11 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Superseded by #33649

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> asyncio docs overhaul

___
Python tracker 

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



[issue33649] asyncio docs overhaul

2018-09-11 Thread Yury Selivanov


Yury Selivanov  added the comment:

The first PR has been just landed.

The plan is to work in 'master' branch and when the docs are ready we backport 
them to 3.7 in one big PR.

So far the following files were updated/reviewed:

 Doc/library/asyncio-eventloop.rst
 Doc/library/asyncio-eventloops.rst -> Doc/library/asyncio-policy.rst
 Doc/library/asyncio-exceptions.rst
 Doc/library/asyncio-platforms.rst 
 Doc/library/asyncio-policy.rst
 Doc/library/asyncio-protocol.rst  
 Doc/library/asyncio-queue.rst 
 Doc/library/asyncio-stream.rst
 Doc/library/asyncio-subprocess.rst 

Please feel free to submit PR to fix/improve the above (but not other files as 
I'm going to be making some heavy edit passes on them).

--

___
Python tracker 

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



[issue34630] Don't log ssl cert errors in asyncio

2018-09-11 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue34443] enum repr should use __qualname__

2018-09-11 Thread Ethan Furman


Ethan Furman  added the comment:

Okay, I might be changing my mind.  In most cases I suspect the difference 
would be minimal, but when it isn't, it really isn't.  Take this example from a 
pydoc test:

  class Color(enum.Enum)
   |  Color(value, names=None, *, module=None, qualname=None, type=None, 
start=1)
   |  
   |  An enumeration.
   |  
   |  Method resolution order:
   |  Color
   |  enum.Enum
   |  builtins.object
   |  
   |  Data and other attributes defined here:
   |  
-  |  blue = 
+  |  blue = 
   |  
-  |  green = 
+  |  green = 
   |  
-  |  red = 
+  |  red = 

It feels like the important information is completely lost in the noise.

Okay, I'm rejecting the __repr__ changes.  Besides the potential verbosity, 
there should usually only be one of any particular Enum, __module__ and 
__qualname__ are both readily available when there are more than one (either on 
accident or by design), and users can modify their own __repr__s if they like.

I'm still thinking about the change in _convert_ to modify __str__ to use the 
module name instead of the class name  Here are my questions about that:

- Modify just __str__ or __repr__ as well?
socket.AF_UNIX instead of AddressFamily.AF_UNIX
 instead of 

- potential confusion that actual instances of Enum in the stdlib appear
  differently than "regular" Enums?  Or perhaps call out those differences
  in the documentation as examples of customization?

--

___
Python tracker 

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



[issue34465] ipaddress should accept bytearray in addition to bytes

2018-09-11 Thread Jörn Heissler

Jörn Heissler  added the comment:

> Maybe add a special purposed named constructor IPv4Address.from_bytes() that 
> will accept any objects supporting the buffer protocol?

That would work for me.
I wonder if there should be something like ipaddress.ip_address_from_bytes too 
that can construct IPv4Adress or IPv6Address.

--

___
Python tracker 

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



[issue34628] urllib.request.urlopen fails when userinfo is present in URL

2018-09-11 Thread Niklas Sombert


New submission from Niklas Sombert :

Today I tried to access URLs like this one: http://user:1...@example.net:8080.

The result was this:
>>> import urllib.request
>>> urllib.request.urlopen("http://user:1...@example.net:1234/;)
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/urllib/request.py", line 1317, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/local/lib/python3.7/http/client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1016, in _send_output
self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 956, in send
self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 928, in connect
(self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 707, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/local/lib/python3.7/socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
  File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1345, in http_open
return self.do_open(http.client.HTTPConnection, req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1319, in do_open
raise URLError(err)
urllib.error.URLError: 


At first, I checked my network connection, but that turned out to be okay. Even 
funnier:

>>> urllib.request.urlopen("http://user:1...@example.net/;) 
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/http/client.py", line 877, in _get_hostport
port = int(host[i+1:])
ValueError: invalid literal for int() with base 10: '1...@example.net'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
  File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1345, in http_open
return self.do_open(http.client.HTTPConnection, req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1285, in do_open
h = http_class(host, timeout=req.timeout, **http_conn_args)
  File "/usr/local/lib/python3.7/http/client.py", line 841, in __init__
(self.host, self.port) = self._get_hostport(host, port)
  File "/usr/local/lib/python3.7/http/client.py", line 882, in _get_hostport
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
http.client.InvalidURL: nonnumeric port: '1...@example.net'

So, urllib seems to have problems parsing HTTP URLs which contain a userinfo 
part. (Requests works.)

--
components: Library (Lib)
messages: 325022
nosy: ytvwld
priority: normal
severity: normal
status: open
title: urllib.request.urlopen fails when userinfo is present in URL
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue34553] Python Crashes when trying to access any date related fields in MailItem

2018-09-11 Thread Erik Janssens


Erik Janssens  added the comment:

@vijay may I suggest you try to investigate your issue in more detail :

- does it depend on the Python version ?  If so which versions work, which dont.

- does the crash happen as well when using the REPL ?

- if you use PyQt instead of pywin32, does it still crash ?

Not that any of these suggestions will lead to a clear solution, but it might 
at least rule out some things.

--

___
Python tracker 

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



[issue29832] Don't refer to getsockaddrarg in error messages

2018-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 735171e33486131d93865cf851c0c3d63fffd364 by Benjamin Peterson 
(Oren Milman) in branch 'master':
closes bpo-29832: Remove "getsockaddrarg" from error messages. (GH-3163)
https://github.com/python/cpython/commit/735171e33486131d93865cf851c0c3d63fffd364


--
nosy: +benjamin.peterson
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



[issue34622] Extract asyncio exceptions into a separate file

2018-09-11 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 0baa72f4b2e7185298d09cf64c7b591efcd22af0 by Andrew Svetlov in 
branch 'master':
bpo-34622: Extract asyncio exceptions into a separate module (GH-9141)
https://github.com/python/cpython/commit/0baa72f4b2e7185298d09cf64c7b591efcd22af0


--

___
Python tracker 

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



[issue26502] traceback.extract_tb breaks compatibility by returning FrameSummary

2018-09-11 Thread Berker Peksag


Berker Peksag  added the comment:

Thanks for merging this, Petr. What do you think about backporting to 3.7?

--
components:  -Documentation
versions: +Python 3.8

___
Python tracker 

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



[issue34629] Python3 regression for urllib(2).urlopen(...).fp for chunked http responses

2018-09-11 Thread Thibault Kruse


New submission from Thibault Kruse :

We had a problem running code that downloads files from github when porting 
from python2.7 to python3.[3-7]. Not sure if a bug or not.

With the given code, in python3 a file downloaded in chunks will contain the 
size of chunks when using the undocumented fp from urlopen(...).fp. In python2, 
only the chunk payload would make it into the file.

We assume that we can just use the urlopen response directly as a fix (without 
'.fp'), but though it might still be nice to report the difference.

Short code:
resp = urlopen('http://someurl')
fhand = os.fdopen(fdesc, "wb")
shutil.copyfileobj(resp.fp, fhand)   # using .fp here is the dodgy part
fhand.close()

The attached script demonstrates the difference:

$ python --version
Python 2.7.15rc1
$ python urllib_issue.py 
127.0.0.1 - - [12/Sep/2018 01:27:28] "GET /downloads/1.0.tar.gz HTTP/1.1" 200 -

$ python3 --version
Python 3.6.5
$ python3 urllib_issue.py 
127.0.0.1 - - [12/Sep/2018 01:27:37] "GET /downloads/1.0.tar.gz HTTP/1.1" 200 -
Traceback (most recent call last):
  File "urllib_issue.py", line 87, in 
assert data == FILE_CONTENT, '%s, %s'%(len(FILE_CONTENT), len(data))
AssertionError: 10, 100493
!!! BASH reports ERROR: shell returned 1

--
components: Library (Lib)
files: urllib_issue.py
messages: 325025
nosy: tkruse
priority: normal
severity: normal
status: open
title: Python3 regression for urllib(2).urlopen(...).fp for chunked http 
responses
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47796/urllib_issue.py

___
Python tracker 

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



[issue34553] Python Crashes when trying to access any date related fields in MailItem

2018-09-11 Thread Erik Janssens


Erik Janssens  added the comment:

@ronaldoussoren In my case it was not Outlook, it was a third party line of 
business application,
but as in the case of the OP, as mentioned in the StackOverflow link, the 
crashing only happens using certain Python version.

I'm not suggesting the issue of the OP (nor mine) is in CPython.  But it's 
strange at least that it depends on the Python version, and that it does not 
crash when using the REPL (I did try to compensate for delays etc.).

I took the PyQt route to 'proof' the issue is not related to pywin32.

When running it in a debugger, the crash happens in an MFC dll, after the 
Invoke of the COM method.

So my guess is the issue is related to some incompatibility in MSVC libraries 
between CPython and the line of business application.

--

___
Python tracker 

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



[issue33649] asyncio docs overhaul

2018-09-11 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 7c7605ff1133cf757cac428c483827f666c7c827 by Yury Selivanov in 
branch 'master':
bpo-33649: First asyncio docs improvement pass (GH-9142)
https://github.com/python/cpython/commit/7c7605ff1133cf757cac428c483827f666c7c827


--

___
Python tracker 

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



[issue34630] Don't log ssl cert errors in asyncio

2018-09-11 Thread Andrew Svetlov


New submission from Andrew Svetlov :

It is reported as a regular exception, not need to log it (as we skip logging 
of connection errors already).

--
messages: 325032
nosy: asvetlov
priority: normal
severity: normal
status: open
title: Don't log ssl cert errors in asyncio

___
Python tracker 

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



[issue34631] Upgrade to OpenSSL 1.1.1

2018-09-11 Thread Christian Heimes


New submission from Christian Heimes :

OpenSSL 1.1.1 was released today. The blog post 
https://www.openssl.org/blog/blog/2018/09/11/release111/ lists all major 
improvements.

Highlights:
* TLS 1.3
* API and ABI compatible with OpenSSL 1.1.0
* LTS release (support schedule TBD)

All tests on master are passing with OpenSSL 1.1.1. I still want to hold off 
and wait a couple of patch releases, before we start to ship Windows and macOS 
builds with 1.1.1. Some aspects of the TLS 1.3 handshake are different to TLS 
1.2. I might have to implement some additional APIs for post handshake 
authentication.

--
assignee: christian.heimes
components: SSL
messages: 325034
nosy: alex, christian.heimes, dstufft, janssen
priority: normal
severity: normal
status: open
title: Upgrade to OpenSSL 1.1.1
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue34622] Extract asyncio exceptions into a separate file

2018-09-11 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue29386] select.epoll.poll may behave differently if timeout = -1 vs timeout = None

2018-09-11 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset b690b9b04729ba3d91c59bff1bb11c3dcc1b50fc by Berker Peksag in 
branch 'master':
bpo-29386: Pass -1 to epoll_wait() when timeout is < -1 (GH-9040)
https://github.com/python/cpython/commit/b690b9b04729ba3d91c59bff1bb11c3dcc1b50fc


--

___
Python tracker 

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



[issue29386] select.epoll.poll may behave differently if timeout = -1 vs timeout = None

2018-09-11 Thread Berker Peksag


Change by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue28617] Why isn't "in" called a comparison operation?

2018-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8613

___
Python tracker 

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



[issue28617] Why isn't "in" called a comparison operation?

2018-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8612

___
Python tracker 

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



[issue28617] Why isn't "in" called a comparison operation?

2018-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 08bcf647d8a92e4bd47531588b284c6820b7a7ef by Miss Islington (bot) 
(wim glenn) in branch 'master':
bpo-28617 Fixed docs inaccuracies about the types that support membership tests 
(GH-9086)
https://github.com/python/cpython/commit/08bcf647d8a92e4bd47531588b284c6820b7a7ef


--
nosy: +miss-islington

___
Python tracker 

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



[issue26502] traceback.extract_tb breaks compatibility by returning FrameSummary

2018-09-11 Thread Petr Viktorin


Petr Viktorin  added the comment:

I don't think I have a good enough feel for what should, generally, go to 3.7. 
So take my opinion with a grain of salt.

But honestly, I don't think the issue is important enough -- I've only seen one 
codebase affected by it, which wasn't hard to fix.

--

___
Python tracker 

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



[issue31704] HTTP check lowercase response from proxy

2018-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

The spec, https://tools.ietf.org/html/rfc7230#section-2.6, is quite clear that 
the HTTP version is case sensitive. In practice, not every client is lax. 
Firefox does a case-insensitive comparison, but libcurl requires uppercase. 
That makes me think we can safely stay strict.

--
nosy: +benjamin.peterson
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



[issue33649] asyncio docs overhaul

2018-09-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34628] urllib.request.urlopen fails when userinfo is present in URL

2018-09-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue26502] traceback.extract_tb breaks compatibility by returning FrameSummary

2018-09-11 Thread Berker Peksag


Berker Peksag  added the comment:

Ok, let's close this issue then.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue34595] PyUnicode_FromFormat(): add %T format for an object type name

2018-09-11 Thread Petr Viktorin


Petr Viktorin  added the comment:

> The PEP 399 requires that C accelerator behaves exactly as Python, [...]

It does not. PEP 399 requires that that the C code must pass the same *test 
suite*. And error messages in particular tend to not be checked in tests.

Anyway, I don't see how that applies to replacing `Py_TYPE(obj)->tp_name` by 
`%T`. The real reason for *that* change is removing borrowed references, right?
I have not yet seen a good reason why Py_TYPE(obj) is bad. The reasons you give 
in https://pythoncapi.readthedocs.io/bad_api.html#borrowed-references are about 
tagged pointers and PyList_GetItem(), but Py_TYPE() is very different.

I don't think the reasons are strong enough to add new API to 
PyUnicode_FromFormat().

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

2018-09-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

The question here is: what should asdict() return if the dataclass contains a 
namedtuple? What the code is trying to do (but currently failing!) is to return 
another namedtuple, but with the values returned by recursively calling in to 
asdict() (or rather, its helper function) for each field in the namedtuple.

I think this is the correct behavior. Specifically, I do not want to call the 
namedtuple's _asdict() method. There are two problems with _asdict():

1. It doesn't recurse in to the fields, like asdict() normally does with a 
dict, list, or tuple.

2. It returns a dict! This is a problem because if a dataclass field contains a 
dict which has a key which is a namedtuple, then asdict() would fail.

Here's an example of #2 above, if asdict() on a namedtuple field returns a dict:

@dataclass
class C:
f: 'Any'

T = namedtuple('T', 'a')

c = C({T('an a'): 0})
print('c:', c)
print(asdict(c))   # <- error here

prints:

c: C(f={T(a='an a'): 0})
Traceback (most recent call last):
...
  File "/home/eric/python/lib/dataclasses.py", line 1019, in asdict
return _asdict_inner(obj, dict_factory)
  File "/home/eric/python/lib/dataclasses.py", line 1026, in _asdict_inner
value = _asdict_inner(getattr(obj, f.name), dict_factory)
  File "/home/eric/python/lib/dataclasses.py", line 1059, in _asdict_inner
for k, v in obj.items())
TypeError: unhashable type: 'collections.OrderedDict'

So, although it's unfortunate, I think the only reasonable thing to do in this 
case is to have asdict() on a namedtuple return another namedtuple. Here's how 
that looks using the above code:

c: C(f={T(a='an a'): 0})
{'f': {T(a='an a'): 0}}

Admittedly, this can't be used with json.dumps() (you get "TypeError: keys must 
be str, int, float, bool or None, not T"), but I think it's the best we can do. 
It's consistent with any other class derived from tuple or list: asdict() will 
convert it to a copy of the class, recursing into each item that's in the tuple 
or list.

--

___
Python tracker 

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



[issue34600] python3 regression ElementTree.iterparse() unable to capture comments

2018-09-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Than your for your example Martin. Now I see what is not working. Indeed, using 
the TreeBuilder subclass is recommended way, but iterparse() was designed to 
accept only exact TreeBuilder. Actually there is an intention to consider the 
parser parameter of iterparse() as internal and remove it from the public API 
(also the deprecation warning is not emitted yet).

I don't see a way to fix this. Since this feature never worked in Python 3, and 
the Python 2 way looks as using implementation details, I think we should 
consider adding it as a new feature rather of a buf fix. Adding support of 
"comment" and "pi" as event types in iterparse looks reasonable to me. Eli, 
what are your thoughts?

I agree with you Marting that using your own copy from the source code is the 
best way of solving your problem on current Python 3.

--

___
Python tracker 

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



[issue34613] asyncio.StreamReader initialization documentation incorrectly declare limit as None

2018-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset cb51dd7cac6a6e2a7ba67fa4cd328a68f630095b by Miss Islington (bot) 
in branch '3.6':
bpo-34613: document the correct value of limit argument of asyncio.StreamReader 
(GH-9121)
https://github.com/python/cpython/commit/cb51dd7cac6a6e2a7ba67fa4cd328a68f630095b


--

___
Python tracker 

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



[issue31608] crash in methods of a subclass of _collections.deque with a bad __new__()

2018-09-11 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
pull_requests: +8618

___
Python tracker 

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



[issue34629] Python3 regression for urllib(2).urlopen(...).fp for chunked http responses

2018-09-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue28617] Why isn't "in" called a comparison operation?

2018-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 889f080a4d5cdb1cfb901b953f4b89f3ea806bbe by Miss Islington (bot) 
in branch '3.6':
bpo-28617 Fixed docs inaccuracies about the types that support membership tests 
(GH-9086)
https://github.com/python/cpython/commit/889f080a4d5cdb1cfb901b953f4b89f3ea806bbe


--

___
Python tracker 

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



[issue28617] Why isn't "in" called a comparison operation?

2018-09-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Humm, why the bot merges in the master branch?

--

___
Python tracker 

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



[issue34613] asyncio.StreamReader initialization documentation incorrectly declare limit as None

2018-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset b4ec36200a959da70eba94c19826446a8efdffdd by Miss Islington (bot) 
(Bram) in branch 'master':
bpo-34613: document the correct value of limit argument of asyncio.StreamReader 
(GH-9121)
https://github.com/python/cpython/commit/b4ec36200a959da70eba94c19826446a8efdffdd


--
nosy: +miss-islington

___
Python tracker 

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



[issue34613] asyncio.StreamReader initialization documentation incorrectly declare limit as None

2018-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8615

___
Python tracker 

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



[issue34613] asyncio.StreamReader initialization documentation incorrectly declare limit as None

2018-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8614

___
Python tracker 

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



[issue31608] crash in methods of a subclass of _collections.deque with a bad __new__()

2018-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 24bd50bdcc97d65130c07d6cd26085fd06c3e972 by Benjamin Peterson 
(Oren Milman) in branch 'master':
closes bpo-31608: Fix a crash in methods of a subclass of _collections.deque 
with a bad __new__(). (GH-3788)
https://github.com/python/cpython/commit/24bd50bdcc97d65130c07d6cd26085fd06c3e972


--
nosy: +benjamin.peterson
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



[issue31636] test_locale failure on OpenBSD

2018-09-11 Thread Benjamin Peterson


Change by Benjamin Peterson :


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

___
Python tracker 

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



[issue34613] asyncio.StreamReader initialization documentation incorrectly declare limit as None

2018-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset e02ca4270ef258162215e345c23025bec27f9eb0 by Miss Islington (bot) 
in branch '3.7':
bpo-34613: document the correct value of limit argument of asyncio.StreamReader 
(GH-9121)
https://github.com/python/cpython/commit/e02ca4270ef258162215e345c23025bec27f9eb0


--

___
Python tracker 

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



[issue31608] crash in methods of a subclass of _collections.deque with a bad __new__()

2018-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 536e45accf8f05355dd943a6966b9968cdb15f5a by Miss Islington (bot) 
in branch '3.7':
closes bpo-31608: Fix a crash in methods of a subclass of _collections.deque 
with a bad __new__(). (GH-3788)
https://github.com/python/cpython/commit/536e45accf8f05355dd943a6966b9968cdb15f5a


--
nosy: +miss-islington

___
Python tracker 

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



[issue34600] python3 regression ElementTree.iterparse() unable to capture comments

2018-09-11 Thread Stefan Behnel


Stefan Behnel  added the comment:

lxml supports "comment" and "pi" as event types in iterparse (or, more 
specifically, in the XMLPullParser). If someone wants to implement this for 
(c)ElementTree, I'd be happy to review the PR.

https://lxml.de/api/lxml.etree.XMLPullParser-class.html

--
type: behavior -> enhancement
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue28617] Why isn't "in" called a comparison operation?

2018-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 3e648f8371e342ccfa663ad77e82a538fcc8c9fb by Miss Islington (bot) 
in branch '3.7':
bpo-28617 Fixed docs inaccuracies about the types that support membership tests 
(GH-9086)
https://github.com/python/cpython/commit/3e648f8371e342ccfa663ad77e82a538fcc8c9fb


--

___
Python tracker 

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



[issue34632] Port importlib_metadata to Python 3.8

2018-09-11 Thread Barry A. Warsaw


New submission from Barry A. Warsaw :

https://importlib_metadata.rtfd.org

We're fleshing out the API and implementation in the standalone library, but 
once we're confident of the API and semantics, we will want to port this into 
Python 3.8.

--
assignee: barry
components: Library (Lib)
messages: 325043
nosy: barry, brett.cannon, jason.coombs
priority: normal
severity: normal
status: open
title: Port importlib_metadata to Python 3.8
versions: Python 3.8

___
Python tracker 

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



[issue31608] crash in methods of a subclass of _collections.deque with a bad __new__()

2018-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8616

___
Python tracker 

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



[issue34409] Add a way to customize iteration over fields in asdict() for the nested dataclasses

2018-09-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

I've been thinking about this, but I don't have a suggestion on how to improve 
the API. Maybe some sort of visitor pattern? I'm open to concrete ideas.

--

___
Python tracker 

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



[issue31608] crash in methods of a subclass of _collections.deque with a bad __new__()

2018-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset ccbbdd0a1e00ecad6f0005438dd6ff6d84fd9ceb by Benjamin Peterson in 
branch '3.6':
[3.6] closes bpo-31608: Fix a crash in methods of a subclass of 
_collections.deque with a bad __new__(). (GH-9178)
https://github.com/python/cpython/commit/ccbbdd0a1e00ecad6f0005438dd6ff6d84fd9ceb


--

___
Python tracker 

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



[issue34586] collections.ChainMap should have a get_where method

2018-09-11 Thread Zahari Dim


Zahari Dim  added the comment:

>
> I've discussed this with other core devs and spent a good deal of time 
> evaluating this proposal.  I'm going to pass on the this one but do think it 
> was a inspired suggestion.  Thank you for the proposal.

Thank you for taking the time to consider it. I understand that there
are many proposals.

>
> --
>
> Note, the original get_where() recipe has an issue.  Upon successful lookup, 
> it returns a 2-tuple but on failure it calls __missing__ which typically 
> returns a scalar (if it doesn't raise an exception).

FWIW this was intended to work when `__missing__` was subclassed to
raise a more specific exception. The case where it is made to return a
value clearly doesn't play well with the proposed method, and would
likely need to be subclassed as well. I consider this an acceptable
trade off because I find this use case rather esoteric: the same
functionality could be achieved in an arguably clearer way by passing
a mapping with the desired missing semantics as the outermost scope.

--

___
Python tracker 

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



[issue25041] document AF_PACKET socket address format

2018-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset a00de685c11cf8bdca1f8efa7aab80552d80ddfb by Benjamin Peterson in 
branch '3.6':
[3.6] closes bpo-25041: Document AF_PACKET socket address format. (GH-9209)
https://github.com/python/cpython/commit/a00de685c11cf8bdca1f8efa7aab80552d80ddfb


--

___
Python tracker 

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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2018-09-11 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +8607

___
Python tracker 

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



[issue34569] test__xxsubinterpreters.ShareableTypeTests._assert_values fails on AIX - 32-bit mode

2018-09-11 Thread Eric Snow


Eric Snow  added the comment:

Thanks for bringing this up, Michael.  I'll give you a review on the PR 
sometime this week (while at the core sprint).

--

___
Python tracker 

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



[issue34553] Python Crashes when trying to access any date related fields in MailItem

2018-09-11 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

There's not enough information in the issue to be sure, but I'm inclined to say 
this is a 3th-party problem.  To be sure someone will have to reproduce the 
problem in a debugger, or provide a stack trace of the crash.

The initial message says there's a crash when using pywin32 to access 
particular COM APIs, and msg324713 says that the same thing can happen when 
using PyQt.

Either project is 3th-party, as is the actual COM dispatch machinery in 
Windows. And the past has shown that crashes that happen when 3th-party 
extensions are involved are almost never due to bugs in CPython.

@erikjanss: I'm assuming that you mean that using PyQt to access and outlook 
COM API can cause a crash, is that correct?

--

___
Python tracker 

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



[issue32490] subprocess: duplicate filename in exception message

2018-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

The builtin exception is better now, so I don't see a problem with reverting 
the original patch.

--

___
Python tracker 

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



[issue32490] subprocess: duplicate filename in exception message

2018-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 73870bfeb9cf350d84ee88bd25430c104b3c6191 by Benjamin Peterson 
(Zackery Spytz) in branch 'master':
closes bpo-32490: Fix filename duplication in subprocess exception message. 
(GH-9163)
https://github.com/python/cpython/commit/73870bfeb9cf350d84ee88bd25430c104b3c6191


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



[issue31608] crash in methods of a subclass of _collections.deque with a bad __new__()

2018-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 253279c616d4f34287c5749df15e20eb2eb988d6 by Benjamin Peterson in 
branch '2.7':
[2.7] closes bpo-31608: Fix a crash in methods of a subclass of 
_collections.deque with a bad __new__(). (GH-9179)
https://github.com/python/cpython/commit/253279c616d4f34287c5749df15e20eb2eb988d6


--

___
Python tracker 

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



[issue32502] uuid1() fails if only 64-bit interface addresses are available

2018-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset d919c60e6936f853ad15040017f2c0bce0f027f8 by Benjamin Peterson 
(Chih-Hsuan Yen) in branch '2.7':
[2.7] bpo-32502: Discard 64-bit (and other invalid) hardware addresses (GH-9125)
https://github.com/python/cpython/commit/d919c60e6936f853ad15040017f2c0bce0f027f8


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue15727] PyType_FromSpecWithBases tp_new bugfix

2018-09-11 Thread Petr Viktorin


Petr Viktorin  added the comment:

Converting static types to heap ones is just one of the reasons to use 
PyType_FromSpec*. Another ones are writing such classes from scratch, and 
converting pure-Python classes to C. I don't think PyObject_FailingNew is a 
good default for either of those.

I think Sehriy's solution in bpo-26979 is better: document this, and allow 
setting a slot to NULL explicitly.

--

___
Python tracker 

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



[issue34365] datetime's documentation refers to "comparison [...] falling back to the default scheme of comparing object addresses"

2018-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 9c223794c754408644c16349b85dd27fdba8a926 by Miss Islington (bot) 
(Danish Prakash) in branch 'master':
bpo-34365: Update date object documentation (GH-8814)
https://github.com/python/cpython/commit/9c223794c754408644c16349b85dd27fdba8a926


--
nosy: +miss-islington

___
Python tracker 

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



[issue34365] datetime's documentation refers to "comparison [...] falling back to the default scheme of comparing object addresses"

2018-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8620

___
Python tracker 

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



[issue34365] datetime's documentation refers to "comparison [...] falling back to the default scheme of comparing object addresses"

2018-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8619

___
Python tracker 

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



[issue26979] The danger of PyType_FromSpec()

2018-09-11 Thread Petr Viktorin


Petr Viktorin  added the comment:

I don't think PEP 384 should be updated. It documents the feature as it was 
added, and shouldn't be used as documentation now.
Instead, Python documentation should be improved to cover all of PEP 389.
I submitted a pull request for that (GH-9154).

For this issue, the fix should be updating C API documentation and, for Pyhon 
3.8+, making {*, NULL} slots override the inherited value.

I think the PyType_Spec/PyType_Slot copying should have its own issue.

--

___
Python tracker 

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



[issue34365] datetime's documentation refers to "comparison [...] falling back to the default scheme of comparing object addresses"

2018-09-11 Thread Mariatta Wijaya


Mariatta Wijaya  added the comment:

Thanks!

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



[issue34409] Add a way to customize iteration over fields in asdict() for the nested dataclasses

2018-09-11 Thread mkurnikov


mkurnikov  added the comment:

Cleanest thing I could think of is:

1. Extract dataclass_to_dict function from _asdict_inner as:

def dataclass_asdict(obj, dict_factory):
result = []
for f in fields(obj):
value = _asdict_inner(getattr(obj, f.name), dict_factory)
result.append((f.name, value))
return dict_factory(result)

2. Add "asdict" parameter to the dataclass decorator (with default value of 
dataclass_to_dict function)

@dataclass(asdict=specific_dcls_dict_factory)
class MyDataclass:
pass

3. Change check to 

def _asdict_inner(obj, dict_factory):
if _is_dataclass_instance(obj):
return getattr(obj, _PARAMS).asdict(obj) 

# ... other code


Other solution could be to add parameter "directly_serializable"(smth like 
that), add check for this parameter

def _asdict_inner(obj, dict_factory):
if _is_dataclass_instance(obj):
if getattr(obj, _PARAMS).directly_serializable: 
return dict_factory(obj)

# ... other code

and force user to process everything in dict_factory function.

--

___
Python tracker 

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



[issue34633] Simplify __reduce__ for ordered dict.

2018-09-11 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

The code for __reduce__ in ordered dictionaries can be simplified in the 
similar way issue34573 is treating dict and set objects.

--
components: Interpreter Core
messages: 325063
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Simplify __reduce__ for ordered dict.
type: performance
versions: Python 3.8

___
Python tracker 

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



[issue34634] New asyncio streams API

2018-09-11 Thread Andrew Svetlov


New submission from Andrew Svetlov :

Currently, we have separate classes: reader and writer.

It is very inconvenient: these classes are tightly coupled internally, there is 
no sense to have two objects to the single logical entity.

The second problem is `writer.write()` synchronous API. To support flow control 
user should call `await writer.drain()` after every `writer.write()` call. But 
he/she can forget about drain() easy.

`writer.write()` should be softly deprecated in favor of `await writer.send()`. 
`writer.writelines()` is not very useful, better to merge all buffers before 
`await stream.send(data)` call. `writelines` should be softly deprecated as 
well without async replacement.

The last issue is `writer.close()` which should always be used in conjunction 
with `await writer.wait_closed()`. Let's return a future from `writer.close()`. 
The encouraged usage becomes `await writer.close()`. 
To immediate closing let's add `writer.abort()` sync function which cleans up 
resources without waiting for actual closing.

--
messages: 325064
nosy: asvetlov
priority: normal
severity: normal
status: open
title: New asyncio streams API

___
Python tracker 

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



[issue34634] New asyncio streams API

2018-09-11 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue34633] Simplify __reduce__ for ordered dict.

2018-09-11 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue34365] datetime's documentation refers to "comparison [...] falling back to the default scheme of comparing object addresses"

2018-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset e2b40f4ce954ea3d35a73541029b2253abd9d245 by Miss Islington (bot) 
in branch '3.7':
bpo-34365: Update date object documentation (GH-8814)
https://github.com/python/cpython/commit/e2b40f4ce954ea3d35a73541029b2253abd9d245


--

___
Python tracker 

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



[issue34365] datetime's documentation refers to "comparison [...] falling back to the default scheme of comparing object addresses"

2018-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 8a2c2d4e1b6b46a9a982e5c064ca4399ec28d55d by Miss Islington (bot) 
in branch '3.6':
bpo-34365: Update date object documentation (GH-8814)
https://github.com/python/cpython/commit/8a2c2d4e1b6b46a9a982e5c064ca4399ec28d55d


--

___
Python tracker 

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



[issue34635] inspect: add tools for inspecting subclasses

2018-09-11 Thread Benjamin Mintz


New submission from Benjamin Mintz :

Adds inspect.getsubclasses, inspect.getallsubclasses (recursive), and 
inspect.getsubclasstree (recursive, maintains structure).

See documentation for more details.

--
components: Library (Lib)
messages: 325068
nosy: bmintz
priority: normal
severity: normal
status: open
title: inspect: add tools for inspecting subclasses
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-09-11 Thread Nathaniel Manista

Nathaniel Manista  added the comment:

I’d like to try to steer this conversation back toward what I think is the 
actionable question: “does the exemplification of this practice in the Errors 
and Exceptions portion of The Python Tutorial bring about a net benefit or a 
net cost to its intended audience?”.

What is the benefit? It is that when an author happens to be authoring a module 
*all user-defined Exception subclasses of which satisfy some 
more-specific-than-Exception type* the author is led to define an intermediate 
class between Exception and the directly-used user-defined Exception subclasses 
capturing that type in a usable code element.

What readers of the tutorial enjoy this benefit? Pretty much only those authors 
(who happen to be authoring a module *all user-defined Exception subclasses of 
which satisfy some more-specific-than-Exception type*) who are still learning 
about classes and inheritance. That’s a doubly slim population, isn’t it? Maybe 
also those who kind of know, but aren’t so sure and could use some 
reinforcement from seeing in the tutorial something that they independently did 
on their own in their own code. I wouldn’t think that authors who already know 
with confidence and from experience about classes and inheritance would benefit 
from the example in the tutorial, so “In my experience as a teacher, the 
possibility doesn't usually occur to people without it having been suggested” 
comes as a surprise to me. But… okay, them too - but again, only when they 
happen to be authoring a module *all user-defined Exception subclasses of which 
satisfy some more-specific-than-Exception type*.

What is the cost? It is that when an author happens to be authoring a module 
that does *not* have the property that all user-defined Exception subclasses 
satisfy some more-specific-than-Exception type, the common intermediate class 
is just bloat. It’s noise disrupting the signal. It undermines the API design 
advice “when in doubt, leave it out”. It unnecessarily widens the module’s API. 
It undermines the API design advice “classes are the most complex kind of code 
element in common use so they have the highest value proposition to satisfy to 
justify their existence”. It violates the Liskov Substitution Principle. Maybe 
most importantly, it obscures other relationships among the user-defined 
Exception subclasses in the module such as a superclass shared by 
some-but-not-all of the module’s user-defined Exception subclasses, if such 
other relationships exist.

What readers of the tutorial pay this cost? Those who are still learning the 
language. And those who are following pattern and convention - note that the 
tutorial contains only one example of user-defined Exception subclasses, and… 
an unfortunate fact of life of tutorials is that readers are invited to 
generalize from single examples. And, as I think we’ve seen in this 
conversation, those who just picked up the practice at one point and have kept 
it going.

The Exception subclass hierarchy of sqlite3 that was mentioned earlier in this 
conversation demonstrates exactly this bloat and misapplication - there’s 
Warning, which is a direct subclass of Exception, and there’s Error, which is 
also a direct subclass of Exception and has the erroneous specification “The 
base class of the other exceptions in this module”, and there’s DatabaseError, 
which is a subclass of Error, and then there are IntegrityError, 
ProgrammingError, OperationalError, and NotSupportedError, which inherit from 
DatabaseError. What’s the use of Error? There are no code elements in the 
module specified as raising Error. There’s example code in the module showing 
“except sqlite3.Error”, but why shouldn’t that be “except 
sqlite3.DatabaseError”?

It’s a red herring is that the practice appears widely applied in existing 
Python code - well of course; it’s been exemplified in the tutorial for 
seventeen years! :-P

One last thing to consider: look at the example specifically - InputError and 
TransitionError. There’s no elsewhere-in-the-module example code showing a 
function that has “Error” in its “Raises:” specification and could raise either 
an InputError or a TransitionError, and there’s no outside-of-the-module 
example code showing a user of the module calling a module function and saving 
duplicated lines of code because they want to respond to InputErrors and 
TransitionErrors in exactly the same way.

We should remove the “Base class for exceptions in this module” Error class 
from the tutorial’s example because it just isn’t beneficial enough, in enough 
applicable modules, to enough authors, and it’s more than costly enough, in 
enough modules to which it doesn’t apply, and to enough authors, even just as 
noise and API bloat. I don’t know that this could have been calculated from 
first principles seventeen years ago; I think perhaps it took the experience of 
having the guidance out there, so rarely merited and so widely 

[issue34635] inspect: add tools for inspecting subclasses

2018-09-11 Thread Benjamin Mintz


Change by Benjamin Mintz :


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

___
Python tracker 

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



[issue34635] inspect: add tools for inspecting subclasses

2018-09-11 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +yselivanov

___
Python tracker 

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



[issue26979] The danger of PyType_FromSpec()

2018-09-11 Thread Petr Viktorin


Petr Viktorin  added the comment:

Christian, do you have a specific example of the default tp_dealloc doing the 
wrong thing?

--

___
Python tracker 

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



[issue34633] Simplify __reduce__ for ordered dict iterators

2018-09-11 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
title: Simplify __reduce__ for ordered dict. -> Simplify __reduce__ for ordered 
dict iterators

___
Python tracker 

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



[issue34595] PyUnicode_FromFormat(): add %T format for an object type name

2018-09-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8625

___
Python tracker 

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



<    1   2