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

2019-05-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13290

___
Python tracker 

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



[issue36946] Possible signed integer overflow in slice handling

2019-05-17 Thread miss-islington


miss-islington  added the comment:


New changeset f02d1a43c6be658cd279edb90e8e96c99e1127e7 by Miss Islington (bot) 
in branch '3.7':
bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)
https://github.com/python/cpython/commit/f02d1a43c6be658cd279edb90e8e96c99e1127e7


--
nosy: +miss-islington

___
Python tracker 

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



[issue36928] linkt threading.settrace to sys.settrace

2019-05-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13291

___
Python tracker 

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



[issue36260] [security] CVE-2019-9674: Zip Bomb vulnerability

2019-05-17 Thread STINNER Victor


Change by STINNER Victor :


--
title: Zip Bomb vulnerability -> [security] CVE-2019-9674: Zip Bomb 
vulnerability

___
Python tracker 

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



[issue36799] Typo in ctypes documentation

2019-05-17 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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



[issue36260] Zip Bomb vulnerability

2019-05-17 Thread JUN-WEI SONG


Change by JUN-WEI SONG :


--
keywords: +patch
pull_requests: +13288
stage: resolved -> patch review

___
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-05-17 Thread miss-islington


miss-islington  added the comment:


New changeset ac8eb8f36bf7ca636f8d886eb65a3b532f4725d5 by Miss Islington (bot) 
(Erwan Le Pape) in branch 'master':
bpo-35545: Fix asyncio discarding IPv6 scopes  (GH-11271)
https://github.com/python/cpython/commit/ac8eb8f36bf7ca636f8d886eb65a3b532f4725d5


--
nosy: +miss-islington

___
Python tracker 

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



[issue36751] Changes in the inspect module for PEP 570

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:

Can this issue be closed now? This issue was specific to the impact of the PEP 
570 on the inspect module. It's now fixed, right?

If someone wants to continue the discussion about a specific aspect of the 
inspect module, I suggest to start a thread on python-dev, or open a more 
specific issue, for example to discuss inspect performance.

--

___
Python tracker 

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



[issue36928] linkt threading.settrace to sys.settrace

2019-05-17 Thread SilentGhost


Change by SilentGhost :


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



[issue36928] linkt threading.settrace to sys.settrace

2019-05-17 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Thank you for your contribution

--
nosy: +matrixise

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fed02e15b39b6f1521ea21654be5fc0757a8720a by Victor Stinner in 
branch 'master':
bpo-36763: Remove _PyCoreConfig.program (GH-13373)
https://github.com/python/cpython/commit/fed02e15b39b6f1521ea21654be5fc0757a8720a


--

___
Python tracker 

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



[issue36946] Possible signed integer overflow in slice handling

2019-05-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13287

___
Python tracker 

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



[issue36946] Possible signed integer overflow in slice handling

2019-05-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 14514d9084a40f599c57da853a305aa264562a43 by Serhiy Storchaka 
(Zackery Spytz) in branch 'master':
bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)
https://github.com/python/cpython/commit/14514d9084a40f599c57da853a305aa264562a43


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36260] Zip Bomb vulnerability

2019-05-17 Thread JUN-WEI SONG


JUN-WEI SONG  added the comment:

Dear friends,

We moved a little bit forward to improve the writing. :)

--

___
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-05-17 Thread miss-islington


miss-islington  added the comment:


New changeset 94704048e2467dbb4c53ca02d103eab5671e84b3 by Miss Islington (bot) 
in branch '3.7':
bpo-35545: Fix asyncio discarding IPv6 scopes  (GH-11271)
https://github.com/python/cpython/commit/94704048e2467dbb4c53ca02d103eab5671e84b3


--

___
Python tracker 

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



[issue36564] Infinite loop with short maximum line lengths in EmailPolicy

2019-05-17 Thread R. David Murray


R. David Murray  added the comment:

As for the other, I don't see the need for a custom error.  It's a ValueError 
in my view.  I wouldn't object to it strongly, but note that this error is 
content dependent.  If there's nothing to encode, you can "get away with" a 
shorter maxlen.  Though why you would want to is beyond me, and that's another 
reason I don't think this warrants a custom error class.

--

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b16b4e45923f4e4dfd8e970ae4e6a934faf73b79 by Victor Stinner in 
branch 'master':
bpo-36763: Add PyMemAllocatorName (GH-13387)
https://github.com/python/cpython/commit/b16b4e45923f4e4dfd8e970ae4e6a934faf73b79


--

___
Python tracker 

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



[issue36564] Infinite loop with short maximum line lengths in EmailPolicy

2019-05-17 Thread R. David Murray


R. David Murray  added the comment:

Good point about the backward compatibility.  Yes I agree, I think raising the 
error is probably better.  A deprecation warning seems like a good path 
forward...I will be very surprised if anyone encounters it, though :)

--

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13296

___
Python tracker 

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



[issue36947] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Thank you for your report

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, matrixise

___
Python tracker 

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



