[issue36656] Allow os.symlink(src, target, force=True) to prevent race conditions

2019-05-14 Thread Tom Hale


Tom Hale  added the comment:

Thanks Toshio Kuratomi, I raised it on the mailing list at:

https://code.activestate.com/lists/python-ideas/55992/

--

___
Python tracker 

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



[issue36913] Missing documentation for decorators

2019-05-14 Thread Tomer Vromen


New submission from Tomer Vromen :

The documentation for decorators (for methods and classes) is pretty lacking.

Searching for "decorator" ( https://docs.python.org/3/search.html?q=decorator ) 
brings up a lot of libraries that use decorators, but no documentation 
explaining what they are and how they work. The documentation should have a 
dedicated page for explaining decorators, and this should be the 1st search 
result.

--

In the meantime, then search should give as a 1st result a link to the 
definition of decorator in the glossary: 
https://docs.python.org/3.7/glossary.html#glossary

Actually, it seems that there is no way to directly link to a paragraph in the 
glossary - so that should be added as well.

In general, it would be nice if a search for some term X would show as a 1st 
result the definition of X in the glossary (if it exists there).

Thanks!

--
assignee: docs@python
components: Documentation
messages: 342435
nosy: docs@python, tomerv
priority: normal
severity: normal
status: open
title: Missing documentation for decorators
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue36913] Missing documentation for decorators

2019-05-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi,

Thank you for your feedback.

In fact, there is a limitation with the current search engine of Sphinx 
(because we use it for the documentation). For example, if you try to find the 
meaning of "for", for us it's a keyword but for the search engine, it will try 
to find all the sections containing "for" (formatter, platform, 
argparse.ArgumentParser.format_help, etc...).

For that, we could open an issue on the repository of Sphinx.

Now, about the decorators.

In the definition of a function, we explain the call of a decorator, See the 
grammar. 
https://docs.python.org/3/reference/compound_stmts.html#function-definitions

"""
A function definition may be wrapped by one or more decorator expressions. 
Decorator expressions are evaluated when the function is defined, in the scope 
that contains the function definition. The result must be a callable, which is 
invoked with the function object as the only argument. The returned value is 
bound to the function name instead of the function object. Multiple decorators 
are applied in a nested fashion. For example, the following code
"""

But because it's a specification of the language which has been described with 
2 PEPs you can read it on the PEP Index page.

Function: https://www.python.org/dev/peps/pep-0318/ 
-> Introduced in 2.4 https://docs.python.org/3/whatsnew/2.4.html

Class: https://www.python.org/dev/peps/pep-3129/
-> Introduced in 3.0

Now, I suggest one thing, add a link to the PEPs in this section 
https://docs.python.org/3/reference/compound_stmts.html#function-definitions

--
nosy: +matrixise

___
Python tracker 

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



[issue36913] Missing documentation for decorators

2019-05-14 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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



[issue36913] Missing documentation for decorators

2019-05-14 Thread Tomer Vromen


Tomer Vromen  added the comment:

Thank you for the quick response.

Are PEPs considered de-facto documentation for language features? For example, 
string formatting was described in PEP 3101, but still has sections in the 
documentation dedicated to it. I believe that decorators should get a similar 
treatment :-)

I also think that describing decorators as part of the grammar definition is 
lacking. Why is there a whole chapter for Errors and Exceptions and it's not 
only discussed under the grammar definition for raise?

Decorators are a pretty unique (and cool!) feature of Python, and therefore new 
learners of the language need a better reference for learning about them.

I realize that this is a big request, as you would need some expert to write 
this documentation.

--

___
Python tracker 

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



[issue36913] Missing documentation for decorators

2019-05-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Tomer,

>Thank you for the quick response.
Welcome
>
>Are PEPs considered de-facto documentation for language features? For
>example, string formatting was described in PEP 3101, but still has
>sections in the documentation dedicated to it. I believe that
>decorators should get a similar treatment :-)
Good catch for the string formatting.

For the decorator, it's different because a decorator is mainly a
function taking a function and returning a function.

Example you can write this decorator:

def my_decorator(func):
return func

def my_awesome_function(*args, **kwargs):
print(args)
print(kwargs)

return 42

my_awesome_function = my_decorator(my_awesome_function)

in this case, we don't need to document the decorator.

for the '@' syntax, it's described in the doc but it's syntactic sugar
for the decorator. I don't think we need to add a big description for
that, because everything is described in the PEP.

I would like to have the opinion of the other core-dev. @sizeof?

>
>I also think that describing decorators as part of the grammar
>definition is lacking. Why is there a whole chapter for Errors and
>Exceptions and it's not only discussed under the grammar definition for
>raise?
>
>Decorators are a pretty unique (and cool!) feature of Python, and
>therefore new learners of the language need a better reference for
>learning about them.
>
>I realize that this is a big request, as you would need some expert to
>write this documentation.
You can open a PR ;-)

--

___
Python tracker 

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



[issue36913] Missing documentation for decorators

2019-05-14 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
nosy: +mdk

___
Python tracker 

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



[issue36914] zipimport does not load ZIP files produced by GitHub

2019-05-14 Thread Vadim Kantorov


New submission from Vadim Kantorov :

Python does not like source code zip-files produced by GitHub (zipimporting 
source from GitHub can be useful in some ad-hoc scripting scenarios e.g. I 
wanted to use it in Mozilla Iodide context)

