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

2019-05-17 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue35924] curses segfault resizing window

2019-05-17 Thread Josiah Ulfers


Josiah Ulfers  added the comment:

Yes, thanks Toshio and Lisa and sorry for the slow response. I just now built a 
Python 3.7.3 against ncurses-6.1-20190511 and can confirm it resolved the issue.

--
status:  -> closed

___
Python tracker 

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



[issue36954] test_recursive_repr breaks tracing in test_xml_etree

2019-05-17 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +scoder

___
Python tracker 

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



[issue36953] Remove collections ABCs?

2019-05-17 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Relevant PR and discussion : https://github.com/python/cpython/pull/10596 . pip 
is incompatible due to the vendored copy of html5lib that needs a new release .

--
nosy: +xtreak

___
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 410759fba80aded5247b693c60745aa16906f3bb by Victor Stinner in 
branch 'master':
bpo-36763: Remove _PyCoreConfig.dll_path (GH-13402)
https://github.com/python/cpython/commit/410759fba80aded5247b693c60745aa16906f3bb


--

___
Python tracker 

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



[issue36953] Remove collections ABCs?

2019-05-17 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
nosy: +mbussonn

___
Python tracker 

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



[issue31677] email.header uses re.IGNORECASE without re.ASCII

2019-05-17 Thread Haw Loeung


Change by Haw Loeung :


--
pull_requests: +13314

___
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: +13313

___
Python tracker 

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



[issue2180] tokenize: mishandles line joining

2019-05-17 Thread Anthony Sottile


Change by Anthony Sottile :


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

___
Python tracker 

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



[issue23012] RuntimeError: settrace/setprofile function gets lost

2019-05-17 Thread Gordon P. Hemsley


Change by Gordon P. Hemsley :


--
nosy: +gphemsley

___
Python tracker 

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



[issue36474] RecursionError resets trace function set via sys.settrace

2019-05-17 Thread Gordon P. Hemsley


Change by Gordon P. Hemsley :


--
nosy: +gphemsley

___
Python tracker 

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



[issue10933] Tracing disabled when a recursion error is triggered (even if properly handled)

2019-05-17 Thread Gordon P. Hemsley


Change by Gordon P. Hemsley :


--
nosy: +gphemsley

___
Python tracker 

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



[issue36953] Remove collections ABCs?

2019-05-17 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue36954] test_recursive_repr breaks tracing in test_xml_etree

2019-05-17 Thread Gordon P. Hemsley


New submission from Gordon P. Hemsley :

When running test_xml_etree with tracing, e.g. when running test coverage, 
tracing breaks after the execution of test_recursive_repr.

--
components: Tests
messages: 342783
nosy: blueyed, gphemsley, serhiy.storchaka
priority: normal
pull_requests: 13311
severity: normal
status: open
title: test_recursive_repr breaks tracing in test_xml_etree
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



