[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +maxking

___
Python tracker 

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



[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters

2019-07-09 Thread Ryan McCampbell


Ryan McCampbell  added the comment:

Oops my bad, didn't realize this was already fixed

--

___
Python tracker 

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



[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters

2019-07-09 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> create_unicode_buffer() fails on non-BMP strings on Windows

___
Python tracker 

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



[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters

2019-07-09 Thread Ryan McCampbell


Change by Ryan McCampbell :


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



[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters

2019-07-09 Thread Ryan McCampbell


Change by Ryan McCampbell :


--
components: +ctypes
type:  -> behavior

___
Python tracker 

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



[issue37536] ctypes.create_string_buffer fails on windows with non-BMP characters

2019-07-09 Thread Ryan McCampbell


New submission from Ryan McCampbell :

The ctypes.create_string_buffer function uses the length of the string to 
create the buffer if no size is provided. Since windows wide chars are UTF-16 
the buffer may actually need to be larger to store surrogate pairs. This code 
crashes on windows:

>>> create_unicode_buffer('\U0001\U0001')
ValueError: string too long

--
messages: 347600
nosy: rmccampbell7
priority: normal
severity: normal
status: open
title: ctypes.create_string_buffer fails on windows with non-BMP characters

___
Python tracker 

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



[issue35545] asyncio.base_events.create_connection doesn't handle scoped IPv6 addresses

2019-07-09 Thread Zaar Hai


Zaar Hai  added the comment:

Good day guys,
Does anyone have an idea if it's going to be fixed for 3.8?

--
nosy: +Zaar Hai

___
Python tracker 

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



[issue34697] ctypes: Crash if manually-created CField instance is used

2019-07-09 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-09 Thread Aldwin Pollefeyt

Aldwin Pollefeyt  added the comment:

Maybe a solution, if no charset defined, then encode it as utf-8 in 
decode_header, because it's Python3's default encoding?


diff --git a/Lib/email/header.py b/Lib/email/header.py
index 4ab0032bc6..8dbfe58a57 100644
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -135,7 +135,10 @@ def decode_header(header):
 collapsed = []
 last_word = last_charset = None
 for word, charset in decoded_words:
-if isinstance(word, str):
+if not charset and isinstance(word, str):
+word = word.encode('utf-8')
+charset = 'utf-8'
+elif isinstance(word, str):
 word = bytes(word, 'raw-unicode-escape')
 if last_word is None:
 last_word = word



Python 3.9.0a0 (heads/master:110a47c4f4, Jul 10 2019, 11:32:53) 
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import email.header
>>> header = "Your booking at Voyager Int'l 
>>> Hostel,=?UTF-8?B?IFBhbmFtw6EgQ2l0eQ==?=,   Panamá- Casco Antiguo"
>>> print(email.header.make_header(email.header.decode_header(header)))
Your booking at Voyager Int'l Hostel, Panamá City,   Panamá- Casco Antiguo
>>>

--
nosy: +aldwinaldwin

___
Python tracker 

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



[issue37528] test_tarfile: test_extractall_symlinks() fails on Windows with: [WinError 206] The filename or extension is too long

2019-07-09 Thread Eryk Sun


Eryk Sun  added the comment:

If you want to harden the test for Windows, you could transform TEMPDIR
into an extended path. os.path._getfinalpathname always returns an extended 
path. For example:

>>> os.path._getfinalpathname('C:/Temp')
'?\\C:\\Temp'

>>> os.path._getfinalpathname('//localhost/C$/Temp')
'?\\UNC\\localhost\\C$\\Temp'

> windows.RtlAreLongPathsEnabled: 
> 
> RtlAreLongPathsEnabled() is not available on Windows 8.1. I don't 
> know if long paths support is enabled or not on this buildbot (I 
> guess that no, it isn't).

Normalized long paths are implemented in Windows 10 1607 and later. Previous 
versions do not have RtlAreLongPathsEnabled and cannot support normalized long 
paths. RtlAreLongPathsEnabled() will be true if, at process startup, the 
"LongPathsEnabled" policy is enabled in the registry and the application 
manifest claims to be "longPathAware". 

In all supported versions of Windows, long paths are supported by most 
filesystem functions if we use an extended path, i.e. a fully-qualified Unicode 
path that starts with the \\?\ prefix. This path type is not normalized in a 
create or open context, so it can only use backslash as the path separator, not 
forward slash. Also, the process working directory does not allow extended 
paths, so when using extended paths we have to manage our own working directory 
and manually resolve relative paths, including "." and ".." components (e.g. by 
calling GetFullPathNameW).

--
nosy: +eryksun

___
Python tracker 

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



[issue37527] Timestamp conversion on windows fails with timestamps close to EPOCH

2019-07-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue37527] Timestamp conversion on windows fails with timestamps close to EPOCH

2019-07-09 Thread Ma Lin


Ma Lin  added the comment:

Looks like a similar problem to issue29097.

>>> from datetime import datetime
>>> d = datetime.fromtimestamp(1)
>>> d.timestamp()
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 22] Invalid argument

Neijwiert tried to analyzed it in stackoverflow:
https://stackoverflow.com/questions/56931738/

--
nosy: +Ma Lin, ammar2, belopolsky, jleclanche
versions: +Python 3.8, Python 3.9

___
Python tracker 

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



[issue37535] Client SSLSocket with select.select() always returns readable with OpenSSL 1.1.1

2019-07-09 Thread Dean


New submission from Dean :

Hi, I've come across an issue with OpenSSL 1.1.1, when a client socket wrapped 
using ssl.wrap_socket() is used in select.select() its always returning ready 
for reading even though there appears to be nothing to read.

To reproduce:
0. Extract files from attached zip
1. Run server.py
2. Run client.py

I expect client.py to print "Nothing to read" and then b'\x00\x01\x02\x03', 
which it does with Python 2.7.14, 3.6.8 and 3.7.3 and OpenSSL 1.0.1f and 
1.1.0g. 

With OpenSSL 1.1.1 it prints 'Pending: 0' and blocks on the sock.recv(1) call.

Thanks!

--
assignee: christian.heimes
components: SSL
files: ssl_select.zip
messages: 347595
nosy: christian.heimes, 
priority: normal
severity: normal
status: open
title: Client SSLSocket with select.select() always returns readable with 
OpenSSL 1.1.1
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file48464/ssl_select.zip

___
Python tracker 

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



[issue30663] IDLE: Add lineno sidebar to editor window

2019-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Oakley's patch was intentionally very general, allowing line number heights to 
vary because of different fonts, font sizes, or widget inclusions.  This 
required positioning line numbers by pixel (hence canvas) and accommodating 
line size changes even in the absence of newline changes.  IDLE's need is 
simpler (fortunately)l.

--

___
Python tracker 

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



[issue37534] In minidom module ability to add Standalone Document Declaraion is missing while generating XML documents

2019-07-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +scoder, serhiy.storchaka

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-07-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks Jack for the report. I am reopening this issue. I will use your example 
as a unit test. I will try to look into it. If you have more cases or examples 
related to the issue feel free to add them.

--
resolution: fixed -> 
stage: resolved -> 
status: closed -> open
versions: +Python 3.9

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-07-09 Thread Jack Wong


Jack Wong  added the comment:

Can we reopen this bug? Karthikeyan's PR works for Dmitry's toy example, but it 
does not work in the usual case where patch() and attach_mock() are used. I 
encountered this bug on Python 3.7.3, which includes the PR.

Non-toy example:
import unittest.mock as mock

def foo():
pass

parent = mock.Mock()

with mock.patch('__main__.foo', autospec=True) as mock_foo:
parent.attach_mock(mock_foo, 'child')
parent.child()
print(parent.mock_calls)

Actual output:
[]

Expected output:
[call.child()]

The reason why Karthikeyan's PR works on the toy example is that that mock's 
name is not set. In the usual case, the function mock's name will be set so 
this "if" block in _check_and_set_parent will return immediately.
if ((value._mock_name or value._mock_new_name) or
(value._mock_parent is not None) or
(value._mock_new_parent is not None)):
return False

I think a possible fix is to move the inner mock extraction out to the 
attach_mock function as that function contains code to clear the mock's parent 
and name attributes. Downside is that that would make it fail on Dmitry's toy 
example.

--
nosy: +iforapsy

___
Python tracker 

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



[issue37357] mbox From line wrongly detected

2019-07-09 Thread R. David Murray


R. David Murray  added the comment:

This problem is the whole reason "mangle_from" exists in the email library...

--

___
Python tracker 

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



[issue37480] add ptpython to list of alternate interpreters

2019-07-09 Thread Zach Valenta


Zach Valenta  added the comment:

Terry, I agree w/ you that this info has a better home in the wiki. Just 
commented on the PR to say as much there. I'll update the PR per Kyle Stanley's 
suggestion and port the info into the wiki.

--

___
Python tracker 

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



[issue31445] Index out of range in get of message.EmailMessage.get()

2019-07-09 Thread R. David Murray


R. David Murray  added the comment:

Note that the reporter indicated that the message was an instance of 
EmailMessage (the new API).  You'd need to use policy-default to get that using 
message_from_string.  But yes, this was fixed in another issue.

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



[issue32179] Empty email address in headers triggers an IndexError

2019-07-09 Thread R. David Murray


R. David Murray  added the comment:

BareQuotedString implies the new API is being used, though that was not made 
clear in the report.  However, unlike the other recently closed issue, this one 
was in fact fixed (and I have a vague memory of reviewing the PR):

>>> m = message_from_string('ReplyTo: ""', policy=default)
>>> m['ReplyTo']
'""'

--

___
Python tracker 

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



[issue19645] decouple unittest assertions from the TestCase class

2019-07-09 Thread Robert Collins


Robert Collins  added the comment:

Oh, I didn't mean to imply that these are the only options I'd support - just 
that these are the things I've thought through and that I think will all work 
well... I'm sure there are more options available ;)

--

___
Python tracker 

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



[issue19645] decouple unittest assertions from the TestCase class

2019-07-09 Thread Robert Collins


Change by Robert Collins :


--
versions: +Python 3.9 -Python 3.5

___
Python tracker 

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



[issue19645] decouple unittest assertions from the TestCase class

2019-07-09 Thread Robert Collins


Robert Collins  added the comment:

Ok so design wise - there is state on the TestCase that influences assertions; 
in potentially two ways.

The first way is formatting - the amount of detail shown in long list 
comparisons etc.

The second way I don't think we have at the moment, but potentially it could 
influence the fidelity of comparisons for NearlyEquals and the like - generally 
though we tend to pass those in as parameters.

So just ripping everything off into standalone functions loses the home for 
that state. It either becomes global (ugh), or a new object that isn't a test 
case but is basically the same magic object that has to be known is carried 
around, or we find some other way of delegating the formatting choice and 
controls.

hamcrest has some prior art in this space, and testtools experimented with that 
too. wordpress has managed to naff up the formatting on my old blog post about 
this 
https://rbtcollins.wordpress.com/2010/05/10/maintainable-pyunit-test-suites/ 
and https://testtools.readthedocs.io/en/latest/for-test-authors.html#matchers

Its been on my TODO for a very long time to put together a PEP for adding 
matchers to the stdlib; I find the full system we did in testtools very useful 
because it can represent everything from a trivial in-memory string error 
through to a disk image for a broken postgresql database, without running out 
of memory or generating mojibake but if we wanted to do something smaller 
that didn't prejuidice extensions like testtools still doing more that would be 
fine too.

The core idea of matchers is that rather than a standalone function f() -> 
nil/raise, you build a callable object f() -> Option(Mismatch), and a Mismatch 
can be shown to users, combined with other mismatches to form composites or 
sequences and so forth. So this would give room for the state around object 
formatting and the like too.

--

___
Python tracker 

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



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-07-09 Thread R. David Murray


R. David Murray  added the comment:

The fact that the original report mentions HeaderParserError implies that the 
new API is being used, though the report didn't make that clear.  The problem 
still exists:

>>> m = message_from_string("To: :Foo  
>>> \n\n", policy=default)
>>> m['To']
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/rdmurray/python/p38/Lib/email/message.py", line 391, in 
__getitem__
return self.get(name)
  File "/home/rdmurray/python/p38/Lib/email/message.py", line 471, in get
return self.policy.header_fetch_parse(k, v)
  File "/home/rdmurray/python/p38/Lib/email/policy.py", line 163, in 
header_fetch_parse
return self.header_factory(name, value)
  File "/home/rdmurray/python/p38/Lib/email/headerregistry.py", line 602, in 
__call__
return self[name](name, value)
  File "/home/rdmurray/python/p38/Lib/email/headerregistry.py", line 197, in 
__new__
cls.parse(value, kwds)
  File "/home/rdmurray/python/p38/Lib/email/headerregistry.py", line 343, in 
parse
groups.append(Group(addr.display_name,
  File "/home/rdmurray/python/p38/Lib/email/_header_value_parser.py", line 315, 
in display_name
return self[0].display_name
  File "/home/rdmurray/python/p38/Lib/email/_header_value_parser.py", line 382, 
in display_name
return self[0].display_name
  File "/home/rdmurray/python/p38/Lib/email/_header_value_parser.py", line 564, 
in display_name
if res[0].token_type == 'cfws':
IndexError: list index out of range

--
resolution: out of date -> 
status: closed -> open

___
Python tracker 

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



[issue19645] decouple unittest assertions from the TestCase class

2019-07-09 Thread R. David Murray


R. David Murray  added the comment:

"But - what are we solving for here?"  I'll tell you what my fairly common use 
case is.  Suppose I have some test infrastructure code, and I want to make some 
assertions in it.  What I invariably end up doing is passing 'self' into the 
infrastructure method/class just so I can call the assert methods from it.  I'd 
much rather be just calling the assertions, without carrying the whole test 
object around.  It *works* to do that, but it bothers me every time I do it or 
read it in code, and it makes the infrastructure code needlessly more 
complicated and slightly harder to understand/read.

--

___
Python tracker 

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



[issue37534] In minidom module ability to add Standalone Document Declaraion is missing while generating XML documents

2019-07-09 Thread Henry Harutyunyan


New submission from Henry Harutyunyan :

Though the Standalone Document Declaration in XML Declaration is optional and 
the default value of "no" is assumed in case it's omitted, in certain cases it 
makes sense to change the value to indicate the absence of external markup 
declarations. It's a part of W3C recommendation on XML 
(https://www.w3.org/TR/xml/#sec-prolog-dtd).
Though minidom module allows to modify the encoding declaration if needed, the 
same is not true for standalone declaration.
As I've recently came up with an issue while generating XML documents with the 
module I suggest adding the ability to add and modify the declaration.

--
components: XML
messages: 347583
nosy: hharutyunyan
priority: normal
severity: normal
status: open
title: In minidom module ability to add Standalone Document Declaraion is 
missing while generating XML documents
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-09 Thread Tianon


Change by Tianon :


--
nosy: +tianon

___
Python tracker 

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



[issue37521] importlib.util.module_from_spec return value is not the same as in sys.modules

2019-07-09 Thread Benjamin Mintz


Benjamin Mintz  added the comment:

Updated. Also removed some old code which had irrelevant imports that I thought 
I removed already. The expected and actual output remain the same.

--
Added file: 
https://bugs.python.org/file48463/importlib-util-module-from-spec-stale-reference.zip

___
Python tracker 

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



[issue37533] Possible Unicode handling issue in python.

2019-07-09 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue37533] Possible Unicode handling issue in python.

2019-07-09 Thread Zachary Ware


Zachary Ware  added the comment:

That issue shows a traceback from Python 2.7, which handles Unicode 
significantly differently than (read "not as well as") Python 3.  If the issue 
can be boiled down to a few lines of Python code that show a real problem in 
Python 3's Unicode handling (rather than in Tribler or PyQT) please reopen, but 
for now I see no indication that this is a problem in Python 3.  The chances of 
changing Python 2's Unicode handling in any meaningful way at this point in its 
lifecycle are nearly nil.

--
components: +Unicode
nosy: +zach.ware -brett.cannon
resolution:  -> third party
stage:  -> resolved
status:  -> closed
type: compile error -> behavior
versions: +Python 2.7 -Python 3.7

___
Python tracker 

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



[issue26131] Raise ImportWarning when loader.load_module() is used

2019-07-09 Thread Brett Cannon


Brett Cannon  added the comment:

@joannah no clue if this ever happened. Could you check the code if 
DeprecationWarning is being raised yet?

--

___
Python tracker 

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



[issue37533] Possible Unicode handling issue in python.

2019-07-09 Thread mike lojkovic


New submission from mike lojkovic :

Encode error on character '\u2193' was suggested by a tribler developer might 
indicate a problem with python's handling of unicdoe in specific cases.

https://github.com/Tribler/tribler/issues/4666

--
components: Unicode
messages: 347578
nosy: ezio.melotti, mike lojkovic, vstinner
priority: normal
severity: normal
status: open
title: Possible Unicode  handling issue in python.
type: compile error
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



[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-09 Thread Yun Li

New submission from Yun Li :

email.header.make_header() doesn't work if any `ascii` code is out of range(128)

For example 

>>> header = "Your booking at Voyager Int'l 
>>> Hostel,=?UTF-8?B?IFBhbmFtw6EgQ2l0eQ==?=,   Panamá- Casco Antiguo"

>>> decode_header(header)
[(b"Your booking at Voyager Int'l Hostel,", None), (b' Panam\xc3\xa1 City', 
'utf-8'), (b',   Panam\xe1- Casco Antiguo', None)]

>>> make_header(decode_header(header))
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/email/header.py",
 line 174, in make_header
h.append(s, charset)
  File 
"/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/email/header.py",
 line 295, in append
s = s.decode(input_charset, errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 9: ordinal 
not in range(128)

--
components: email
messages: 347577
nosy: barry, r.david.murray, yunlee
priority: normal
severity: normal
status: open
title: email.header.make_header() doesn't work if any `ascii` code is out of 
range(128)
type: behavior
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



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8, Python 3.9 -Python 3.5

___
Python tracker 

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



[issue3753] bytearray incompatible with y#

2019-07-09 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
pull_requests: +14485
pull_request: https://github.com/python/cpython/pull/14679

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-07-09 Thread Joannah Nanjekye


New submission from Joannah Nanjekye :

Reported by Victor Stinner.

regrtest has a --timeout parameter which calls
faulthandler.dump_traceback_later(timeout), but sometimes it's not
enough to kill a test. regrtest should kill a worker process if it
runs longer than --timeout seconds.

* https://bugs.python.org/issue37313 : test_concurrent_futures ran for
25 hours whereas regrtest was run using --timeout 900
* regrtest ran for 4 days whereas it was run with --timeout=900:
https://mail.python.org/pipermail/python-buildbots/2019-June/000285.html

--
messages: 347576
nosy: nanjekyejoannah, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS
type: crash
versions: Python 3.9

___
Python tracker 

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



[issue26806] IDLE not displaying RecursionError tracebacks and hangs

2019-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset f54f062f68ac82fc3e7c92345b4d5fbe2534dc84 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.7':
bpo-26806: IDLE should run without docstrings (GH-14657) (GH-14678)
https://github.com/python/cpython/commit/f54f062f68ac82fc3e7c92345b4d5fbe2534dc84


--

___
Python tracker 

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



[issue26806] IDLE not displaying RecursionError tracebacks and hangs

2019-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset b82188d9bad1774624cb1788dbdec2f0d7d65688 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.8':
bpo-26806: IDLE should run without docstrings (GH-14657) (GH-14677)
https://github.com/python/cpython/commit/b82188d9bad1774624cb1788dbdec2f0d7d65688


--

___
Python tracker 

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



[issue26806] IDLE not displaying RecursionError tracebacks and hangs

2019-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14483
pull_request: https://github.com/python/cpython/pull/14677

___
Python tracker 

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



[issue26806] IDLE not displaying RecursionError tracebacks and hangs

2019-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 6aeb2fe606408aae14c246470794f1303b3be812 by Terry Jan Reedy in 
branch 'master':
bpo-26806: IDLE should run without docstrings (#14657)
https://github.com/python/cpython/commit/6aeb2fe606408aae14c246470794f1303b3be812


--

___
Python tracker 

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



[issue26806] IDLE not displaying RecursionError tracebacks and hangs

2019-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14484
pull_request: https://github.com/python/cpython/pull/14678

___
Python tracker 

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



[issue37491] IndexError in get_bare_quoted_string

2019-07-09 Thread Abhilash Raj


Abhilash Raj  added the comment:

I just wanted to report before I forgot and hence missed some details, turns 
out the bug report was slightly wrong too. The testcase I provided wasn't right.

Here is the right test case to reproduce the exception with master:

# bpo_37491.py
from email.parser import BytesParser, Parser
from email.policy import default

payload = 'Content-Type:"'
msg = Parser(policy=default).parsestr(payload)
print(msg.get('content-type'))


$ ./python bpo_37491.py 

 
Traceback (most recent call last):
  File "bpo_37491.py", line 5, in 
msg = Parser(policy=default).parsestr(payload)
  File "/home/maxking/Documents/cpython/Lib/email/parser.py", line 68, in 
parsestr
return self.parse(StringIO(text), headersonly=headersonly)
  File "/home/maxking/Documents/cpython/Lib/email/parser.py", line 58, in parse
return feedparser.close()
  File "/home/maxking/Documents/cpython/Lib/email/feedparser.py", line 187, in 
close
self._call_parse()
  File "/home/maxking/Documents/cpython/Lib/email/feedparser.py", line 180, in 
_call_parse
self._parse()
  File "/home/maxking/Documents/cpython/Lib/email/feedparser.py", line 256, in 
_parsegen
if self._cur.get_content_type() == 'message/delivery-status':
  File "/home/maxking/Documents/cpython/Lib/email/message.py", line 578, in 
get_content_type
value = self.get('content-type', missing)
  File "/home/maxking/Documents/cpython/Lib/email/message.py", line 471, in get
return self.policy.header_fetch_parse(k, v)
  File "/home/maxking/Documents/cpython/Lib/email/policy.py", line 163, in 
header_fetch_parse
return self.header_factory(name, value)
  File "/home/maxking/Documents/cpython/Lib/email/headerregistry.py", line 602, 
in __call__
return self[name](name, value)
  File "/home/maxking/Documents/cpython/Lib/email/headerregistry.py", line 197, 
in __new__
cls.parse(value, kwds)
  File "/home/maxking/Documents/cpython/Lib/email/headerregistry.py", line 447, 
in parse
kwds['decoded'] = str(parse_tree)
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 126, in __str__
return ''.join(str(x) for x in self)
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 126, in 
return ''.join(str(x) for x in self)
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 796, in __str__
for name, value in self.params:
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 770, in params
value = param.param_value
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 679, in param_value
return token.stripped_value
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 710, in stripped_value
token = self[0]
IndexError: list index out of range


This time I attached a correct patch instead of copy-pasting only the diff :)

About IndexError, I agree, it must be an empty string value and not a None 
value.

--
keywords: +patch
Added file: https://bugs.python.org/file48462/fix-indexerror.patch

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#37530 addresses I2, events (Tal, see msg319241 above).  I considered this to 
be about next in priority.  It also does some I1 cleanup.

In that list, the 2nd M3 should be M4.  The comment "D1 is PR 7579" should have 
referred to PR 7597, merged thereafter.

--
dependencies: +IDLE: simplify, optimize, and clean up code context
nosy: +taleinat

___
Python tracker 

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



[issue27679] set_bitfields() unused in _ctypes_test

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:

I don't feel the need to backport the change to Python 3.8 and older. Having an 
unused in a test module (_ctypes_test) doesn't hurt. I close the issue.

Thanks Martin Panter for the report, thanks Hai Shi for the fix ;-)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9

___
Python tracker 

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



[issue27679] set_bitfields() unused in _ctypes_test

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3a3db970de344efbb4017fb9dde9204f0fd4bbdc by Victor Stinner (Hai 
Shi) in branch 'master':
bpo-27679: Remove set_bitfields() from _ctypes_test (GH-14648)
https://github.com/python/cpython/commit/3a3db970de344efbb4017fb9dde9204f0fd4bbdc


--
nosy: +vstinner

___
Python tracker 

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



[issue34722] Non-deterministic bytecode generation

2019-07-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pablogsal

___
Python tracker 

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



[issue37530] IDLE: simplify, optimize, and clean up code context

2019-07-09 Thread Tal Einat


Change by Tal Einat :


--
keywords: +patch
pull_requests: +14482
pull_request: https://github.com/python/cpython/pull/14675

___
Python tracker 

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



[issue37530] IDLE: simplify, optimize, and clean up code context

2019-07-09 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Issue for Tal's PR 14675, dependency of #33610.

1. Only create CodeContext instances for "real" editors windows, but not e.g. 
shell or output windows.

- Previously, were created but never activated because menu item deactivated.  
This is even better.

2. Remove configuration update Tk event fired every second, by having the 
editor window ask its code context widget to update when necessary, i.e. upon 
font or highlighting updates.

3. When code context isn't being shown, avoid having a Tk event fired every 
100ms to check whether the code context needs to be updated.

4. Use the editor window's getlineno() method where applicable.

5. Fix a bare except:.

--
assignee: terry.reedy
components: IDLE
messages: 347568
nosy: cheryl.sabella, taleinat, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: IDLE: simplify, optimize, and clean up code context
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37168] Decimal divisions sometimes 10x or 100x too large

2019-07-09 Thread Mark Dickinson


Mark Dickinson  added the comment:

@Phil: Did you ever get to the bottom of this?

--

___
Python tracker 

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



[issue37491] IndexError in get_bare_quoted_string

2019-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Also, quotes should be attributed to a file and patch snipped should indicate 
the target.  

As for the bug, the author(s) of the expressions "value[1:]" and "value[0]" 
presumably *expected* value to initially have length 2 so that it would be be 
non-empty after clipping.  In the absence of additional information, it is 
possible that the bug is in the unquoted code that produced value.  This is 
potentially true whenever a function or expession raises.

--

___
Python tracker 

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



[issue37491] IndexError in get_bare_quoted_string

2019-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

To avoid such questions, bug reports should contain exception messages and 
usually at least some of the tracebacks.

>>> ''[0]
Traceback (most recent call last):
  File "", line 1, in 
''[0]
IndexError: string index out of range
>>> x=None
>>> x[0]
Traceback (most recent call last):
  File "", line 1, in 
x[0]
TypeError: 'NoneType' object is not subscriptable

IndexError should mean object was indexable.
Operations on None should give TypeError.

--

___
Python tracker 

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



[issue37226] Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range

2019-07-09 Thread Ben Brown


Ben Brown  added the comment:

Maayan Keshet do you have a minimal example it would be interesting to compare 
against our code and see if there is something we are both doing that could 
help narrow down the issue.

--

___
Python tracker 

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



[issue34722] Non-deterministic bytecode generation

2019-07-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue37529] Mimetype module duplicates

2019-07-09 Thread disconnect3d


disconnect3d  added the comment:

To be more specific and to keep this information historically, the .bmp 
registers two mimetypes - 'image/bmp' and 'image/x-ms-bmp'.

Below a part of the relevant code.
```
types_map = _types_map_default = {
# (...)
'.bmp': 'image/bmp',
'.gif': 'image/gif',
'.ief': 'image/ief',
'.jpg': 'image/jpeg',
'.jpe': 'image/jpeg',
'.jpeg'   : 'image/jpeg',
'.png': 'image/png',
'.svg': 'image/svg+xml',
'.tiff'   : 'image/tiff',
'.tif': 'image/tiff',
'.ico': 'image/vnd.microsoft.icon',
'.ras': 'image/x-cmu-raster',
'.bmp': 'image/x-ms-bmp',
```

--

___
Python tracker 

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



[issue37529] Mimetype module duplicates

2019-07-09 Thread disconnect3d


New submission from disconnect3d :

The mimetype builtin module allows users to guess extension for a given 
mimetype through the `mimetypes.guess_extension` function.

Default mimetypes are stored in `types_map` and `_types_map_default` 
dictionaries that maps extensions to mimetypes. Those dictionaries are created 
by `_default_mime_types` function in `cpython/Lib/mimetypes.py`.

If a given extension have more than one mimetype, this information is lost.
This happens currently for ".bmp" extension in CPython's codebase.

This can be seen in the linked code below:
https://github.com/python/cpython/blob/110a47c4f42cf4db88edc1876899fff8f05190fb/Lib/mimetypes.py#L490-L502

Here is an example in an interactive IPython session:
```
In [1]: import mimetypes

In [2]: mimetypes.guess_extension('image/bmp')
Out[2]: '.bmp'

In [3]: mimetypes.guess_extension('image/x-ms-bmp')

In [4]:
```

The issue has been found by using Semmle's LGTM: 
https://lgtm.com/projects/g/python/cpython/snapshot/d099f261c762ac81042e47b530d279f932d89e09/files/Lib/mimetypes.py?sort=name=ASC=heatmap


PS / offtopic / loud thinking: Maybe there should be a debug build of CPython 
that would detect such key overwrites during dicts initialisation and warn 
about them?

--
components: Library (Lib)
messages: 347562
nosy: Dominik Czarnota
priority: normal
severity: normal
status: open
title: Mimetype module duplicates
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue26131] Raise ImportWarning when loader.load_module() is used

2019-07-09 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

@brett Since this was opened like years ago. Before I work on it, I was 
wondering If it is still relevant.

--

___
Python tracker 

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



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset 68bd9c5691c4899d21cc7fe6cce7cd22b2f5ccb0 by Ivan Levkivskyi (Miss 
Islington (bot)) in branch '3.8':
bpo-18374: fix tests to check the correct thing about line numbers (GH-14659) 
(GH-14672)
https://github.com/python/cpython/commit/68bd9c5691c4899d21cc7fe6cce7cd22b2f5ccb0


--

___
Python tracker 

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



[issue37452] Microsoft store package has an invalid ExecutablePath registry entry

2019-07-09 Thread Fredrik Mellbin


Fredrik Mellbin  added the comment:

This is fixed and works as expected in 3.7.4 from the MS Store.

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset 4c403b8ca2d0ef44b691cceaeeac9e110fd3f05a by Miss Islington (bot) 
in branch '3.8':
bpo-37322: ssl test_pha_required_nocert() ignores expected SSLError (GH-14670)
https://github.com/python/cpython/commit/4c403b8ca2d0ef44b691cceaeeac9e110fd3f05a


--
nosy: +miss-islington

___
Python tracker 

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



[issue37120] Provide knobs to disable session ticket generation on TLS 1.3

2019-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset bbad695e7890513be7a9bc662e2d8ae13bfcd313 by Miss Islington (bot) 
in branch '3.8':
bpo-37120: Fix _ssl get_num_tickets() (GH-14668)
https://github.com/python/cpython/commit/bbad695e7890513be7a9bc662e2d8ae13bfcd313


--

___
Python tracker 

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



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue37526] Add support.catch_threading_exception()

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:

Maybe the context manager could recreate attributes (set them to None) if the 
context manager is used wice, but I'm not sure that I don't want to promote to 
reuse catch_threading_exception().

I didn't check if catch_threading_exception() creates a ref cycle. I guess so. 
It's likely than storing an exception creates a ref cycle. Anyway, __exit__() 
removes attributes.

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



[issue34722] Non-deterministic bytecode generation

2019-07-09 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 73ea54620a6f91c3f2e53880373dd47813691a21 by Victor Stinner in 
branch 'master':
bpo-37322: ssl test_pha_required_nocert() ignores expected SSLError (GH-14670)
https://github.com/python/cpython/commit/73ea54620a6f91c3f2e53880373dd47813691a21


--

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14481
pull_request: https://github.com/python/cpython/pull/14673

___
Python tracker 

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



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14480
pull_request: https://github.com/python/cpython/pull/14672

___
Python tracker 

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



[issue18374] ast.parse gives wrong position (col_offset) for some BinOp-s

2019-07-09 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset 430a9f44fe22f029ae8cfeecb46621d7e199414b by Ivan Levkivskyi (Carl 
Friedrich Bolz-Tereick) in branch 'master':
bpo-18374: fix tests to check the correct thing about line numbers (GH-14659)
https://github.com/python/cpython/commit/430a9f44fe22f029ae8cfeecb46621d7e199414b


--

___
Python tracker 

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



[issue37120] Provide knobs to disable session ticket generation on TLS 1.3

2019-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14479
pull_request: https://github.com/python/cpython/pull/14671

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:

The test also logs an "Exception in thread Thread-2:" error:
---
vstinner@apu$ ./python -m test test_ssl -m test_pha_required_nocert -v
== CPython 3.9.0a0 (heads/master:110a47c4f4, Jul 8 2019, 23:52:00) [GCC 9.1.1 
20190503 (Red Hat 9.1.1-1)]
== Linux-5.1.15-300.fc30.x86_64-x86_64-with-glibc2.29 little-endian
== cwd: /home/vstinner/python/master/build/test_python_21491
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 1.77 [1/1] test_ssl
test_ssl: testing with 'OpenSSL 1.1.1c FIPS  28 May 2019' (1, 1, 1, 3, 15)
  under 'Linux-5.1.15-300.fc30.x86_64-x86_64-with-glibc2.29'
  HAS_SNI = True
  OP_ALL = 0x8054
  OP_NO_TLSv1_1 = 0x1000
test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ... Exception in 
thread Thread-2:
Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/test/test_ssl.py", line 2299, in run
msg = self.read()
  File "/home/vstinner/python/master/Lib/test/test_ssl.py", line 2276, in read
return self.sslconn.read()
  File "/home/vstinner/python/master/Lib/ssl.py", line 1101, in read
return self._sslobj.read(len)
ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a 
certificate (_ssl.c:2560)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/threading.py", line 938, in 
_bootstrap_inner
self.run()
  File "/home/vstinner/python/master/Lib/test/test_ssl.py", line 2385, in run
raise ssl.SSLError('tlsv13 alert certificate required')
ssl.SSLError: ('tlsv13 alert certificate required',)
/home/vstinner/python/master/Lib/threading.py:938: ResourceWarning: unclosed 

  self.run()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
ok

--

Ran 1 test in 0.028s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 179 ms
Tests result: SUCCESS
---

Attached PR 14670 makes this log quiet.

--

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +14478
pull_request: https://github.com/python/cpython/pull/14670

___
Python tracker 

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



[issue37526] Add support.catch_threading_exception()

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 58f2c7f424fe91ba035918f0f66306af73a37543 by Victor Stinner (Miss 
Islington (bot)) in branch '3.8':
bpo-37526: Add support.catch_threading_exception() (GH-14664) (GH-14666)
https://github.com/python/cpython/commit/58f2c7f424fe91ba035918f0f66306af73a37543


--

___
Python tracker 

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



[issue37528] test_tarfile: test_extractall_symlinks() fails on Windows with: [WinError 206] The filename or extension is too long

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:

On this buildbot build, test_tarfile succeeded when run again. Likely because 
the test is run in the main regrtest process which doesn't have 
"test_python_worker_xxx" in its current working directory.

--

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 61b1bc56069719fc6f17c73fdf2193636dbf6cc2 by Victor Stinner in 
branch 'master':
Revert "bpo-37322: Fix test_ssl.test_pha_required_nocert() ResourceWarning 
(GH-14662)" (GH-14669)
https://github.com/python/cpython/commit/61b1bc56069719fc6f17c73fdf2193636dbf6cc2


--

___
Python tracker 

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



[issue37528] test_tarfile: test_extractall_symlinks() fails on Windows with: [WinError 206] The filename or extension is too long

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +pablogsal

___
Python tracker 

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



[issue37528] test_tarfile: test_extractall_symlinks() fails on Windows with: [WinError 206] The filename or extension is too long

2019-07-09 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 Windows8.1 Non-Debug 3.x:
https://buildbot.python.org/all/#/builders/12/builds/2862

FAIL: test_extractall_symlinks (test.test_tarfile.Bz2WriteTest)
--
Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\test\test_tarfile.py", 
line 1312, in test_extractall_symlinks
tar.extractall(path=tempdir)
FileNotFoundError: [WinError 206] The filename or extension is too long: 
'D:\\buildarea\\3.x.ware-win81-release.nondebug\\build\\build\\test_python_3164\\test_python_worker_5512\\@test_5512_tmp-tardir\\testsymlinks\\buildarea\\3.x.ware-win81-release.nondebug\\build\\build\\test_python_3164\\test_python_worker_5512\\@test_5512_tmp-tardir'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\test\test_tarfile.py", 
line 1314, in test_extractall_symlinks
self.fail("extractall failed with symlinked files")
AssertionError: extractall failed with symlinked files


Extract of pythoninfo:

windows.RtlAreLongPathsEnabled: 

RtlAreLongPathsEnabled() is not available on Windows 8.1. I don't know if long 
paths support is enabled or not on this buildbot (I guess that no, it isn't).

I'm not sure why the test started to fail.

--
components: Tests
messages: 347549
nosy: vstinner, zach.ware
priority: normal
severity: normal
status: open
title: test_tarfile: test_extractall_symlinks() fails on Windows with: 
[WinError 206] The filename or extension is too long
versions: Python 3.9

___
Python tracker 

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



[issue37120] Provide knobs to disable session ticket generation on TLS 1.3

2019-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset 76611c7c0af6b2f4d0d98a5db827d34cff54ce25 by Miss Islington (bot) 
(Victor Stinner) in branch 'master':
bpo-37120: Fix _ssl get_num_tickets() (GH-14668)
https://github.com/python/cpython/commit/76611c7c0af6b2f4d0d98a5db827d34cff54ce25


--
nosy: +miss-islington

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset cf9c41c422de3774862db964fe3153086bad3f61 by Victor Stinner in 
> branch 'master':
> bpo-37322: Fix test_ssl.test_pha_required_nocert() ResourceWarning (GH-14662)

Oh. This test started to fail on Windows with this change. Example:

https://buildbot.python.org/all/#/builders/3/builds/3121

ERROR: test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth)
--
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test_ssl.py", line 
4344, in test_pha_required_nocert
s.recv(1024)
  File "D:\buildarea\3.x.bolen-windows10\build\lib\ssl.py", line 1226, in recv
return self.read(buflen)
  File "D:\buildarea\3.x.bolen-windows10\build\lib\ssl.py", line 1101, in read
return self._sslobj.read(len)
ConnectionResetError: [WinError 10054] An existing connection was forcibly 
closed by the remote host

I proposed PR 14669 to revert it.

--

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +14477
pull_request: https://github.com/python/cpython/pull/14669

___
Python tracker 

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



[issue37120] Provide knobs to disable session ticket generation on TLS 1.3

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +14476
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/14668

___
Python tracker 

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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2019-07-09 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Good point.
For proactor event loop set_wakeup_fd() is used for Ctrl+C handling.
Skipping this call for non-main thread in proactor implementation makes sense.

--
assignee:  -> asvetlov

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +14475
pull_request: https://github.com/python/cpython/pull/14667

___
Python tracker 

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



[issue37526] Add support.catch_threading_exception()

2019-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14474
pull_request: https://github.com/python/cpython/pull/14666

___
Python tracker 

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



[issue37526] Add support.catch_threading_exception()

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 91b4f7ab7f9a5e0908b91379ee085ae087a76483 by Victor Stinner in 
branch 'master':
bpo-37526: Add support.catch_threading_exception() (GH-14664)
https://github.com/python/cpython/commit/91b4f7ab7f9a5e0908b91379ee085ae087a76483


--

___
Python tracker 

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



[issue36829] Add sys.unraisablehook() to customize how "unraisable exceptions" are logged

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-37526: Add support.catch_threading_exception().

--

___
Python tracker 

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



[issue37526] Add support.catch_threading_exception()

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-36829: Add test.support.catch_unraisable_exception().

catch_threading_exception() is very close to catch_unraisable_exception().

--

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14473
pull_request: https://github.com/python/cpython/pull/14665

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset cf9c41c422de3774862db964fe3153086bad3f61 by Victor Stinner in 
branch 'master':
bpo-37322: Fix test_ssl.test_pha_required_nocert() ResourceWarning (GH-14662)
https://github.com/python/cpython/commit/cf9c41c422de3774862db964fe3153086bad3f61


--

___
Python tracker 

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



[issue37526] Add support.catch_threading_exception()

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


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



[issue37526] Add support.catch_threading_exception()

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +14472
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14664

___
Python tracker 

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



[issue37363] Additional PEP578 hooks

2019-07-09 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +14471
pull_request: https://github.com/python/cpython/pull/14663

___
Python tracker 

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



[issue37527] Timestamp conversion on windows fails with timestamps close to EPOCH

2019-07-09 Thread Dschoni


New submission from Dschoni :

A long description of the issue can be found on SO here: 
https://stackoverflow.com/questions/56931738/python-crash-on-windows-with-a-datetime-close-to-the-epoch?noredirect=1#comment100413591_56931738

TL;DR:

This fails on windows:

from datetime import datetime
datetime.fromtimestamp(1).timestamp()

--
components: Windows
messages: 347541
nosy: Dschoni, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Timestamp conversion on windows fails with timestamps close to EPOCH
type: behavior
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



[issue37526] Add support.catch_threading_exception()

2019-07-09 Thread STINNER Victor


New submission from STINNER Victor :

bpo-1230540 added threading.excepthook() to handle "uncaught exceptions raised 
by Thread.run()".

I propose to add support.catch_threading_exception(): context manager to ease 
catching these exceptions.

Attached PR implements it.

--
components: Tests
messages: 347540
nosy: vstinner
priority: normal
severity: normal
status: open
title: Add support.catch_threading_exception()
versions: Python 3.9

___
Python tracker 

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



[issue29312] Use FASTCALL in dict.update()

2019-07-09 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> but it will make d1.update(**d2) slower with a complexity of O(n): d2 must be 
> converted to 2 lists

This part is still true and it causes a slow-down of about 23% for 
dict.update(**d), see benchmarks at 
https://github.com/python/cpython/pull/14589#issuecomment-509356084

--

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +14470
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14662

___
Python tracker 

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



[issue37505] Early auditing broken

2019-07-09 Thread Steve Dower


Steve Dower  added the comment:

Passing a NULL format string there means the same as passing NULL to 
PyObject_CallFunction(func, NULL) - no arguments, which results in an empty 
tuple being passed to the hooks.

Perhaps in the early cases we can pass NULL instead of a tuple? Maybe even 
assert when that case occurs and the event has parameters?

--

___
Python tracker 

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



[issue37517] Improve error messages for Windows reserved file names

2019-07-09 Thread Steve Dower


Steve Dower  added the comment:

Presumably this is linked to issue37515 (why not just repurpose that one?), but 
I'm inclined to think this is okay provided:

* if the operation succeeds, no error/message is displayed
* if the operation fails, we only update the error message if one of the 
special filenames is the target

So probably this ought to be a special case in 
PyErr_SetFromWindowsErrWithFilename(). And either we need to search the string 
for the special names or find an API that will clarify it (GetFileAttributes?).

I definitely do not want every error message suggesting that this edge case may 
be the cause, and I don't want to prevent people using these names or purpose 
for their actual uses.

--

___
Python tracker 

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



[issue37505] Early auditing broken

2019-07-09 Thread Christian Heimes


Christian Heimes  added the comment:

Some audit events are designed to work before the interpreter is fully 
initialized or already shut down. These events pass in NULL instead of a 
PyObject*.

Python/pystate.c:if (PySys_Audit("cpython.PyInterpreterState_New", NULL) < 
0) {
Python/pystate.c:if (PySys_Audit("cpython.PyInterpreterState_Clear", NULL) 
< 0) {
Python/sysmodule.c:PySys_Audit("cpython._PySys_ClearAuditHooks", NULL);

(They are also currently not documented)

--

___
Python tracker 

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



[issue37473] importlib: Remove libregrtest hack: "We import importlib *ASAP* in order to test #15386"

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +14468
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14661

___
Python tracker 

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



[issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning

2019-07-09 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-37525 as duplicate of this issue.

--

___
Python tracker 

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



  1   2   >