wget https://github.com/python/black/archive/master.zip
python3.7 -m 'import zipimport; zipimport.zipimporter("master.zip")'
# zipimport.ZipImportError: not a Zip file: 'master.zip'

unzip master.zip
zip -r master2.zip black-master
python3.7 -m 'import zipimport; zipimport.zipimporter("master2.zip")'
# OK

--
components: Library (Lib)
messages: 342439
nosy: Vadim Kantorov
priority: normal
severity: normal
status: open
title: zipimport does not load ZIP files produced by GitHub
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



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

2019-05-14 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


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

___
Python tracker 

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



[issue36904] Implement _PyStack_UnpackDict() with a single allocation

2019-05-14 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


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

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-05-14 Thread Inada Naoki


Inada Naoki  added the comment:

$ ./python -m perf compare_to master-mem.json align16-mem.json -G --min-speed=2
Slower (30):
- float: 20.6 MB +- 12.6 kB -> 23.8 MB +- 30.3 kB: 1.16x slower (+16%)
- mako: 14.3 MB +- 760.5 kB -> 15.1 MB +- 54.1 kB: 1.06x slower (+6%)
- xml_etree_iterparse: 11.1 MB +- 11.8 kB -> 11.6 MB +- 22.1 kB: 1.05x slower 
(+5%)
- html5lib: 19.0 MB +- 31.0 kB -> 19.8 MB +- 51.8 kB: 1.04x slower (+4%)
- dulwich_log: 10.9 MB +- 133.1 kB -> 11.3 MB +- 29.1 kB: 1.03x slower (+3%)
- json_dumps: 7907.6 kB +- 6242 bytes -> 8156.0 kB +- 23.9 kB: 1.03x slower 
(+3%)
- sympy_str: 33.5 MB +- 17.5 kB -> 34.5 MB +- 23.2 kB: 1.03x slower (+3%)
- deltablue: 8163.2 kB +- 9220 bytes -> 8391.2 kB +- 15.6 kB: 1.03x slower (+3%)
- pathlib: 8296.0 kB +- 15.0 kB -> 8526.4 kB +- 33.4 kB: 1.03x slower (+3%)
- xml_etree_generate: 11.8 MB +- 87.2 kB -> 12.2 MB +- 108.2 kB: 1.03x slower 
(+3%)
- sympy_expand: 32.7 MB +- 15.1 kB -> 33.6 MB +- 19.9 kB: 1.03x slower (+3%)
- richards: 7081.6 kB +- 16.2 kB -> 7270.8 kB +- 55.2 kB: 1.03x slower (+3%)
- pickle: 7244.4 kB +- 12.1 kB -> 7436.4 kB +- 57.1 kB: 1.03x slower (+3%)
- pickle_pure_python: 7267.2 kB +- 12.2 kB -> 7455.2 kB +- 48.2 kB: 1.03x 
slower (+3%)
- pickle_dict: 7258.8 kB +- 27.6 kB -> 7446.0 kB +- 36.7 kB: 1.03x slower (+3%)
- hexiom: 7168.8 kB +- 25.1 kB -> 7352.8 kB +- 59.8 kB: 1.03x slower (+3%)
- raytrace: 7373.6 kB +- 17.0 kB -> 7562.8 kB +- 44.3 kB: 1.03x slower (+3%)
- pickle_list: 7246.8 kB +- 9067 bytes -> 7431.2 kB +- 60.2 kB: 1.03x slower 
(+3%)
- spectral_norm: 6913.2 kB +- 5127 bytes -> 7087.2 kB +- 39.8 kB: 1.03x slower 
(+3%)
- sympy_integrate: 32.6 MB +- 24.9 kB -> 33.4 MB +- 36.0 kB: 1.02x slower (+2%)
- regex_compile: 8188.4 kB +- 10.9 kB -> 8388.8 kB +- 27.2 kB: 1.02x slower 
(+2%)
- nqueens: 7153.6 kB +- 17.2 kB -> 7328.4 kB +- 38.3 kB: 1.02x slower (+2%)
- sqlalchemy_declarative: 18.1 MB +- 40.9 kB -> 18.5 MB +- 50.0 kB: 1.02x 
slower (+2%)
- django_template: 18.4 MB +- 50.2 kB -> 18.8 MB +- 23.7 kB: 1.02x slower (+2%)
- sympy_sum: 52.1 MB +- 30.8 kB -> 53.4 MB +- 26.7 kB: 1.02x slower (+2%)
- regex_v8: 8208.0 kB +- 11.2 kB -> 8399.2 kB +- 43.2 kB: 1.02x slower (+2%)
- sqlalchemy_imperative: 17.4 MB +- 51.0 kB -> 17.8 MB +- 47.9 kB: 1.02x slower 
(+2%)
- json_loads: 7025.6 kB +- 71.0 kB -> 7173.6 kB +- 9098 bytes: 1.02x slower 
(+2%)
- xml_etree_process: 11.6 MB +- 160.1 kB -> 11.8 MB +- 141.1 kB: 1.02x slower 
(+2%)
- logging_silent: 7275.6 kB +- 37.5 kB -> 7425.2 kB +- 41.9 kB: 1.02x slower 
(+2%)

Faster (1):
- sqlite_synth: 8469.6 kB +- 44.7 kB -> 8197.6 kB +- 44.7 kB: 1.03x faster (-3%)