[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 bab0db6076900cd828588be8595b3cdfade7e7e9 by Victor Stinner in 
branch 'master':
bpo-36763: Use _PyCoreConfig_InitPythonConfig() (GH-13398)
https://github.com/python/cpython/commit/bab0db6076900cd828588be8595b3cdfade7e7e9


--

___
Python tracker 

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



[issue17774] unable to disable -r in run_tests.py

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Since -r doesn't usually take a value, what would be the best way to implement 
this?  The current implementation always adds -r, so not including '-r' would 
need to retain the current behavior of randomization.  Would something like 
'--no-random' be a good way to implement this?  That would be different than 
how the program handles the -u or -j because the '--no-random' would have to be 
removed from regrtest_args.

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

___
Python tracker 

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



[issue36721] Add pkg-config python-3.8-embed

2019-05-17 Thread Scott Talbert


Change by Scott Talbert :


--
nosy: +swt2c

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

Ah, you're right on __call__; I've never bothered to override it on a 
metaclass, but yes, since a class using a metaclass is an instance of the 
metaclass, like all instances, calling it invokes the __call__ of its type 
(it's just that the default metaclass, type, has a __call__ that turns around 
and calls the __new__ and __init__ of the "instance", which is a class). The 
nomenclature is hard here.

In any event, yes, overriding __call__ will let you hook into the construction 
of each individual instance of the classes using the metaclass. That's not 
generally true of all uses of metaclasses (if __call__ is inherited from type, 
then while new instances are technically created using the metaclass, the 
metaclass is just letting the normal __new__/__init__ calls take place without 
interference).

There is very little in the way of Python official documentation on 
metaclasses; the line you proposed to change is one of the few places it's 
mentioned (most references to metaclasses are on that Data Model page). There 
are a couple of mentions in the PEPs, and a lot of off-site tutorials, but it's 
a poorly documented feature in general.

It's pretty easy to demonstrate the current wording is correct though:

>>> class Meta(type):
... pass
...
>>> class MyMeta(metaclass=Meta):
... pass
...
>>> isinstance(MyMeta, Meta)
True

Note that we're using isinstance, not issubclass, and we're not constructing a 
MyMeta instance. MyMeta itself is an instance of Meta.

I really think the problem here is that the documentation is correct, but so 
bare it's easy to miss the implications of "MyClass and MySubclass are 
instances of Meta"; since the classes are instances of another class, the 
metaclass has the same power over them that normal classes have over their 
instances. That's why __call__ can hook the creation of instances, __new__ can 
hook the creation of the class itself, __getitem__ can be used to perform 
lookups on the child class (in at least of the few iterations of the typing 
framework, that's how List[int] and the like worked; not sure if it's still 
that way), and properties defined on the metaclass can be accessed on classes 
that use it, but not their instances. It's enormously powerful, but so complex 
that the Python docs tend to encourage simpler, more targeted ways of tweaking 
classes (e.g. decorators).

--

___
Python tracker 

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



[issue36953] Remove collections ABCs?

2019-05-17 Thread Paul Ganssle


New submission from Paul Ganssle :

In PR 5640 (https://github.com/python/cpython/pull/5460), a warning was added 
that importing ABCs from collections directly is deprecated and will be removed 
in Python 3.8, but they have not yet been removed and the warning is still 
active.

If they are going to be removed, presumably it needs to be done before the 
feature freeze at the end of May, otherwise, in the meantime, I think the 
warning needs to be updated to say that it will be removed in Python 3.9.

--
components: Library (Lib)
messages: 342779
nosy: p-ganssle, rhettinger, serhiy.storchaka, stutzbach
priority: normal
severity: normal
status: open
title: Remove collections ABCs?
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



[issue36952] fileinput input's and Fileinput's bufsize=0 marked for removal in 3.8

2019-05-17 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


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

___
Python tracker 

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



[issue29847] Path takes and ignores **kwargs

2019-05-17 Thread Jason Saporta


Change by Jason Saporta :


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

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

gregory.p.smith, I believe Serhiy was looking for a review on PR5914.  Maybe 
it's not too late for this to get into 3.8?  Thanks!

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue33829] C API: provide new object protocol helper

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

It seems that this issue is languishing without any additional comments from 
the OP.  Should it be closed as rejected?  Thanks!

--
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: +13308

___
Python tracker 

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



[issue35924] curses segfault resizing window

2019-05-17 Thread Lisa Roach


Lisa Roach  added the comment:

Thank you for all the work you did on this Toshio! I think we are good to close 
this issue.

--
stage: patch review -> resolved

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

It looks like @ronaldoussoren's pull request was ready to go pending a test 
with Brew.  The PR itself needs a rebase, but is anyone able to finish the 
testing on this for it to be merged?  Thanks!

--
nosy: +cheryl.sabella
versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[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 b594784272d4907b1c40d3c40d17cb081aa9cf9b by Victor Stinner in 
branch 'master':
bpo-36763: _Py_InitializeFromArgs() argc becomes Py_ssize_t (GH-13396)
https://github.com/python/cpython/commit/b594784272d4907b1c40d3c40d17cb081aa9cf9b


--

___
Python tracker 

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



[issue35805] email package folds msg-id identifiers using RFC2047 encoded words where it must not

2019-05-17 Thread Abhilash Raj


Abhilash Raj  added the comment:

I have created https://github.com/python/cpython/pull/13397 for this. For now, 
it only parses Message-ID header. 

I do plan to add support for other Identification headers soon, perhaps in a 
2nd PR.

--
nosy: +maxking
stage: patch review -> needs patch

___
Python tracker 

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



[issue27268] Incorrect error message on float('')

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@Drekin, thank you for the report, @Pedro Lacerda, thank you for the pull 
request, and @Nofar Schnider, thank you for the review.

--
resolution: works for me -> 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



[issue27268] Incorrect error message on float('')

2019-05-17 Thread Cheryl Sabella


Cheryl Sabella  added the comment:


New changeset 4fa7504ee3184cff064e23fe6799e717ed0f9357 by Cheryl Sabella (Pedro 
Lacerda) in branch 'master':
bpo-27268: Fix incorrect error message on float('') (GH-2745)
https://github.com/python/cpython/commit/4fa7504ee3184cff064e23fe6799e717ed0f9357


--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue35805] email package folds msg-id identifiers using RFC2047 encoded words where it must not

2019-05-17 Thread Abhilash Raj


Change by Abhilash Raj :


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

___
Python tracker 

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



[issue30509] Optimize calling type slots

2019-05-17 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue29847] Path takes and ignores **kwargs

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