[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

just one question, I don't find the paragraph with this text in the code. Could 
you share the link of this paragraph? Thank you

--
status: open -> pending

___
Python tracker 

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



[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Nicholas Matthews


Nicholas Matthews  added the comment:

Ok, I will create a PR soon and update the issue.

--

___
Python tracker 

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



[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Nicholas Matthews


Nicholas Matthews  added the comment:

Thanks for the clarification. For the first point on the correctness of the 
original text, that makes sense, could you link me to any relevant 
documentation for further reading?

On the second point "Meta modifies the creation of the classes themselves, not 
instances of the classes." I think this is not 100% correct. When you create an 
instance of a class via "instance = MyClass()", the `__call__` method of the 
metaclass is invoked, so metaclasses can control both class definition and 
instance creation.

--

___
Python tracker 

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



[issue36564] Infinite loop with short maximum line lengths in EmailPolicy

2019-05-17 Thread R. David Murray


R. David Murray  added the comment:

Can you demonstrate the parsing error?  maxlen should have no effect during 
parsing.

--

___
Python tracker 

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



[issue36564] Infinite loop with short maximum line lengths in EmailPolicy

2019-05-17 Thread Abhilash Raj


Abhilash Raj  added the comment:

I was wrong about the parsing error, it looks like length from the policy isn't 
used when parsing.

>>> from email.policy import default
>>> from email import message_from_string
>>> p = default.clone(max_line_length=10)
>>> msg = message_from_string("""\
... From: he...@example.com
... To: he...@example.com
... Subject: WelcomeToThisLongSubject
... 
... Thanks""", policy=p)
>>> msg

>>> msg['Subject']
'WelcomeToThisLongSubject'


This works just fine. Thanks David. +1 for ValueError then.

--

___
Python tracker 

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



[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Clarification is fine, but "MyClass and MySubclass are instances of Meta:" is 
100% true. Declaring a class to have a metaclass (or inheriting from a class 
with a metaclass) means that the class itself is an instance of the metaclass.

New instances of the classes with metaclass Meta are not "created using Meta"; 
Meta modifies the creation of the classes themselves, not instances of the 
classes.

Point is, your suggested change is half wrong (new instances of MyClass and 
MySubclass aren't directly created using Meta), and half misunderstanding the 
current documentation ("MyClass is an instance of Meta" already means "MyClass 
has the metaclass Meta").

--
nosy: +josh.r

___
Python tracker 

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



[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

If you want to modify the text, please create a PR for this file: 
https://github.com/python/cpython/blob/master/Doc/reference/datamodel.rst#metaclasses

Don't forget to sign the CLA, 

Thank you

--

___
Python tracker 

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



[issue36564] Infinite loop with short maximum line lengths in EmailPolicy

2019-05-17 Thread Paul Ganssle


Paul Ganssle  added the comment:

Responding to a comment on the PR:

> Now, that said you might want to consider the fact that in 
> _fold_mime_parameters I deal with this issue by bumping maxlen to 78 rather 
> than raising an error. I'm not sure that was the right choice, but whatever 
> we do, it should probably be made consistent between the two cases.

So I think in an ideal world this would be consistent between the two, but I 
*also* think that the right solution is to raise an exception rather than 
silently coercing, and changing this in _fold_mime_parameters would be a 
backwards-incompatible change.

I think that if you agree that an exception is better, maybe the path forward 
is to raise an exception in this case and switch the _fold_mime_parameters case 
over to raising a warning, which will be turned into an exception in a later 
release (3.10 maybe).

> It is so sad that I never came back to fix that XXX comment I left myself :(

I'm glad that the XXX comment was at least there! Otherwise I wouldn't have 
notice that there was anything to fix!

--

___
Python tracker 

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



[issue28874] test_logging fails and freezes

2019-05-17 Thread Yury


Yury  added the comment:

And same happens to me when building version 3.7.3.
I'm building with gcc (GCC) 4.8.5.

--

___
Python tracker 

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



[issue36947] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Nicholas Matthews


New submission from Nicholas Matthews :

Currently the final sentence of the second paragraph reads:
"In the following example, both MyClass and MySubclass are instances of Meta:"
It should read something like:
"In the following example, both MyClass and MySubclass have the metaclass Meta, 
and new instances will be created using Meta:"

Classes are created by their metaclass, but cannot be said to be instances of 
their metaclass, correct?

--
components: Library (Lib)
messages: 342723
nosy: Nicholas Matthews
priority: normal
severity: normal
status: open
title: Fix 3.3.3.1 Metaclasses Documentation
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



[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Found here: https://docs.python.org/3/reference/datamodel.html#metaclasses

Thank you

--
status: pending -> open

___
Python tracker 

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



[issue36564] Infinite loop with short maximum line lengths in EmailPolicy

2019-05-17 Thread R. David Murray


R. David Murray  added the comment:

Right, one of the fundamental principles of the email library is that when 
parsing input we do not ever raise an error.  We may note defects, but whatever 
we get we *must* parse and turn in to *something*.

--

___
Python tracker 

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



[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread Steve Dower


Steve Dower  added the comment:

I think this should be opt-in, not opt-out.

Imagine you're an existing application and you want to embed Python. Why would 
you ever want it to suddenly change your global settings like this?

As a general rule, an embedded Python runtime should deal with all the settings 
it's been provided and not forcibly change *any* of them (though maybe the 
embedding application will discover bugs and have to update their entire 
application to deal with it - or switch to a language that isn't so demanding!).

For this specific case, it seems just as easy to opt-in by calling 
setlocale(LC_CTYPE, "") before initializing Python. We can recommend this in 
docs and do it ourselves in Py_Main, but I don't see why we'd add a specific 
option for configuring the user's C runtime.

--

___
Python tracker 

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



[issue29696] Use namedtuple in string.Formatter.parse iterator response

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

It looks like Pablo's patch for this was good, but then closed because the idea 
was rejected.  Should this ticket also be closed as rejected?

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-05-17 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
keywords: +easy
title: Fix 3.3.3.1 Metaclasses Documentation -> [Good first issue] Fix 3.3.3.1 
Metaclasses Documentation

___
Python tracker 

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



[issue36770] stdlib - shutil.make_archive - add support for different ZIP compression method

2019-05-17 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi @owenchia

Thanks for your contribution!

The project can legally accept your contribution by verifying you have signed 
the PSF contributor agreement (CLA).

CLA: https://www.python.org/psf/contrib/contrib-form/

Could you create a PR on Github with your patch? In your bpo account, do not 
forget to assign your github account to your bpo account with the right value
 

Thank you

--
nosy: +matrixise

___
Python tracker 

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



[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:

> I'm not sure if it's real issue in practice. Maybe users learnt how to 
> workaround this limitation.

I sent an email to capi-sig to get a feedback on this question :-)

https://mail.python.org/archives/list/capi-...@python.org/thread/KP2QNE4YITGJDZMZW5Y4EGIPZR2L6HRD/

--

___
Python tracker 

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



[issue36751] Changes in the inspect module for PEP 570

2019-05-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue1875] "if 0: return" not raising SyntaxError

2019-05-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue35195] [Windows] Python 3.7 initializes LC_CTYPE locale at startup, causing performance issue on msvcrt isdigit()

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-36945: "Add _PyPreConfig.configure_locale: allow to leave 
LC_CTYPE unchanged when embedding Python".

--

___
Python tracker 

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



[issue36789] Unicode HOWTO incorrectly states that UTF-8 contains no zero bytes

2019-05-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13294

___
Python tracker 

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



[issue36907] Crash due to borrowed references in _PyStack_UnpackDict()

2019-05-17 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
pull_requests: +13292

___
Python tracker 

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



[issue36918] ValueError warning in test_urllib due to io.IOBase destructor

2019-05-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think this is a bug in BasicIO. close() should be idempotent. Calling it on 
the closed file should have no effect.

--
components: +IO -Tests
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@maker, would you be interested in converting your patch to a Github pull 
request?  Thanks!

--
nosy: +cheryl.sabella
versions: +Python 3.8 -Python 3.4

___
Python tracker 

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



[issue36908] "This module is always available" is confusing

2019-05-17 Thread Kushal Das


Kushal Das  added the comment:

In future we should do the similar change for any module. This will be helpful 
for new beginners.

--
nosy: +kushal.das

___
Python tracker 

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



[issue1875] "if 0: return" not raising SyntaxError

2019-05-17 Thread miss-islington


miss-islington  added the comment:


New changeset 85ed1712e428f93408f56fc684816f9a85b0ebc0 by Miss Islington (bot) 
in branch '3.7':
bpo-1875: Raise SyntaxError in invalid blocks that will be optimised away 
(GH-13332)
https://github.com/python/cpython/commit/85ed1712e428f93408f56fc684816f9a85b0ebc0


--
nosy: +miss-islington

___
Python tracker 

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



[issue36918] ValueError warning in test_urllib due to io.IOBase destructor

2019-05-17 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

My analysis was that close was called on fakesocket which is internally closed 
when it's counter resets to zero and the destructor was trying to flush on a 
closed object during destructor call.

Comment from https://bugs.python.org/issue18748#msg341106

The ValueError warnings in test_urllib noted in msg340059  feels like an issue 
with the test where FakeSocket calls close by itself once it's internal io_refs 
counter is 0 and during destructor again close is called on an already closed 
object causing the ValueError.

* The test uses fakehttp() creating FakeSocket starting with io_refs as 1 [1]
* During the test in urlopen, sock.makefile() (io_refs += 1) is called 
increasing the io_refs to be 2.
* HTTPConnection.close calls sock.close (fakesocket.close) [3] calling io_refs 
-= 1 and to fakesocket.io_ref to be 1.
* This test uses raises status 302 with http_error_302 which calls 
self.redirect_internal where self.close is again called causing fp.io_refs == 0 
and subsequently calling io.BytesIO.close(self) to close the object. [4]
* During the end of the test destructor is called on the above closed 
fakesocket object and trying to flush on a closed object causes the ValueError 
warnings .

Maybe a check could be added during flush to make sure the object is not closed 
by testing for self.closed but I am not sure if closed attribute is guaranteed 
to be present. Removing the manual call to close in fakesocket could help since 
the destructor should be taking care of it and I could see no test failures or 
warnings removing the close as io_refs gets to 0.

[1] 
https://github.com/python/cpython/blob/be6dbfb43b89989ccc83fbc4c5234f50f44c47ad/Lib/test/test_urllib.py#L61
[2] 
https://github.com/python/cpython/blob/be6dbfb43b89989ccc83fbc4c5234f50f44c47ad/Lib/test/test_urllib.py#L67
[3] 
https://github.com/python/cpython/blob/be6dbfb43b89989ccc83fbc4c5234f50f44c47ad/Lib/http/client.py#L919
[4] 
https://github.com/python/cpython/blob/be6dbfb43b89989ccc83fbc4c5234f50f44c47ad/Lib/urllib/request.py#L2145

--

___
Python tracker 

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



[issue36918] ValueError warning in test_urllib due to io.IOBase destructor

2019-05-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

No, BasicIO.close() is correct.

This is a bug in the garbage collector: the underlying file is closed before 
closing HTTPResponse. The HTTPResponse instance has a reference to the file 
object, the file object does not have a reference to the HTTPResponse instance, 
therefore the HTTPResponse instance should be destroyed first.

--

___
Python tracker 

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



[issue36908] "This module is always available" is confusing

2019-05-17 Thread Kushal Das


Kushal Das  added the comment:


New changeset 6faad355db6c2bd4a0ade7868f245b42c04f5337 by Kushal Das (Ned 
Batchelder) in branch 'master':
bpo-36908: 'This module is always available' isn't helpful. (#13297)
https://github.com/python/cpython/commit/6faad355db6c2bd4a0ade7868f245b42c04f5337


--

___
Python tracker 

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



[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:

> Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when 
> embedding Python

This parameter is similar the _PyCoreConfig.configure_c_stdio parameter that I 
just added. It allows to behave more as a "regular Python" or to better 
"isolate Python".

--

___
Python tracker 

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



[issue1875] "if 0: return" not raising SyntaxError

2019-05-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13293

___
Python tracker 

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



[issue1875] "if 0: return" not raising SyntaxError

2019-05-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset af8646c8054d0f4180a2013383039b6a472f9698 by Pablo Galindo in 
branch 'master':
bpo-1875: Raise SyntaxError in invalid blocks that will be optimised away 
(GH-13332)
https://github.com/python/cpython/commit/af8646c8054d0f4180a2013383039b6a472f9698


--

___
Python tracker 

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



[issue35252] test_functools dead code after FIXME

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@lukasz.langa added this FIXME comment originally, so nosying him for a review.

--
nosy: +cheryl.sabella, lukasz.langa

___
Python tracker 

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



[issue36789] Unicode HOWTO incorrectly states that UTF-8 contains no zero bytes

2019-05-17 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue17679] sysconfig generation uses some env variables multiple times

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:

The patch is wrong. I'm not sure when/how C flags are duplicated. Anyway, it 
seems like the issue is somehow outdated or even gone, so I close the issue.

--
resolution:  -> out of date
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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13295

___
Python tracker 

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



[issue10669] Document Deprecation Warnings and how to fix

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

If this is change is still desirable, I think it might be a good issue for 
someone who had contributed a few patches and is looking for something a little 
more challenging to work on.

--
nosy: +cheryl.sabella, mdk, willingc
stage:  -> needs patch
versions: +Python 3.8 -Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue19175] Erroneous reference to "integer" in format string grammar

2019-05-17 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Format mini-language integer definition is incorrect

___
Python tracker 

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



[issue28874] test_logging fails and freezes

2019-05-17 Thread Yury


Yury  added the comment:

I am observing this issue while building 3.6.8 version on CentOS 7.6. Shall we 
reopen the bug? Thanks, Yury.

--
nosy: +scrutari

___
Python tracker 

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



[issue36949] WeakSet.__repr__ and __str__ do not show contents of the set

2019-05-17 Thread Steve Dower


New submission from Steve Dower :

This spoils the output of our test suite when there are dangling threads, as 
the basic "print" doesn't show anything useful.

--
messages: 342734
nosy: steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: WeakSet.__repr__ and __str__ do not show contents of the set
type: enhancement
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



[issue36942] Windows code changes for Windows ARM64

2019-05-17 Thread Steve Dower


Steve Dower  added the comment:


New changeset 3ea702eca17c4ab5209d823fac2463307dde0633 by Steve Dower (Paul 
Monson) in branch 'master':
bpo-36942 Windows build changes for Windows ARM64 (GH-13366)
https://github.com/python/cpython/commit/3ea702eca17c4ab5209d823fac2463307dde0633


--

___
Python tracker 

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



[issue34881] unnecessary encoded-words usage breaks DKIM signatures

2019-05-17 Thread Abhilash Raj


Abhilash Raj  added the comment:

Just for reference DKIM-Signature header is defined in RFC 6376 and the BNF 
description for the header is mentioned here 
(https://tools.ietf.org/html/rfc6376#section-3.5).

It is a bit long so I am not copy-pasting it here.

I might take a stab at writing a value_parser for this, but after I can write 
some simple ones. This seems to be overly complicated with many 
(optional/required) fields

--
nosy: +maxking

___
Python tracker 

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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-17 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

In issue27485 the deprecated functions were replaced with underscore prefixed 
ones due to which imports where modified. Some of the places where not changed 
causing NameError in using urllib.request.URLopener.retrieve for local files 
and non-local files which is deprecated. I found these undefined names while 
running flake8 on Lib folder. I will raise a PR with tests for the same.

Sample Error : 

./python.exe
Python 3.8.0a4+ (heads/master:870b035bc6, May 17 2019, 16:28:23)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.request import URLopener
>>> URLopener().retrieve('file:///tmp/a.txt')
sys:1: DeprecationWarning: URLopener style of invoking requests is deprecated. 
Use newer urlopen functions/methods
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/urllib/request.py", 
line 1786, in retrieve
return url2pathname(splithost(url1)[1]), hdrs
NameError: name 'splithost' is not defined

--
components: Library (Lib)
messages: 342733
nosy: cheryl.sabella, xtreak
priority: normal
severity: normal
status: open
title: NameError in urllib.request.URLopener.retrieve
type: behavior
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



[issue36948] NameError in urllib.request.URLopener.retrieve

2019-05-17 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:

Steve:
> Imagine you're an existing application and you want to embed Python. Why 
> would you ever want it to suddenly change your global settings like this?

I have a very good news for you :-) Slowly but steadily, we converge on a 
agreement ;-)

The more time I spend on PEP 587, the more I think that the following use cases 
are too different and "incompatible":

* customized Python interpreter: behaves as the "regular Python"
* Embedded Python

I drafted "Isolate Python" in my PEP 587. With subtle options like 
configure_c_stdio, parse_argv and now configure_locale, it seems like we really 
need two *separated* these two configurations.

I implemented exactly that in PR 13388, I added 2 functions:

* _PyCoreConfig_InitPythonConfig(): provide a default configuration which 
parses command line arguments, enable UTF-8 Mode depending on the locale, read 
global configuration variables, read environment variables, etc.

* _PyCoreConfig_InitIsolateConfig(): isolated from the system, ignore command 
line arguments, ignore global configuration variables, leave the LC_CTYPE 
locale and C streams unchanged, etc.

I'm working on an update of my PEP to better describe that.

--

So I understand that this option is needed and you should prefer to turn it off 
by default in _PyCoreConfig_InitIsolateConfig.

--

___
Python tracker 

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



[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread Steve Dower


Steve Dower  added the comment:

> * customized Python interpreter: behaves as the "regular Python"

For this, why wouldn't we say "start by copying all the code in 
Programs/python.c"? Is there any reason why that file needs to only be one 
single call into Py_Main? Maybe there's some reason I'm not aware of...

--

___
Python tracker 

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



[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:

> Nice, these will be helpful. Probably a good thing to try out with some 
> embedders too, to see whether they're intuitive enough.

I suggest to move this discussion on the WIP PR of 4th version of my PEP:
https://github.com/python/peps/pull/1056

I will reply you there :-)

--

___
Python tracker 

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



[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor

STINNER Victor  added the comment:

I asked on Twitter: "If you embed Python in your application, would you prefer 
Python to leave your locale unchanged?"

Mai Giménez replied: "I would like to."
https://twitter.com/maidotgimenez/status/1129357352774393856

Steve Dower wrote:
"I think this should be opt-in, not opt-out."

I count at least two users who would like to get such option, so my idea wasn't 
stupid :-)

I updated my PR and I plan to merge it soon.

--

___
Python tracker 

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



[issue34215] streams.py:IncompleteReadError is message is unclear when expected is None

2019-05-17 Thread Tyler Bell


Tyler Bell  added the comment:

I've updated my PR to reflect a better message for the IncompleteReadError 
exception. When expected is None, the error reads, "IncompleteReadError: 1 
bytes read on a total of None expected bytes" which is confusing. My PR changes 
this to "IncompleteReadError: 1 bytes read on a total of unknown expected 
bytes". Otherwise, it is required that whoever views the exception 
text(possibly through layers of abstraction), to know that None(a "low level" 
programmers decision) is equal to unknown.

--
nosy: +Tyler Bell
title: streams.py:readuntil IncompleteReadError is message is incorrect -> 
streams.py:IncompleteReadError is message is unclear when expected is None

___
Python tracker 

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



[issue36867] Make semaphore_tracker track other system resources

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like all known bugs are fixed, I close again the issue. Thanks!

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

___
Python tracker 

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



[issue33524] non-ascii characters in headers causes TypeError on email.policy.Policy.fold

2019-05-17 Thread Abhilash Raj


Change by Abhilash Raj :


--
pull_requests: +13300

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2019-05-17 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +13301

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset cab5d0741ee6adf2ae9ff5aaafe06b75b4b5bca3 by Victor Stinner in 
branch 'master':
bpo-36763: Add _PyCoreConfig_InitPythonConfig() (GH-13388)
https://github.com/python/cpython/commit/cab5d0741ee6adf2ae9ff5aaafe06b75b4b5bca3


--

___
Python tracker 

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



[issue36941] Windows build changes for Windows ARM64

2019-05-17 Thread Steve Dower


Steve Dower  added the comment:


New changeset f96e7fd9240c1ce13f52bd3ba81f58b2511d89c3 by Steve Dower (Paul 
Monson) in branch 'master':
bpo-36941: Windows build changes for Windows ARM64 (GH-13365)
https://github.com/python/cpython/commit/f96e7fd9240c1ce13f52bd3ba81f58b2511d89c3


--

___
Python tracker 

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



[issue35947] Update libffi_msvc to current version of libffi

2019-05-17 Thread Paul Monson


Paul Monson  added the comment:

Would you like me to submit a PR to the What's New doc?

--

___
Python tracker 

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



[issue36867] Make semaphore_tracker track other system resources

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset cbe72d842646ded2454784679231e3d1e6252e72 by Victor Stinner 
(Pierre Glaser) in branch 'master':
bpo-36867: _test_multiprocessing: avoid weak sync primitive (GH-13292)
https://github.com/python/cpython/commit/cbe72d842646ded2454784679231e3d1e6252e72


--

___
Python tracker 

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



[issue21315] email._header_value_parser does not recognise in-line encoding changes

2019-05-17 Thread R. David Murray


R. David Murray  added the comment:

I don't see that line of code in unstructured_ew_without_whitespace.diff.

Oh, you are referring to his monkey patch.  Yes, that is not a suitable 
solution for anyone but him, and I don't think he meant to imply otherwise :)

--

___
Python tracker 

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



[issue36929] Other Python _io implementations may not expose _io in their type names

2019-05-17 Thread Maxwell Bernstein


Change by Maxwell Bernstein :


--
pull_requests: +13302

___
Python tracker 

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



[issue32972] unittest.TestCase coroutine support

2019-05-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

https://github.com/python/cpython/pull/13386 is a new attempt to solve the 
feature request

--

___
Python tracker 

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



[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread Steve Dower

Steve Dower  added the comment:

> I have a very good news for you :-) Slowly but steadily, we converge on a 
> agreement ;-)

Yay! :)

> I added 2 functions …

Nice, these will be helpful. Probably a good thing to try out with some 
embedders too, to see whether they're intuitive enough.

(I promise I will get time to work on some code here soon, but right now I'm 
trying to get PEP 578 merged.)

--

___
Python tracker 

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



[issue21315] email._header_value_parser does not recognise in-line encoding changes

2019-05-17 Thread Abhilash Raj


Abhilash Raj  added the comment:

According to RFC  2047 5(1)

> However, an 'encoded-word' that appears in a
  header field defined as '*text' MUST be separated from any adjacent
  'encoded-word' or 'text' by 'linear-white-space'.

So, it seems like splitting on whitespace is the right thing to do (see MUST).

While your solution works for your case where the charset and cte are utf-8 and 
q respectively (not a general case for random chatsets and cte), it seems like 
a hack to get around the fact the header is non-conformant to RFC.

IMO manipulating the original header (value.replace in your patch) isn't 
something we should do, but @r.david.murray would be the right person to answer 
how we handle non-conformant messages.

--
nosy: +maxking

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13298

___
Python tracker 

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



[issue21315] email._header_value_parser does not recognise in-line encoding changes

2019-05-17 Thread Abhilash Raj


Abhilash Raj  added the comment:

The solution replaces RFC 20147 chrome for utf-8 and q to make sure there is a 
space before ew, it wouldn't replace in case of any other charset/cte pair.

value = value.replace("=?UTF-8?Q?=20", " =?UTF-8?Q?")

Isn't that correct?

--

___
Python tracker 

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



[issue36950] test.support: add an helper to wait for an event with a timeout

2019-05-17 Thread STINNER Victor


New submission from STINNER Victor :

The commit cbe72d842646ded2454784679231e3d1e6252e72 is a good example:

deadline = time.monotonic() + 60
t = 0.1
while time.monotonic() < deadline:
time.sleep(t)
t = min(t*2, 5)
try:
smm = shared_memory.SharedMemory(name, create=False)
except FileNotFoundError:
break
else:
raise AssertionError("A SharedMemory segment was leaked after"
 " a process was abruptly terminated.")

It would be nice to convert this code pattern into an helper function in 
test.support. It's common to have to wait for something in tests.

--
components: Tests
messages: 342751
nosy: vstinner
priority: normal
severity: normal
status: open
title: test.support: add an helper to wait for an event with a timeout
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue21315] email._header_value_parser does not recognise in-line encoding changes

2019-05-17 Thread R. David Murray


R. David Murray  added the comment:

A cleaner/safer solution here would be:

  tok, *remainder = _wsp_splitter(value, 1)
  if _rfc2047_matcher(tok):
  tok, *remainder = value.partition('=?')
  
where _rfc2047_matcher would be a regex that matches a correctly formatted 
encoded word. There a regex for that in the header.py module, though for this 
application we don't need the groups it has.

Abhilash, I'm not sure why you say the proposed solution only works for utf-8 
and 'q'?

--

___
Python tracker 

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



[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread Steve Dower


Steve Dower  added the comment:

> I suggest to move this discussion on the WIP PR of 4th version of my PEP

I prefer to keep it on the issue tracker where it doesn't disappear when merged 
and I get proper notifications. (I want to make the most of getting good 
notifications of new comments before they get taken away :( )

--

___
Python tracker 

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



[issue36755] [2.7] test_httplib leaked [8, 8, 8] references with OpenSSL 1.1.1

2019-05-17 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 951af2d7f140be7beb9cda2bcdd54f820c905e45 by Benjamin Peterson in 
branch '2.7':
closes bpo-36755: Suppress noisy error output in test HTTPS server by default. 
(GH-13370)
https://github.com/python/cpython/commit/951af2d7f140be7beb9cda2bcdd54f820c905e45


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



[issue21315] email._header_value_parser does not recognise in-line encoding changes

2019-05-17 Thread Abhilash Raj


Abhilash Raj  added the comment:

Ah, I wrongly assumed the patch had the same thing.

Sorry about that.

--

___
Python tracker 

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



[issue36951] Wrong types for PyMemberDefs in Objects/typeobject.c

2019-05-17 Thread Kevin Shweh


Kevin Shweh  added the comment:

Looks like I accidentally doubled the PyMemberDef for __weakrefoffset__ while 
editing. There's no double definition in the actual file.

--

___
Python tracker 

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



[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bcfbbd704646622e919c1306a91fba61d603483d by Victor Stinner in 
branch 'master':
bpo-36945: Add _PyPreConfig.configure_locale (GH-13368)
https://github.com/python/cpython/commit/bcfbbd704646622e919c1306a91fba61d603483d


--

___
Python tracker 

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



[issue33524] non-ascii characters in headers causes TypeError on email.policy.Policy.fold

2019-05-17 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue33524] non-ascii characters in headers causes TypeError on email.policy.Policy.fold

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Thank you, @licht-t for the original patch and @maxking for the rebase.  Also, 
thank you, @r.david.murray for the review and merge.

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13306

___
Python tracker 

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



[issue33524] non-ascii characters in headers causes TypeError on email.policy.Policy.fold

2019-05-17 Thread miss-islington


miss-islington  added the comment:


New changeset 5386aaf07835889e90fb33e95b6d37197f8cfea0 by Miss Islington (bot) 
in branch '3.7':
bpo-33524: Fix the folding of email header when max_line_length is 0 or None 
(GH-13391)
https://github.com/python/cpython/commit/5386aaf07835889e90fb33e95b6d37197f8cfea0


--
nosy: +miss-islington

___
Python tracker 

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



[issue35926] Need openssl 1.1.1 support on Windows for ARM and ARM64

2019-05-17 Thread Steve Dower


Change by Steve Dower :


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



[issue36908] "This module is always available" is confusing

2019-05-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13304

___
Python tracker 

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



[issue36908] "This module is always available" is confusing

2019-05-17 Thread miss-islington


miss-islington  added the comment:


New changeset 740a7cde9c0af5a237a7f6525b38d65a83f4fbf1 by Miss Islington (bot) 
in branch '3.7':
bpo-36908: 'This module is always available' isn't helpful. (GH-13297)
https://github.com/python/cpython/commit/740a7cde9c0af5a237a7f6525b38d65a83f4fbf1


--
nosy: +miss-islington

___
Python tracker 

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



[issue34700] typing.get_type_hints doesn't know about typeshed

2019-05-17 Thread Jakub Stasiak


Change by Jakub Stasiak :


--
nosy: +jstasiak

___
Python tracker 

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



[issue36596] tarfile module considers anything starting with 512 bytes of zero bytes to be a valid tar file

2019-05-17 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

I did some testing with BSD and GNU tar to compare with Python's behavior.

jfoo:~ jeff$ tar --version
bsdtar 2.8.3 - libarchive 2.8.3

jeff@albarino:~$ tar --version
tar (GNU tar) 1.28

Both BSD tar and GNU tar can create an empty tar file that consists of all zero 
bytes. BSD tar creates a 1 KB file:

jfoo:~ jeff$ tar -cf tarfilename.tar -T /dev/null
jfoo:~ jeff$ hexdump tarfilename.tar 
000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
400
jfoo:~ jeff$ tar -tf tarfilename.tar
jfoo:~ jeff$ echo $?
0

while GNU tar creates a 10 KB file:

jeff@albarino:~$ tar -cf tarfilename.tar -T /dev/null
jeff@albarino:~$ hexdump tarfilename.tar
000        
*
0002800
jeff@albarino:~$ tar -tf tarfilename.tar 
jeff@albarino:~$ echo $?
0

GNU tar will also leave a tar file with 10 KB of zeros when all contents have 
been deleted (BSD tar doesn't support deletion):

jeff@albarino:~$ tar cf empty.tar tarfilename.tar 
jeff@albarino:~$ hexdump empty.tar 
000 6174 6672 6c69 6e65 6d61 2e65 6174 0072
010        
*
060   3030 3030 3636 0034 3030 3130
070 3537 0031 3030 3130 3537 0031 3030 3030
080 3030 3432 3030 0030 3331 3634 3637 3430
090 3331 0037 3130 3432 3637 2000 0030 
0a0        
*
100 7500 7473 7261 2020 6a00 6665 0066 
110        
120     6a00 6665 0066 
130        
*
0005000
jeff@albarino:~$ tar --delete -f empty.tar tarfilename.tar
jeff@albarino:~$ hexdump empty.tar 
000        
*
0002800
jfoo:~ jeff$ tar -tf empty.tar
jfoo:~ jeff$ echo $?
0


According to the POSIX.1 standard, "[t]he last physical block shall always be 
the full size, so logical records after the two zero logical records may 
contain undefined data." 
(http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#).

It looks like any file starting with 1,024 bytes of zeros is a valid tar 
archive per BSD tar, GNU tar, and the POSIX.1 standard.

However, BSD tar and GNU tar disagree about files starting with 512 bytes of 
zeros followed by 512 bytes of garbage. First, I constructed such a file for 
testing (zr.tar):

jfoo:~ jeff$ dd if=/dev/zero of=zr.tar bs=512 count=1
1+0 records in
1+0 records out
512 bytes transferred in 0.60 secs (8521761 bytes/sec)
jfoo:~ jeff$ dd if=/dev/random of=zr.tar bs=512 count=1 oseek=1
1+0 records in
1+0 records out
512 bytes transferred in 0.56 secs (9138228 bytes/sec)
jfoo:~ jeff$ ls -l zr.tar
-rw-r--r--  1 jeff  staff  1024 May 17 13:14 zr.tar
jfoo:~ jeff$ hexdump zr.tar 
000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
200 d7 56 a9 8d 26 11 a4 d8 9a 96 15 04 8d 4b 31 5d
210 33 2b 20 ae a2 23 09 8c 60 a1 73 12 a1 ab 73 61
220 69 eb 88 bf 8a 7d 6b 9a c5 79 b6 c9 9b a9 5a 6d
230 4b 4a 81 a7 71 da 90 24 3f 8f 43 a9 95 a0 20 bb
240 93 0f b2 be 7e 4d 80 49 aa 61 19 a2 6b b5 5c f4
250 e0 34 7f 99 a0 d3 29 08 9a 25 97 96 d4 d0 07 e4
260 90 1c 60 97 9a 23 d3 25 38 54 97 8b 71 a0 83 40
270 a6 f9 19 1b 3f 6e bc 5b 06 22 20 fc ff fe 7b eb
280 35 9b 52 57 14 83 90 7f d3 e8 f4 72 58 96 16 8c
290 09 ad 2a 2f ad fd 43 09 96 eb 7c 8f fc a6 14 d9
2a0 18 34 38 b6 6a 5a ff 66 6d 46 cb 77 7a 5c 1e 72
2b0 3e 27 05 3a b0 c4 52 7b c8 cc 26 b9 c3 5f 39 27
2c0 a3 49 9e f1 3f f8 7e 46 98 df 7c 9d e3 86 c3 72
2d0 e1 ef 98 7d a1 96 4e 4b 82 bb f4 2b f3 71 6f 16
2e0 fe 38 2d bc 2b 70 b3 e6 db 1b ad 44 13 06 28 e5
2f0 3d 05 07 3c 5f 09 5b 90 67 09 0b 5a db 79 b7 27
300 8a 4b e5 b3 66 f0 7a 9d a5 c4 e3 a8 b4 b2 d2 c8
310 5d d1 27 81 03 25 33 f4 fb 6f 77 b1 df 9d fa cf
320 01 a7 70 40 b4 7f 6b ac 04 70 5c 29 06 6a 73 64
330 4f 15 92 3b 5e a4 34 95 e0 4b 04 be ca 87 e9 73
340 1e 63 98 f3 f1 fd be 7a de fe 84 27 b7 e4 db e0
350 fb 04 7f 9d f0 ae af a3 8e 0f c2 a7 80 e0 32 38
360 17 1e 47 37 48 9b 99 35 58 9d d5 83 1b 67 d4 e8
370 15 0d 00 bb 79 f3 37 59 c3 5e e9 1d 87 79 96 de
380 6c 89 35 34 0b b1 12 b2 a8 2d 61 dd f5 9a 19 e7
390 c1 c5 24 46 fa 23 f0 db 72 7f a5 18 aa e2 db 04
3a0 1e cc a6 0f 9e 4e 00 d9 2d eb f9 fc c4 d5 8e 46
3b0 ab c3 ed 53 98 df a8 81 26 f4 b5 0f b4 7f 12 a4
3c0 4a aa 14 4c f5 aa dd ba 69 e5 a8 d5 b3 68 0b 9f
3d0 1a aa 34 a4 60 09 c2 30 22 32 72 dd 2e f9 7a 79
3e0 88 a3 6a 99 13 4f f4 27 db 02 2e cb a0 ec d8 4d
3f0 fe 68 44 0c 7b 3a 74 8d 8e cd ba 3e d8 ef cb 97
400


GNU tar outputs a warning message, but still returns zero:

jeff@albarino:~$ tar -tvf zr.tar 
tar: A lone zero block at 1
jeff@albarino:~$ echo $?
0

while BSD tar silently accepts the file:

jfoo:~ jeff$ tar -tvf zr.tar 
jfoo:~ jeff$ echo $?
0

Python also accepts the file as valid:

>>> tarfile.open("zr.tar", "r")


Personally, I think that an error should be returned if the file 

[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 12083284c54be25abadd85781d36b63731dc1f0c by Victor Stinner in 
branch 'master':
bpo-36763: _Py_RunMain() doesn't call Py_Exit() anymore (GH-13390)
https://github.com/python/cpython/commit/12083284c54be25abadd85781d36b63731dc1f0c


--

___
Python tracker 

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



  1   2   >