Benchmark hidden because not significant (26): 2to3, chameleon, chaos, 
crypto_pyaes, fannkuch, go, logging_format, logging_simple, meteor_contest, 
nbody, pidigits, python_startup, python_startup_no_site, regex_dna, 
regex_effbot, scimark_fft, scimark_lu, scimark_monte_carlo, scimark_sor, 
scimark_sparse_mat_mult, telco, unpack_sequence, unpickle, unpickle_list, 
unpickle_pure_python, xml_etree_parse

--

___
Python tracker 

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



[issue36914] zipimport does not load ZIP files produced by GitHub

2019-05-14 Thread SilentGhost


SilentGhost  added the comment:

This is going to be fixed in 3.8 (see #5950).

--
nosy: +SilentGhost
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Make zipimport work with zipfile containing comments

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-05-14 Thread Inada Naoki


Inada Naoki  added the comment:

$ ./python -m perf compare_to master.json align16.json -G --min-speed=1
Slower (13):
- pickle_list: 4.40 us +- 0.03 us -> 4.59 us +- 0.04 us: 1.04x slower (+4%)
- xml_etree_iterparse: 129 ms +- 2 ms -> 133 ms +- 2 ms: 1.04x slower (+4%)
- regex_dna: 201 ms +- 2 ms -> 207 ms +- 2 ms: 1.03x slower (+3%)
- scimark_sparse_mat_mult: 5.75 ms +- 0.01 ms -> 5.90 ms +- 0.05 ms: 1.03x 
slower (+3%)
- float: 147 ms +- 1 ms -> 151 ms +- 1 ms: 1.02x slower (+2%)
- unpickle: 19.0 us +- 0.6 us -> 19.4 us +- 0.7 us: 1.02x slower (+2%)
- nbody: 173 ms +- 1 ms -> 176 ms +- 1 ms: 1.02x slower (+2%)
- pickle: 12.4 us +- 0.1 us -> 12.6 us +- 0.2 us: 1.02x slower (+2%)
- html5lib: 121 ms +- 3 ms -> 123 ms +- 4 ms: 1.02x slower (+2%)
- unpickle_list: 4.88 us +- 0.04 us -> 4.95 us +- 0.12 us: 1.02x slower (+2%)
- xml_etree_process: 107 ms +- 1 ms -> 109 ms +- 1 ms: 1.01x slower (+1%)
- regex_effbot: 3.60 ms +- 0.05 ms -> 3.65 ms +- 0.03 ms: 1.01x slower (+1%)
- xml_etree_parse: 185 ms +- 1 ms -> 187 ms +- 3 ms: 1.01x slower (+1%)

Faster (11):
- nqueens: 134 ms +- 1 ms -> 130 ms +- 1 ms: 1.03x faster (-2%)
- chameleon: 14.4 ms +- 0.2 ms -> 14.1 ms +- 0.1 ms: 1.02x faster (-2%)
- pathlib: 25.7 ms +- 0.3 ms -> 25.3 ms +- 0.2 ms: 1.02x faster (-2%)
- django_template: 170 ms +- 2 ms -> 167 ms +- 3 ms: 1.01x faster (-1%)
- sympy_expand: 549 ms +- 19 ms -> 542 ms +- 8 ms: 1.01x faster (-1%)
- dulwich_log: 90.0 ms +- 0.7 ms -> 88.9 ms +- 0.7 ms: 1.01x faster (-1%)
- richards: 111 ms +- 1 ms -> 110 ms +- 1 ms: 1.01x faster (-1%)
- json_dumps: 16.7 ms +- 0.3 ms -> 16.6 ms +- 0.2 ms: 1.01x faster (-1%)
- fannkuch: 572 ms +- 4 ms -> 566 ms +- 2 ms: 1.01x faster (-1%)
- meteor_contest: 130 ms +- 1 ms -> 129 ms +- 1 ms: 1.01x faster (-1%)
- logging_format: 14.6 us +- 0.2 us -> 14.4 us +- 0.2 us: 1.01x faster (-1%)

Benchmark hidden because not significant (33): 2to3, chaos, crypto_pyaes, 
deltablue, go, hexiom, json_loads, logging_silent, logging_simple, mako, 
pickle_dict, pickle_pure_python, pidigits, python_startup, 
python_startup_no_site, raytrace, regex_compile, regex_v8, scimark_fft, 
scimark_lu, scimark_monte_carlo, scimark_sor, spectral_norm, 
sqlalchemy_declarative, sqlalchemy_imperative, sqlite_synth, sympy_integrate, 
sympy_sum, sympy_str, telco, unpack_sequence, unpickle_pure_python, 
xml_etree_generate

--

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-05-14 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset f0be4bbb9b3cee876249c23f2ae6f38f43fa7495 by Inada Naoki in branch 
'master':
bpo-27987: pymalloc: align by 16bytes on 64bit platform (GH-12850)
https://github.com/python/cpython/commit/f0be4bbb9b3cee876249c23f2ae6f38f43fa7495


--

___
Python tracker 

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



[issue36914] zipimport does not load ZIP files produced by GitHub

2019-05-14 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Seems to work on master branch though fails on 3.7.

➜  cpython git:(master) ✗ ./python.exe
Python 3.8.0a4+ (heads/master:410b85a7f7, May 13 2019, 21:40:37)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import zipimport
>>> zipimport.zipimporter("master.zip")

>>> ^D
➜  cpython git:(master) ✗ python3.7
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 16:52:21)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import zipimport
>>> zipimport.zipimporter("master.zip")
Traceback (most recent call last):
  File "", line 1, in 