[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



[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



[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 871ff77c1cd334a141d52b0d003c080a1928731e by Victor Stinner in 
branch 'master':
bpo-36763: Add _PyInitError functions (GH-13395)
https://github.com/python/cpython/commit/871ff77c1cd334a141d52b0d003c080a1928731e


--

___
Python tracker 

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



[issue36952] fileinput input's and Fileinput's bufsize=0 marked for removal in 3.8

2019-05-17 Thread Matthias Bussonnier


New submission from Matthias Bussonnier :

Can likely thus be removed now. 

See also https://bugs.python.org/issue33563 that was tracking better 
deprecation warnings.

If not removed documentation should bump removal to 3.9

--
components: Library (Lib)
messages: 342769
nosy: mbussonn
priority: normal
severity: normal
status: open
title: fileinput input's and Fileinput's bufsize=0 marked for removal in 3.8
versions: Python 3.8

___
Python tracker 

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



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

2019-05-17 Thread STINNER Victor


Change by STINNER Victor :


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


Mariatta Wijaya  added the comment:

Thanks all. I've backported the change to 3.7. I think this is good to be 
closed.

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



[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



[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



[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: +13305

___
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



[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



[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



[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



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

[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



[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



[issue36782] Add tests for the datetime C API

2019-05-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 98ff4d5fb6a9d01b0176b7786db61346952e5295 by Victor Stinner 
(Edison A) in branch 'master':
bpo-36782: Created C API wrappers and added missing tests for functions in the 
PyDateTimeAPI. (#13088)
https://github.com/python/cpython/commit/98ff4d5fb6a9d01b0176b7786db61346952e5295


--
nosy: +vstinner

___
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



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

2019-05-17 Thread Kevin Shweh


New submission from Kevin Shweh :

In Objects/typeobject.c, the PyMemberDefs for __flags__, __weakrefoffset__, and 
__dictoffset__ all use T_LONG:

{"__flags__", T_LONG, offsetof(PyTypeObject, tp_flags), READONLY},
{"__weakrefoffset__", T_LONG,
 offsetof(PyTypeObject, tp_weaklistoffset), READONLY},
...
{"__dictoffset__", T_LONG,
 offsetof(PyTypeObject, tp_dictoffset), READONLY},

{"__weakrefoffset__", T_LONG,
 offsetof(PyTypeObject, tp_weaklistoffset), READONLY},

but in Include/object.h or Include/cpython/object.h, the corresponding struct 
members have types unsigned long, Py_ssize_t, and Py_ssize_t respectively:

/* Flags to define presence of optional/expanded features */
unsigned long tp_flags;
...
/* weak reference enabler */
Py_ssize_t tp_weaklistoffset;
...
Py_ssize_t tp_dictoffset;

These uses of T_LONG should be changed to T_ULONG and T_PYSSIZE_T.

This was checked on 3.7.3 and master.

--
components: Interpreter Core
messages: 342759
nosy: Kevin Shweh
priority: normal
severity: normal
status: open
title: Wrong types for PyMemberDefs in Objects/typeobject.c
type: behavior
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



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

2019-05-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13303

___
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 R. David Murray


R. David Murray  added the comment:


New changeset feac6cd7753425fba006e97e2d9b74a0c0c75894 by R. David Murray 
(Abhilash Raj) in branch 'master':
bpo-33524: Fix the folding of email header when max_line_length is 0 or None 
(#13391)
https://github.com/python/cpython/commit/feac6cd7753425fba006e97e2d9b74a0c0c75894


--

___
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



[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


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



[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



[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



[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



[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



[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



[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



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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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


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



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



[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



[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



[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



[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



[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



[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



[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



[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



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



[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



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



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



[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



[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



[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



[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



[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



[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



  1   2   >