zipimport.ZipImportError: not a Zip file: 'master.zip'

➜  cpython git:(996859a90d) ✗ git checkout 
5a5ce064b3baadcb79605c5a42ee3d0aee57cdfc
Previous HEAD position was 996859a90d bpo-34790: [docs] Passing coroutines to 
asyncio.wait() can be confusing. (GH-9543)
HEAD is now at 5a5ce064b3 bpo-5950: Support reading zips with comments in 
zipimport (#9548)
➜  cpython git:(5a5ce064b3) ✗ make regen-importlib -s && make -s > /dev/null
➜  cpython git:(5a5ce064b3) ✗ ./python.exe -c 'import zipimport; 
zipimport.zipimporter("master.zip")'

➜  cpython git:(5a5ce064b3) ✗ git checkout 
5a5ce064b3baadcb79605c5a42ee3d0aee57cdfc~1
Previous HEAD position was 5a5ce064b3 bpo-5950: Support reading zips with 
comments in zipimport (#9548)
HEAD is now at 996859a90d bpo-34790: [docs] Passing coroutines to 
asyncio.wait() can be confusing. (GH-9543)
➜  cpython git:(996859a90d) ✗ make regen-importlib -s && make -s > /dev/null
➜  cpython git:(996859a90d) ✗ ./python.exe -c 'import zipimport; 
zipimport.zipimporter("master.zip")'
Traceback (most recent call last):
  File "", line 89, in __init__
KeyError: 'master.zip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "", line 91, in __init__
  File "", line 366, in _read_directory
zipimport.ZipImportError: not a Zip file: 'master.zip'

Bisecting tells me it could have been fixed with 
5a5ce064b3baadcb79605c5a42ee3d0aee57cdfc (issue5950) in 3.8 . Can you please 
try with a 3.8 release? Download 3.8 alpha 4 : 
https://www.python.org/downloads/release/python-380a4/

--
nosy: +xtreak

___
Python tracker 

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



[issue36656] Allow os.symlink(src, target, force=True) to prevent race conditions

2019-05-14 Thread Tom Hale


Change by Tom Hale :


--
type: security -> enhancement

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-05-14 Thread Stefan Krah


Stefan Krah  added the comment:

+16% for float seems pretty high though.

--

___
Python tracker 

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



[issue36910] Certain Malformed email causes email.parser to throw AttributeError

2019-05-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Mark,

Do you want to submit a PR for this issue?

--
nosy: +matrixise

___
Python tracker 

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



[issue36910] Certain Malformed email causes email.parser to throw AttributeError

2019-05-14 Thread SilentGhost


Change by SilentGhost :


--
stage:  -> needs patch
versions: +Python 3.8 -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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-05-14 Thread Inada Naoki


Inada Naoki  added the comment:

yes.  sys.getsizeof(3.14) is 24.  And it becomes 32 byte in 16byte aligned 
pymalloc. (+33%)

FYI, jemalloc has 8, 16, 32 size classes, but no 24 too.
http://jemalloc.net/jemalloc.3.html#size_classes

--

___
Python tracker 

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



[issue36845] ipaddres.IPv4Network and ipaddress.IPv6Network tuple construction will accept out of valid range prefixlen

2019-05-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13219

___
Python tracker 

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



[issue36845] ipaddres.IPv4Network and ipaddress.IPv6Network tuple construction will accept out of valid range prefixlen

2019-05-14 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 5e48e3db6f5a937023e99d89cef8884d22bd8533 by Inada Naoki (Nicolai 
Moore) in branch 'master':
bpo-36845: validate integer network prefix when constructing IP networks 
(GH-13298)
https://github.com/python/cpython/commit/5e48e3db6f5a937023e99d89cef8884d22bd8533


--
nosy: +inada.naoki

___
Python tracker 

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



[issue23378] argparse.add_argument action parameter should allow value extend

2019-05-14 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue36845] ipaddres.IPv4Network and ipaddress.IPv6Network tuple construction will accept out of valid range prefixlen

2019-05-14 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 30cccf084d1560d9e3382e69d828b3be8cdb0286 by Inada Naoki (Miss 
Islington (bot)) in branch '3.7':
bpo-36845: validate integer network prefix when constructing IP networks 
(GH-13298)
https://github.com/python/cpython/commit/30cccf084d1560d9e3382e69d828b3be8cdb0286


--

___
Python tracker 

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



[issue36845] ipaddres.IPv4Network and ipaddress.IPv6Network tuple construction will accept out of valid range prefixlen

2019-05-14 Thread Inada Naoki


Change by Inada Naoki :


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



[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2019-05-14 Thread Nicolai Moore


Change by Nicolai Moore :


--
pull_requests: +13220

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2019-05-14 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Hi Nathaniel,

Was this something you were still targeting for 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



[issue36915] regrtest: when interrupted, temporary directory is not removed

2019-05-14 Thread STINNER Victor


New submission from STINNER Victor :

I modified regrtest (Python test runner) to kill worker processes using SIGKILL 
when the main process is interrupted by CTRL+C. Problem: nothing clears 
temporary directories created by these worker processes.

I'm working on a fix.

--
components: Tests
messages: 342451
nosy: vstinner
priority: normal
severity: normal
status: open
title: regrtest: when interrupted, temporary directory is not removed
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



[issue36797] Cull more oudated distutils information

2019-05-14 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset dae1229729920e3aa2be015453b7f702dff9b375 by Nick Coghlan in 
branch 'master':
bpo-36797: Prune more legacy distutils documentation (GH-13092)
https://github.com/python/cpython/commit/dae1229729920e3aa2be015453b7f702dff9b375


--

___
Python tracker 

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



[issue32995] Add a glossary entry for context variables

2019-05-14 Thread Cheryl Sabella


Cheryl Sabella  added the comment:


New changeset c0a1a07c7e9814cad79cce3580c16284b2df7f52 by Cheryl Sabella 
(Vinodhini Balusamy) in branch 'master':
bpo-32995 - Added context variable in glossary (GH-9741)
https://github.com/python/cpython/commit/c0a1a07c7e9814cad79cce3580c16284b2df7f52


--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue32995] Add a glossary entry for context variables

2019-05-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13221

___
Python tracker 

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



[issue36719] regrtest --findleaks should fail if an uncollectable object is found

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d8e123a48f1666227abdb90d84c58efe7bb4f3d8 by Victor Stinner (Miss 
Islington (bot)) in branch '3.7':
bpo-36719: Fix regrtest MultiprocessThread (GH-13301) (GH-13303)
https://github.com/python/cpython/commit/d8e123a48f1666227abdb90d84c58efe7bb4f3d8


--

___
Python tracker 

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



[issue36915] regrtest: when interrupted, temporary directory is not removed

2019-05-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue32995] Add a glossary entry for context variables

2019-05-14 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@vinu2003, thank you for the pull request!

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



[issue32995] Add a glossary entry for context variables

2019-05-14 Thread miss-islington


miss-islington  added the comment:


New changeset 8b3823ae16d68cf17ad037e46d7e49d26929a13b by Miss Islington (bot) 
in branch '3.7':
bpo-32995 - Added context variable in glossary (GH-9741)
https://github.com/python/cpython/commit/8b3823ae16d68cf17ad037e46d7e49d26929a13b


--
nosy: +miss-islington

___
Python tracker 

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



[issue36916] Swallow unhandled exception report introduced by 36802

2019-05-14 Thread Andrew Svetlov


New submission from Andrew Svetlov :

In #36802 when old-style writer.write() is used without awaiting and an 
exception is raised from writer.drain() method asyncio reports about the 
unhandled exception.

The proposed fix adds a done callback to task for swallowing the exception in 
such case.

--
messages: 342457
nosy: asvetlov
priority: normal
severity: normal
status: open
title: Swallow unhandled exception report introduced by 36802

___
Python tracker 

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



[issue36916] Swallow unhandled exception report introduced by 36802

2019-05-14 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
components: +Library (Lib), asyncio
nosy: +yselivanov
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



[issue36916] Swallow unhandled exception report introduced by 36802

2019-05-14 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue9584] fnmatch, glob: Allow curly brace expansion

2019-05-14 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

@Matúš Valo, thank you for the pull request and for your interest in 
contributing to CPython.  It seems that consensus hadn't been reached during 
the previous discussion on this issue, which is why msg175217 suggested 
creating a discussion on python-dev.  Most likely, your patch won't be reviewed 
until some more discussion takes place.  Please open a topic on python-dev and 
then link to that topic once the details are hashed out.  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



[issue36790] test_asyncio fails with application verifier!

2019-05-14 Thread sam jonas


sam jonas  added the comment:

Thanks for the solution...

--
nosy: +samjonas

___
Python tracker 

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



[issue36790] test_asyncio fails with application verifier!

2019-05-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

What is "Application Verifier"?
Could you provide an instruction on how to install and run it to reproduce the 
issue?

--

___
Python tracker 

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



[issue36915] regrtest: when interrupted, temporary directory is not removed

2019-05-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13224

___
Python tracker 

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



[issue36915] regrtest: when interrupted, temporary directory is not removed

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3c93153f7db5dd9b06f229e61978fd9199b3c097 by Victor Stinner in 
branch 'master':
bpo-36915: regrtest always remove tempdir of worker processes (GH-13312)
https://github.com/python/cpython/commit/3c93153f7db5dd9b06f229e61978fd9199b3c097


--

___
Python tracker 

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



[issue36870] test_asyncio: test_drain_raises() fails randomly on Windows

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:

Maybe the test started to fail randomly after this change:

commit 1cc0ee7d9f6a2817918fafd24c18d8bb093a85d3
Author: Andrew Svetlov 
Date:   Tue May 7 16:53:19 2019 -0400

bpo-36801: Fix waiting in StreamWriter.drain for closing
SSL transport (GH-13098)

The test is quite old, added in bpo-25441:

commit c44ecdf687897a20f11d0c5212b51e8d31f6100a
Author: Guido van Rossum 
Date:   Mon Oct 19 11:49:30 2015 -0700

Issue #25441: asyncio: Raise error from drain() when socket is closed.

--

___
Python tracker 

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



[issue36917] ast.NodeVisitor no longer calls visit_Str

2019-05-14 Thread Anthony Sottile


New submission from Anthony Sottile :

More fallout from the Constant change in https://bugs.python.org/issue32892

minimal reproduction:


import ast


class V(ast.NodeVisitor):
def visit_Str(self, node):
print(node.s)


def main():
V().visit(ast.parse('x = "hi"'))


if __name__ == '__main__':
exit(main())


$ python3.7 t.py
hi
$ python3.8 t.py
$ python3.8 --version --version
Python 3.8.0a4 (default, May  8 2019, 01:43:53) 
[GCC 7.4.0]

--
components: Library (Lib)
messages: 342463
nosy: Anthony Sottile, serhiy.storchaka
priority: normal
severity: normal
status: open
title: ast.NodeVisitor no longer calls visit_Str
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



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

2019-05-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

With the last 2.7 and 3.7, I can import the x module and the 'hello' is 
automatically printed.

Python 2.7.15 (default, Oct 15 2018, 15:26:09) 
[GCC 8.2.1 20180801 (Red Hat 8.2.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import x
hello


Python 3.7.3 (default, Apr  2 2019, 06:55:20) 
[GCC 8.3.1 20190223 (Red Hat 8.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import x
hello

>>> content = open('x.py').read()
>>> import dis
>>> dis.dis(content)
  1   0 LOAD_NAME0 (print)
  2 LOAD_CONST   0 ('hello')
  4 CALL_FUNCTION1
  6 POP_TOP

  3   8 LOAD_CONST   1 (None)
 10 RETURN_VALUE


but because I am not sure about this issue, I prefer to ask Serhiy.

Can we close it?

Thank you

--
nosy: +matrixise, serhiy.storchaka
versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue3020] doctest should have lib2to3 integration

2019-05-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I move this issue to the last stable 3.7 and master.

--
nosy: +matrixise
versions: +Python 3.7, Python 3.8 -Python 3.2

___
Python tracker 

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



[issue2053] IDLE - standardize dialogs

2019-05-14 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
Python tracker 

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



[issue36910] Certain Malformed email causes email.parser to throw AttributeError

2019-05-14 Thread R. David Murray


R. David Murray  added the comment:

Not a security issue, no.  This isn't C where a stack overflow can give an 
attacker a vector for injecting arbitrary code.

Per the Parser contract ("raise no exceptions, only register defects"), this 
should, as you say, register a defect 
(email.errors.InvalidMultipartContentTransferEncodingDefect) and assume a CTE 
of 7bit for the rest of the parsing.  The problem here is that the feedparser 
is running into the "hack" I put in place in python3.2 for dealing with invalid 
binary data in headers (which is to turn it into a Header with charset 
unknown-8bit).  That works most of the time, but in cases like this it breaks 
down :(

Note that the new API (policy=default and friends) handles this without error.

--

___
Python tracker 

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



[issue36870] test_asyncio: test_drain_raises() fails randomly on Windows

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:

Another candidate:

commit a076e4f5e42b85664693191d04cfb33e2f9acfa5 (refs/bisect/bad) 
Author: Andrew Svetlov 
Date:   Thu May 9 15:14:58 2019 -0400

bpo-36802: Drop awrite()/aclose(), support await write() and await close() 
instead (#13099)

Before this commit, the test pass. After this commit, the test still pass but 
logs a warning:

vstinner@WIN C:\vstinner\python\master>python -m test test_asyncio -m 
test_drain_raises -v
(...)
test_drain_raises (test.test_asyncio.test_streams.StreamTests) ... Task 
exception was never retrieved
future:  
exception=ConnectionAbor
tedError(10053, 'An established connection was aborted by the software in your 
host machine', None, 10053, None)>
Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\asyncio\streams.py", line 434, in drain
await fut
  File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 370, in 
_loop_writing
self._write_fut = self._loop._proactor.send(self._sock, data)
  File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 488, in 
send
ov.WSASend(conn.fileno(), buf, flags)
ConnectionAbortedError: [WinError 10053] An established connection was aborted 
by the software in your host machine
ok
(...)
Tests result: SUCCESS

--

___
Python tracker 

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



[issue2897] Deprecate structmember.h

2019-05-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I move this issue to master (3.8)

--
nosy: +matrixise, vstinner
versions: +Python 3.8 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue34424] Unicode names break email header

2019-05-14 Thread R. David Murray


R. David Murray  added the comment:

Thank you.  I don't believe this is a security issue.

--

___
Python tracker 

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



[issue32892] Remove specific constant AST types in favor of ast.Constant

2019-05-14 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



[issue36917] ast.NodeVisitor no longer calls visit_Str

2019-05-14 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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13225

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:

I backported the fix from Python 3.7 to Python 2.7: PR 13315.

Please review it carefully, I had to make multiple changes to adapt the fix to 
Python 2:

* non-ASCII characters are explicitly rejected
* urllib doesn't reject control characters: they are quoted properly, so I 
addapted test_urllib
* urllib2 doesn't quote the URL and so reject control characters, I added tests 
to test_urllib2
* I replaced http.client with httplib
* I replaced urllib.request with urllib or urllib2

--

___
Python tracker 

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



[issue36802] Revert back StreamWriter awrite/aclose but provide await writer.write() and await writer.close()

2019-05-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13226

___
Python tracker 

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



[issue3620] test_smtplib is flaky

2019-05-14 Thread SilentGhost


Change by SilentGhost :


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

___
Python tracker 

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



[issue36802] Revert back StreamWriter awrite/aclose but provide await writer.write() and await writer.close()

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like the commit a076e4f5e42b85664693191d04cfb33e2f9acfa5 introduced a 
regression: bpo-36870, test_drain_raises() of test_asyncio started to fail 
randomly, mostly on Windows. bpo-36870 is making AppVeyor failing on pull 
requests and make Windows buildbots fail randomly. I wrote PR 13316 to revert 
the commit to get more time to find a proper fix.
https://pythondev.readthedocs.io/ci.html#revert-on-fail

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

___
Python tracker 

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



[issue36870] test_asyncio: test_drain_raises() fails randomly on Windows

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 13316 to revert the commit a076e4f5e42b85664693191d04cfb33e2f9acfa5 
of bpo-36802:
https://bugs.python.org/issue36802#msg342471

--

___
Python tracker 

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



[issue36915] regrtest: when interrupted, temporary directory is not removed

2019-05-14 Thread miss-islington


miss-islington  added the comment:


New changeset ecd668d6d99ff03166427f02347454cfdf904a6c by Miss Islington (bot) 
in branch '3.7':
bpo-36915: regrtest always remove tempdir of worker processes (GH-13312)
https://github.com/python/cpython/commit/ecd668d6d99ff03166427f02347454cfdf904a6c


--
nosy: +miss-islington

___
Python tracker 

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



[issue36917] ast.NodeVisitor no longer calls visit_Str

2019-05-14 Thread Anthony Sottile


Anthony Sottile  added the comment:

wrong bpo, this is the right one: https://bugs.python.org/issue32892

--

___
Python tracker 

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



[issue36915] regrtest: when interrupted, temporary directory is not removed

2019-05-14 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



[issue32177] spammers mine emails from bugs.python.org

2019-05-14 Thread SilentGhost


SilentGhost  added the comment:

Meta tracker hasn't been available for a while but the issues can be reported 
at https://github.com/python/bugs.python.org/issues

--
nosy: +SilentGhost
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type: security -> 

___
Python tracker 

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



[issue36870] test_asyncio: test_drain_raises() fails randomly on Windows

2019-05-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Please postpone the reversion for a while.
I think #36916 fixes a message about the never retrieved exception.

--

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-05-14 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi, I have been looking to get more acquainted with the peephole optimizer. Is 
it okay if I work on this?

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue36900] Use _PyCoreConfig rather than global configuration variables

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c96be811fa7da8ddcea18cc7abcae94e0f5ff966 by Victor Stinner in 
branch 'master':
bpo-36900: Replace global conf vars with config (GH-13299)
https://github.com/python/cpython/commit/c96be811fa7da8ddcea18cc7abcae94e0f5ff966


--

___
Python tracker 

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



[issue36900] Use _PyCoreConfig rather than global configuration variables

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:

There are a few remaining usage of these global configuration variables, but it 
will be tricky to remove them:
https://bugs.python.org/issue36900#msg342398

I consider that I'm done on this topic, so I close the issue.

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



[issue36910] Certain Malformed email causes email.parser to throw AttributeError

2019-05-14 Thread Mark Sapiro


Mark Sapiro  added the comment:

I do intend to submit a PR. I haven't yet worked it out though.

--

___
Python tracker 

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



[issue18478] Class bodies: when does a name become local?

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests:  -13227

___
Python tracker 

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



[issue18478] Class bodies: when does a name become local?

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +13227

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +13228

___
Python tracker 

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



[issue36916] Swallow unhandled exception report introduced by 36802

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f12ba7cd0a7370631214ac0b337ab5455ce717b2 by Victor Stinner 
(Andrew Svetlov) in branch 'master':
bpo-36916: asyncio: Swallow unhandled write() exception (GH-13313)
https://github.com/python/cpython/commit/f12ba7cd0a7370631214ac0b337ab5455ce717b2


--
nosy: +vstinner

___
Python tracker 

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



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

2019-05-14 Thread STINNER Victor


Change by STINNER Victor :


--
title: CLI option to make PyErr_WriteUnraisable abort the current process -> 
Add sys.unraisablehook() to custom how "unraisable exceptions" are logged

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-05-14 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I was wrong so removing the close call when io_refs gets to zero causes error 
on test_urllib2 [0] where close is asserted to be True and I only tested 
test_urllib initially. One another way would be to check for fp.closed in 
http.client before flushing but as mentioned before I am not sure of the 
attribute being always present and also to modify http.client code just for 
tests.

[0] 
https://github.com/python/cpython/blob/f12ba7cd0a7370631214ac0b337ab5455ce717b2/Lib/test/test_urllib2.py#L1685

--

___
Python tracker 

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



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

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:

I'm interested to modify regrtest (test runner of the Python test suite) to use 
sys.unraisablehook(). It would be nice to add an option to display again *all* 
unraisable exceptions in the test summary, at the end.

I did a similar experimentation for any warnings, so my implementation was 
fragile because regrtest was hard to extend. That's why I introduced a new 
TestResult type: to be able to add more fields without breaking all the code. 
Prevously, a test result was a tuple which was manually unpacked. So adding a 
new field could break code which wasn't updated to handle new fields.

--

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:

Karthikeyan Singaravelan: Would you mind to open a separated issue for 
test_urllib warnings?

--

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-05-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13229

___
Python tracker 

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



[issue3020] doctest should have lib2to3 integration

2019-05-14 Thread Stefan Behnel


Stefan Behnel  added the comment:

I'm closing this old ticket. Python 2 will be dead by the time someone gets 
around to do something about it.

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

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2019-05-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13230

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-05-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13231

___
Python tracker 

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



[issue32892] Remove specific constant AST types in favor of ast.Constant

2019-05-14 Thread Anthony Sottile


Anthony Sottile  added the comment:

hitting this in https://bugs.python.org/issue36917?

Is the simplification here really worth the breaking change to consumers?

I now have to write something that's essentially this to work around this which 
feels more like the complexity has just been pushed to users instead of the 
stdlib:


def visit_Constant(self, node):
if isinstance(node.value, str):
self.visit_Str(node)
elif isinstance(node.value, bytes):
self.visit_Bytes(node)
elif node.value in {True, False}:
self.visit_NameConstant(node)
elif node.value is Ellipsis:
self.visit_Ellipsis(node)
elif isinstance(node.value, (int, float)):
self.visit_Num(node)
else:
# etc...

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue33529] [security] Infinite loop on folding email (_fold_as_ew()) if an header has no spaces

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c1f5667be1e3ec5871560c677402c1252c6018a6 by Victor Stinner 
(Krzysztof Wojcik) in branch 'master':
bpo-33529, email: Fix infinite loop in email header encoding (GH-12020)
https://github.com/python/cpython/commit/c1f5667be1e3ec5871560c677402c1252c6018a6


--

___
Python tracker 

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



[issue33529] [security] Infinite loop on folding email (_fold_as_ew()) if an header has no spaces

2019-05-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13232

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-05-14 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I'd say go for it.  We can't guarantee we'll accept the feature yet, but I 
think the .dedent() method with an optimization pass approach is worthwhile 
making a proof of concept of regardless.

--

___
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-14 Thread Steve Dower


Steve Dower  added the comment:

This PR has stalled because of errors raised by TLS 1.3

It seems that there may be a difference between sockets on Windows being 
non-blocking by default and other platforms being blocking by default. However, 
we think that is probably just causes TLS 1.3/OpenSSL 1.1.1b errors to show up 
in different places.

Has anyone figured out the TLS 1.3 issues yet?

Also, does anyone know why we default to different sockets on Windows?

--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d97adfb409290a1e4ad549e4af58cacea86d3358 by Victor Stinner in 
branch 'master':
bpo-36618: Don't add -fmax-type-align=8 flag for clang (GH-13320)
https://github.com/python/cpython/commit/d97adfb409290a1e4ad549e4af58cacea86d3358


--

___
Python tracker 

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



[issue36618] clang expects memory aligned on 16 bytes, but pymalloc aligns to 8 bytes

2019-05-14 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.8 now respects the x86-64 ABI: https://bugs.python.org/issue27987

I reverted my workaround.

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



[issue36760] subprocess.run fails with capture_output=True and stderr=STDOUT

2019-05-14 Thread Gregory P. Smith


Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue36760] subprocess.run fails with capture_output=True and stderr=STDOUT

2019-05-14 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
components: +Documentation -Library (Lib)
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



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

2019-05-14 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Issue for https://bugs.python.org/issue18748#msg340059.

comment : 

Is there someone interested to debug remaining "Exception ignored:" logs in 
test_urllib?

test_invalid_redirect (test.test_urllib.urlopen_HttpTests) ...
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
ok

test_read_bogus (test.test_urllib.urlopen_HttpTests) ...
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
ok

test_redirect_limit_independent (test.test_urllib.urlopen_HttpTests) ...
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 402, in 
close
super().close() # set "closed" flag
  File "/home/vstinner/prog/python/master/Lib/http/client.py", line 415, in 
flush
self.fp.flush()
ValueError: I/O operation on closed file.
ok


It's unclear to be if it's a bug in http.client, a bug in the test... or 
something else.

--
components: Tests
messages: 342492
nosy: vstinner, xtreak
priority: normal
severity: normal
status: open
title: ValueError warning in test_urllib due to io.IOBase destructor
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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-05-14 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Okay, opened issue36918 . Raising PR against that issue.

--

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests:  -13228

___
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-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue18748] io.IOBase destructor silence I/O error on close() by default

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +13234

___
Python tracker 

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



[issue18478] Class bodies: when does a name become local?

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +13235

___
Python tracker 

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



[issue18478] Class bodies: when does a name become local?

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests:  -13235

___
Python tracker 

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



[issue36917] ast.NodeVisitor no longer calls visit_Str

2019-05-14 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Would it be useful to add a default implementation of `visit_Constant(self, 
node)` on NodeVisitor that go through all the isinstance() check and call the 
appropriate backward compatible method ? 

We would still have the simplification without having any breakage in backward 
compatibility. 

That feels like best of both worlds ?

--

___
Python tracker 

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



[issue1616] compiler warnings

2019-05-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Because this issue is very long and we stopped to use the version 2.x of Gcc, 
and migrated to a newer verson, I close this issue. Feel free to re-open it in 
the future or fill a new issue.

--
nosy: +matrixise
resolution:  -> out of date
stage: needs patch -> 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



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

2019-05-14 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +13237

___
Python tracker 

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



  1   2   >