[issue44561] Some expired hyperlinks in Python documentation

2021-07-18 Thread Steven Hsu


Steven Hsu  added the comment:

Thanks for reminding.
In the beginning, I didn't add a NEWS entry in the PR (#27032).

However, after 11 days when there was no progress of the PR, I doubted that 
maybe I missed something, so I made a NEWS entry to make sure.

And soon after the NEWS entry was added, the PR was processed quickly.

Anyway, it's a interesting experience for me, and thanks again!

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



[issue44561] Some expired hyperlinks in Python documentation

2021-07-18 Thread Éric Araujo

Éric Araujo  added the comment:

This can be closed.  Thanks for the patch!

For next time, such small doc fixes don’t need a NEWS entry.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue44668] More differences in instance and subclass checks between typing.Union and types.Union

2021-07-18 Thread Guido van Rossum


Guido van Rossum  added the comment:

This seems a low-priority issue to me. The code is invalid, but I don't think 
it's very important to raise an exception (typing.Union is also inconsistent). 
Static type checkers will flag all these as errors. (Or perhaps none of them? 
It may depend on the meaning of T in the current scope.)

--

___
Python tracker 

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



[issue44554] pdb.main is unnecessarily complicated

2021-07-18 Thread miss-islington


miss-islington  added the comment:


New changeset 2c2055884420f22afb4d2045bbdab7aa1394cb63 by Jason R. Coombs in 
branch 'main':
bpo-44554: refactor pdb targets (and internal tweaks) (GH-26992)
https://github.com/python/cpython/commit/2c2055884420f22afb4d2045bbdab7aa1394cb63


--
nosy: +miss-islington

___
Python tracker 

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



[issue43086] Excess data in not handled properly in binascii.a2b_base64()

2021-07-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I've merged Idan's PR adding a strict_mode parameter to a2b_base64.  It 
defaults to False for backwards compatibility.

>From a security perspective, it'd be _ideal_ if this were True.  But I expect 
>doing that would break a bunch of existing code and tests that has been 
>relying on some of the former leniency behaviors so I recommended the 
>conservative approach of the old-behavior default.  It'd be a good thing to 
>change it to True, but disruptive.  We need motivating reason to do that.

As it is a new feature due to the new parameter, this is for 3.11.

Workaround for Pythons without this: do a validity check before calling 
a2b_base64.  I suspect a regex could be constructed for that if you're careful. 
 If you come up with one, please share it here.

--
components: +Extension Modules
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue43086] Excess data in not handled properly in binascii.a2b_base64()

2021-07-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 35b98e38b6edd63153fc8e092f94cb20725dacc1 by Idan Moral in branch 
'main':
bpo-43086: Add handling for out-of-spec data in a2b_base64 (GH-24402)
https://github.com/python/cpython/commit/35b98e38b6edd63153fc8e092f94cb20725dacc1


--

___
Python tracker 

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



[issue44561] Some expired hyperlinks in Python documentation

2021-07-18 Thread miss-islington


miss-islington  added the comment:


New changeset 2f643b1a8cd53f3c2f49f931bc98990a3b400495 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-44561: Update hyperlinks in Doc/distributing/index.rst (GH-27032) 
(GH-27233)
https://github.com/python/cpython/commit/2f643b1a8cd53f3c2f49f931bc98990a3b400495


--

___
Python tracker 

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



[issue44561] Some expired hyperlinks in Python documentation

2021-07-18 Thread miss-islington


miss-islington  added the comment:


New changeset bce2847169e181ae894b323b9d5c31b0a3bec621 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-44561: Update hyperlinks in Doc/distributing/index.rst (GH-27032) 
(GH-27234)
https://github.com/python/cpython/commit/bce2847169e181ae894b323b9d5c31b0a3bec621


--

___
Python tracker 

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



[issue44663] Possible bug in datetime utc

2021-07-18 Thread Tim Peters

Tim Peters  added the comment:

If you want to pursue changing what utcnow() does, python-ideas or python-dev 
would probably need to be involved. Backward-incompatible changes are very hard 
sells.

As Paul Ganssle noted here,

https://blog.ganssle.io/articles/2019/11/utcnow.html

in Python 2, naïve datetimes generally did _not_ get treated as "being in local 
time", ever. They refused to pretend they had any opinion about time zone, and 
operations like .timestamp() (just "like", because .timestamp() didn't exist in 
Python 2) raised an exception when applied to a naïve datetime.

Which, IMO, Python 3 should have stuck with. "Naïve time" was never intended to 
be a synonym for "local time" - or for UTC time - or for any other 
timezone-aware notion of time.

But as Paul also said, if Python 2 had concrete tzinfo classes to begin with, 
it's a pretty safe bet `utcnow()` would never have existed.

--

___
Python tracker 

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



[issue44561] Some expired hyperlinks in Python documentation

2021-07-18 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +25781
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/27233

___
Python tracker 

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



[issue44561] Some expired hyperlinks in Python documentation

2021-07-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25782
pull_request: https://github.com/python/cpython/pull/27234

___
Python tracker 

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



[issue44561] Some expired hyperlinks in Python documentation

2021-07-18 Thread Nick Coghlan


Change by Nick Coghlan :


--
stage: patch review -> backport needed

___
Python tracker 

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



[issue44561] Some expired hyperlinks in Python documentation

2021-07-18 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset b494685b2548489efcc66993cc6c13b027ce3b26 by Steven Hsu in branch 
'main':
bpo-44561: Update hyperlinks in Doc/distributing/index.rst (#27032)
https://github.com/python/cpython/commit/b494685b2548489efcc66993cc6c13b027ce3b26


--
nosy: +ncoghlan

___
Python tracker 

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



[issue44340] Add support for building cpython with clang thin lto

2021-07-18 Thread Dong-hee Na


Dong-hee Na  added the comment:

clang version 11.0.0

--

___
Python tracker 

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



[issue44340] Add support for building cpython with clang thin lto

2021-07-18 Thread Dong-hee Na


Dong-hee Na  added the comment:

The test is executed under the following environments.
There is no significant performance changed.

MS Azure: D8s v3
CentOS Linux release 8.2.2004 (Core)


[corona10@PythonLinux cpython]$ ./python -m pyperformance compare full.json 
thin.json
full.json
=

Performance version: 1.0.2
Report on Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.28
Number of logical CPUs: 8
Start date: 2021-07-18 23:18:04.644067
End date: 2021-07-18 23:44:20.951457

thin.json
=

Performance version: 1.0.2
Report on Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.28
Number of logical CPUs: 8
Start date: 2021-07-18 22:46:00.717563
End date: 2021-07-18 23:12:19.376766

### 2to3 ###
Mean +- std dev: 570 ms +- 17 ms -> 568 ms +- 20 ms: 1.00x faster
Not significant

### chameleon ###
Mean +- std dev: 16.9 ms +- 0.6 ms -> 16.9 ms +- 0.9 ms: 1.00x slower
Not significant

### chaos ###
Mean +- std dev: 182 ms +- 7 ms -> 179 ms +- 7 ms: 1.02x faster
Not significant

### crypto_pyaes ###
Mean +- std dev: 198 ms +- 6 ms -> 192 ms +- 6 ms: 1.03x faster
Significant (t=5.26)

### deltablue ###
Mean +- std dev: 13.4 ms +- 0.5 ms -> 13.5 ms +- 0.5 ms: 1.01x slower
Not significant

### django_template ###
Mean +- std dev: 94.0 ms +- 3.2 ms -> 91.8 ms +- 3.7 ms: 1.02x faster
Significant (t=3.53)

### dulwich_log ###
Mean +- std dev: 178 ms +- 6 ms -> 176 ms +- 8 ms: 1.02x faster
Not significant

### fannkuch ###
Mean +- std dev: 764 ms +- 17 ms -> 755 ms +- 15 ms: 1.01x faster
Not significant

### float ###
Mean +- std dev: 194 ms +- 8 ms -> 187 ms +- 6 ms: 1.03x faster
Significant (t=4.95)

### go ###
Mean +- std dev: 388 ms +- 14 ms -> 387 ms +- 14 ms: 1.00x faster
Not significant

### hexiom ###
Mean +- std dev: 17.0 ms +- 0.7 ms -> 17.5 ms +- 0.8 ms: 1.03x slower
Significant (t=-3.40)

### json_dumps ###
Mean +- std dev: 22.5 ms +- 0.9 ms -> 22.3 ms +- 0.7 ms: 1.01x faster
Not significant

### json_loads ###
Mean +- std dev: 45.8 us +- 2.3 us -> 46.5 us +- 1.8 us: 1.02x slower
Not significant

### logging_format ###
Mean +- std dev: 19.1 us +- 0.9 us -> 18.7 us +- 0.7 us: 1.02x faster
Not significant

### logging_silent ###
Mean +- std dev: 336 ns +- 17 ns -> 334 ns +- 18 ns: 1.00x faster
Not significant

### logging_simple ###
Mean +- std dev: 17.1 us +- 0.8 us -> 16.7 us +- 0.8 us: 1.03x faster
Significant (t=3.12)

### mako ###
Mean +- std dev: 27.6 ms +- 1.6 ms -> 26.6 ms +- 0.9 ms: 1.04x faster
Significant (t=4.11)

### meteor_contest ###
Mean +- std dev: 172 ms +- 5 ms -> 169 ms +- 5 ms: 1.01x faster
Not significant

### nbody ###
Mean +- std dev: 232 ms +- 8 ms -> 224 ms +- 8 ms: 1.04x faster
Significant (t=6.03)

### nqueens ###
Mean +- std dev: 167 ms +- 7 ms -> 166 ms +- 7 ms: 1.00x faster
Not significant

### pathlib ###
Mean +- std dev: 38.2 ms +- 1.7 ms -> 37.4 ms +- 1.9 ms: 1.02x faster
Significant (t=2.41)

### pickle ###
Mean +- std dev: 19.4 us +- 0.8 us -> 19.5 us +- 0.8 us: 1.00x slower
Not significant

### pickle_dict ###
Mean +- std dev: 43.5 us +- 1.9 us -> 43.0 us +- 1.9 us: 1.01x faster
Not significant

### pickle_list ###
Mean +- std dev: 6.81 us +- 0.26 us -> 6.81 us +- 0.27 us: 1.00x slower
Not significant

### pickle_pure_python ###
Mean +- std dev: 840 us +- 28 us -> 825 us +- 28 us: 1.02x faster
Not significant

### pidigits ###
Mean +- std dev: 294 ms +- 9 ms -> 294 ms +- 9 ms: 1.00x slower
Not significant

### pyflate ###
Mean +- std dev: 1.17 sec +- 0.02 sec -> 1.16 sec +- 0.03 sec: 1.01x faster
Not significant

### python_startup ###
Mean +- std dev: 15.3 ms +- 0.6 ms -> 15.3 ms +- 0.6 ms: 1.00x faster
Not significant

### python_startup_no_site ###
Mean +- std dev: 10.3 ms +- 0.3 ms -> 10.2 ms +- 0.4 ms: 1.01x faster
Not significant

### raytrace ###
Mean +- std dev: 911 ms +- 19 ms -> 911 ms +- 21 ms: 1.00x faster
Not significant

### regex_compile ###
Mean +- std dev: 314 ms +- 12 ms -> 310 ms +- 10 ms: 1.01x faster
Not significant

### regex_dna ###
Mean +- std dev: 317 ms +- 10 ms -> 299 ms +- 9 ms: 1.06x faster
Significant (t=9.99)

### regex_effbot ###
Mean +- std dev: 6.20 ms +- 0.27 ms -> 5.80 ms +- 0.25 ms: 1.07x faster
Significant (t=8.49)

### regex_v8 ###
Mean +- std dev: 43.0 ms +- 1.3 ms -> 39.9 ms +- 1.9 ms: 1.08x faster
Significant (t=10.22)

### richards ###
Mean +- std dev: 158 ms +- 8 ms -> 157 ms +- 8 ms: 1.01x faster
Not significant

### scimark_fft ###
Mean +- std dev: 727 ms +- 18 ms -> 716 ms +- 18 ms: 1.02x faster
Not significant

### scimark_lu ###
Mean +- std dev: 309 ms +- 11 ms -> 304 ms +- 10 ms: 1.01x faster
Not significant

### scimark_monte_carlo ###
Mean +- std dev: 180 ms +- 6 ms -> 181 ms +- 8 ms: 1.00x slower
Not significant

### scimark_sor ###
Mean +- std dev: 355 ms +- 9 ms -> 352 ms +- 11 ms: 1.01x faster
Not significant

### scimark_sparse_mat_mult ###
Mean +- std dev: 9.51 ms +- 0.32 ms -> 9.19 ms +- 0.34 ms: 1.03x faster
Significant (t=5.27)

### spectral_norm ###
Mean +- std dev: 277 ms +- 10 ms -> 272 

[issue44340] Add support for building cpython with clang thin lto

2021-07-18 Thread Dong-hee Na


Dong-hee Na  added the comment:

FYI, Thin LTO shows enhanced build time.


Full LTO (./configure --with-lto=full CC=clang)
real2m33.740s
user8m25.695s
sys 0m13.124s

Thin LTO (./configure --with-lto=thin CC=clang)
real1m51.867s
user12m53.694s
sys 0m12.786s

--

___
Python tracker 

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



[issue22240] argparse support for "python -m module" in help

2021-07-18 Thread Nils Kattenbeck


Nils Kattenbeck  added the comment:

I am not sure if the patch correctly handles calling a nested module (e.g. 
`python3 -m serial.tools.miniterm`). Would it also be possible to detect if 
python or python3 was used for the invocation?

--
nosy: +Nils Kattenbeck

___
Python tracker 

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



[issue44670] bug on showing tuple on console

2021-07-18 Thread Zachary Ware


Zachary Ware  added the comment:

As Dennis said, this isn't a bug. Try printing `b` and `c` as well, and you'll 
find 3 and 4.

--
nosy: +zach.ware
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue44670] bug on showing tuple on console

2021-07-18 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I don't know what behavior you were expecting, but *args means "the rest of the 
positional arguments", not "all of the positional arguments."

See 
https://docs.python.org/3/tutorial/controlflow.html?highlight=variadic#arbitrary-argument-lists

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue44671] Create a built-in yaml module

2021-07-18 Thread Jarrod Price

New submission from Jarrod Price :

Would it be possible for someone to take the time to create a built-in yaml 
module based on the current spec (v1.2) ?

https://yaml.org/spec/1.2/spec.html

Just like how we can do `import json`, there is currently no `import yaml`.

I myself (and I assume others too) would much prefer to be able to 
create/save/load/edit yaml as if it were a dictionary.

I am one of those guys that don’t really like to install external modules and I 
much prefer to just use the batteries included modules.

--
messages: 397761
nosy: jarpri08
priority: normal
severity: normal
status: open
title: Create a built-in yaml module
type: enhancement

___
Python tracker 

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



[issue42095] plistlib: Add tests that compare with plutil(1)

2021-07-18 Thread Hasan


Hasan  added the comment:

You are welcome!
Thanks for accepting

--

___
Python tracker 

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



[issue44670] bug on showing tuple on console

2021-07-18 Thread Toby Spooner


New submission from Toby Spooner :

def func(a,b,c , *args , **kwargs):
print(a)
print(args)
print(kwargs)

func(2,3,4,5,Carlson=240,Shehroz="maladiss")

# print(args) showing (5,). NEED TO FIX. python 3.9.6

--
components: Interpreter Core
files: abc.png
messages: 397759
nosy: kwutge
priority: normal
severity: normal
status: open
title: bug on showing tuple on console
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50158/abc.png

___
Python tracker 

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



[issue44669] TypeError: 'type' object is not subscriptable

2021-07-18 Thread Michal D.


New submission from Michal D. :

While attempting to run an application with was working before I had updated 
Python to the version 3.9, I had recieved following error message:


`
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized

Traceback (most recent call last):

  File "/usr/lib/python3.9/site.py", line 79, in 
import os
  File "/usr/lib/python3.9/os.py", line 29, in 
from _collections_abc import _check_methods
  File "/usr/lib/python3.9/_collections_abc.py", line 12, in 
GenericAlias = type(list[int])

TypeError: 'type' object is not subscriptable


`

Any workarounds for this ?


OS: Debian 10 (64-bit)

--
messages: 397758
nosy: michal.dziczkowski
priority: normal
severity: normal
status: open
title: TypeError: 'type' object is not subscriptable
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue44668] More differences in instance and subclass checks between typing.Union and types.Union

2021-07-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Library (Lib)
type:  -> behavior
versions: +Python 3.10, Python 3.11

___
Python tracker 

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



[issue44668] More differences in instance and subclass checks between typing.Union and types.Union

2021-07-18 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

1. Checks for types.Union ignore any non-type args. Checks for typing.Union 
require fail on first checked non-type (but it can short circuit).

>>> import typing
>>> T = typing.TypeVar('T')
>>> issubclass(int, int | T | str)
True
>>> issubclass(int, str | T | int)
True
>>> issubclass(int, typing.Union[int, T, str])
True
>>> issubclass(int, typing.Union[str, T, int])
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/typing.py", line 1208, in __subclasscheck__
if issubclass(cls, arg):
   
TypeError: issubclass() arg 2 must be a class, a tuple of classes, or a union.
>>> isinstance(1, int | T | str)
True
>>> isinstance(1, str | T | int)
True
>>> isinstance(1, typing.Union[int, T, str])
True
>>> isinstance(1, typing.Union[str, T, int])
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/typing.py", line 1204, in __instancecheck__
return self.__subclasscheck__(type(obj))
   ^
  File "/home/serhiy/py/cpython/Lib/typing.py", line 1208, in __subclasscheck__
if issubclass(cls, arg):
   
TypeError: issubclass() arg 2 must be a class, a tuple of classes, or a union.

2. __instancecheck__ of typing.Union uses __subclasscheck__ of args instead of 
__instancecheck__. In normal cases the result should be the same, but there 
should be a reason of having two different special methods.

--
messages: 397757
nosy: gvanrossum, kj, serhiy.storchaka
priority: normal
severity: normal
status: open
title: More differences in instance and subclass checks between typing.Union 
and types.Union

___
Python tracker 

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



[issue44600] match/case statements trace incorrectly in 3.10.0b4

2021-07-18 Thread Brandt Bucher

Brandt Bucher  added the comment:

Yeah, this is actively being worked on. Thanks for asking.

If anything changes, I’ll let you know and you can pick it up then!

--

___
Python tracker 

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



[issue44340] Add support for building cpython with clang thin lto

2021-07-18 Thread Dong-hee Na


Change by Dong-hee Na :


--
versions: +Python 3.11

___
Python tracker 

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



[issue44340] Add support for building cpython with clang thin lto

2021-07-18 Thread Dong-hee Na


Dong-hee Na  added the comment:

I am now building the experiment environment to compare between thin-lto and 
full-lto

--

___
Python tracker 

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



[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +25780
pull_request: https://github.com/python/cpython/pull/27232

___
Python tracker 

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



[issue42355] symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all

2021-07-18 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
type: security -> behavior

___
Python tracker 

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



[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests:  -25757

___
Python tracker 

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



[issue44340] Add support for building cpython with clang thin lto

2021-07-18 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +25779
pull_request: https://github.com/python/cpython/pull/27231

___
Python tracker 

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



[issue42355] symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all

2021-07-18 Thread Ali mazloum


Change by Ali mazloum :


--
type:  -> security

___
Python tracker 

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



[issue44654] Refactor and clean up the union type implementation

2021-07-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue44654] Refactor and clean up the union type implementation

2021-07-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a6670cdf77aab2b1ee7be0b9df060dcac2a2dc48 by Serhiy Storchaka in 
branch '3.10':
[3.10] bpo-44654: Do not export the union type related symbols (GH-27223). 
(GH-27225)
https://github.com/python/cpython/commit/a6670cdf77aab2b1ee7be0b9df060dcac2a2dc48


--

___
Python tracker 

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



[issue44025] Match doc: Clarify '_' as a soft keyword

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -25773

___
Python tracker 

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



[issue44018] random.seed mutates input bytearray

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -25770

___
Python tracker 

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



[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -25772

___
Python tracker 

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



[issue43822] Improve syntax errors for missing commas

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -25769

___
Python tracker 

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



[issue40297] test_socket.CANTest is broken at HEAD on master

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -25776

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -25771

___
Python tracker 

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



[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -25775

___
Python tracker 

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



[issue32822] finally block doesn't re-raise exception if return statement exists inside

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -25774

___
Python tracker 

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



[issue35753] Importing call from unittest.mock directly causes ValueError

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -25778

___
Python tracker 

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



[issue44040] Update broken link in pathlib source

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests:  -25777

___
Python tracker 

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



[issue35753] Importing call from unittest.mock directly causes ValueError

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +25778
pull_request: https://github.com/python/cpython/pull/27228

___
Python tracker 

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



[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 10.0 -> 11.0
pull_requests: +25775
pull_request: https://github.com/python/cpython/pull/27228

___
Python tracker 

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



[issue44040] Update broken link in pathlib source

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 4.0 -> 5.0
pull_requests: +25777
pull_request: https://github.com/python/cpython/pull/27228

___
Python tracker 

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



[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 8.0 -> 9.0
pull_requests: +25772
pull_request: https://github.com/python/cpython/pull/27228

___
Python tracker 

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



[issue44018] random.seed mutates input bytearray

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 6.0 -> 7.0
pull_requests: +25770
pull_request: https://github.com/python/cpython/pull/27228

___
Python tracker 

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



[issue40297] test_socket.CANTest is broken at HEAD on master

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 5.0 -> 6.0
pull_requests: +25776
pull_request: https://github.com/python/cpython/pull/27228

___
Python tracker 

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



[issue32822] finally block doesn't re-raise exception if return statement exists inside

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 7.0 -> 8.0
pull_requests: +25774
pull_request: https://github.com/python/cpython/pull/27228

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 4.0 -> 5.0
pull_requests: +25771
pull_request: https://github.com/python/cpython/pull/27228

___
Python tracker 

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



[issue43822] Improve syntax errors for missing commas

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +25769
pull_request: https://github.com/python/cpython/pull/27228

___
Python tracker 

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



[issue44025] Match doc: Clarify '_' as a soft keyword

2021-07-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
nosy_count: 7.0 -> 8.0
pull_requests: +25773
pull_request: https://github.com/python/cpython/pull/27228

___
Python tracker 

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



[issue44663] Possible bug in datetime utc

2021-07-18 Thread Paul Martin


Paul Martin  added the comment:

The difference between the two is the difference between your local time and 
utc.

datetime.now(timezone.utc)

This returns the current time in utc and is timezone aware. So the timestamp 
can figure out the seconds since epoch taking into account the timezone.


datetime.utcnow()

Returns the current utc time but is not timezone aware. When timestamp  method 
is run, it is interpreted as a local timestamp.

This is explained in the docs but perhaps it should be made clearer that
datetime.utcnow().timestamp() is incorrect and would cause bugs. 

I'm not sure about changing the behaviour of utcnow to return a timezone-aware 
dt as is it could cause hard to detect bugs in existing code. But I did have 
issues recently where I was using utcnow until I went back and read the docs 
and changed to datetime.now(timezone.utc). So it's probably a common trap to 
fall into.

>From the docs:

"
Naive datetime instances are assumed to represent local time #

Note There is no method to obtain the POSIX timestamp directly from a naive 
datetime instance representing UTC time. If your application uses this 
convention and your system timezone is not set to UTC, you can obtain the POSIX 
timestamp by supplying tzinfo=timezone.utc:
timestamp = dt.replace(tzinfo=timezone.utc).timestamp()
or by calculating the timestamp directly:

timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)"


Warning Because naive datetime objects are treated by many datetime methods as 
local times, it is preferred to use aware datetimes to represent times in UTC. 
As such, the recommended way to create an object representing the current time 
in UTC is by calling datetime.now(timezone.utc).
"

--
nosy: +primal

___
Python tracker 

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



[issue44461] 'Pdb' object has no attribute 'botframe'

2021-07-18 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests:  -25553

___
Python tracker 

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



[issue44549] BZip 1.0.6 Critical Vulnerability

2021-07-18 Thread Dong-hee Na


Dong-hee Na  added the comment:

I request the dependency update to use bzip2 1.0.8 which is the stable version.

https://github.com/python/cpython-source-deps/pull/25

--

___
Python tracker 

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



[issue44651] An unclear definition in Doc/glossary.rst

2021-07-18 Thread Mark Dickinson


Mark Dickinson  added the comment:

My one worry with removing the entry is that documentation of other projects 
may be referring to it via intersphinx. If we think this is likely to be a real 
problem, we could leave a stub entry, but I think it's  okay to go ahead and 
delete. To be on the safe side, I would suggest that only make the change for 
Python 3.11, though, and we don't backport the change to earlier versions of 
Python.

--

___
Python tracker 

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



[issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline

2021-07-18 Thread Matthieu Dartiailh


New submission from Matthieu Dartiailh :

Using tokenize.py to tokenize the attached file yields:
0,0-0,0:ENCODING   'utf-8'
1,0-1,2:NAME   'if'
1,3-1,4:NAME   'a'
1,4-1,5:OP ':'
1,5-1,7:NEWLINE'\r\n'
2,0-2,4:INDENT ''
2,4-2,5:NAME   'b'
2,6-2,7:OP '='
2,8-2,9:NUMBER '1'
2,9-2,11:   NEWLINE'\r\n'
3,0-3,2:NL '\r\n'
4,0-4,6:COMMENT'# test'
4,6-4,6:NL ''
4,6-4,7:NEWLINE''
5,0-5,0:DEDENT ''
5,0-5,0:ENDMARKER  ''

This output is wrong in that it adds 2 newlines one as a NL which is a correct 
and one as a NEWLINE which is not since there is no preceding code.

If a new line is added at the end of the file, one gets:

0,0-0,0:ENCODING   'utf-8'
1,0-1,2:NAME   'if'
1,3-1,4:NAME   'a'
1,4-1,5:OP ':'
1,5-1,7:NEWLINE'\r\n'
2,0-2,4:INDENT ''
2,4-2,5:NAME   'b'
2,6-2,7:OP '='
2,8-2,9:NUMBER '1'
2,9-2,11:   NEWLINE'\r\n'
3,0-3,2:NL '\r\n'
4,0-4,6:COMMENT'# test'
4,6-4,8:NL '\r\n'
5,0-5,0:DEDENT ''
5,0-5,0:ENDMARKER  ''

Similarly if code is added before the comment, a single NEWLINE is generated 
(with no text since it is fake).

The extra NEWLINE found when tokenizing the attached file can cause issue when 
parsing the file. It was found in 
https://github.com/we-like-parsers/pegen/pull/11#issuecomment-881926767 where a 
pure python parser based on pegen is being built. The extra NEWLINE is an issue 
since the grammar does not accept NEWLINE at the end of a block and cause 
parsing to fail using the same rules as the python grammar while the cpython 
parser can handle this file without any issue.

I believe this issue stems from 
https://github.com/python/cpython/blob/3.9/Lib/tokenize.py#L605 where the check 
does not account for a last line limited to comments. Adding a check to 
determine if the line starts with a # should be sufficient to avoid emitting 
the extra NEWLINE.

--
components: Library (Lib)
files: no_newline_at_end_of_file_with_comment.py
messages: 397750
nosy: mdartiailh
priority: normal
severity: normal
status: open
title: tokenize.py emits spurious NEWLINE if file ends on a comment without a 
newline
type: behavior
versions: Python 3.8
Added file: 
https://bugs.python.org/file50157/no_newline_at_end_of_file_with_comment.py

___
Python tracker 

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



[issue44461] 'Pdb' object has no attribute 'botframe'

2021-07-18 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +25768
pull_request: https://github.com/python/cpython/pull/27227

___
Python tracker 

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



[issue44549] BZip 1.0.6 Critical Vulnerability

2021-07-18 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue44554] pdb.main is unnecessarily complicated

2021-07-18 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Additional problems I noticed while working on the refactor:

- There is a lot of overlap in behavior between the implementations of 
_run_script and _run_module (initializing private variables, setting 
mainpyfile, resetting the __main__ namespace).

- There are two block comments in _run_script whose behaviors apply to 
_run_module as well, but the block comments are not associated with those 
behaviors in _run_module.

--

___
Python tracker 

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



[issue44651] An unclear definition in Doc/glossary.rst

2021-07-18 Thread Steven Hsu


Change by Steven Hsu :


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

___
Python tracker 

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



[issue44633] Indexing the union type can return NotImplemented

2021-07-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue44654] Refactor and clean up the union type implementation

2021-07-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +25766
pull_request: https://github.com/python/cpython/pull/27225

___
Python tracker 

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



[issue42355] symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all

2021-07-18 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue42355] symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all

2021-07-18 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset a045991f60b51636a784623dda7ad84b5b2c6b73 by Batuhan Taskaya in 
branch 'main':
bpo-42355: symtable.get_namespace() now checks whether there are multiple or 
any namespaces found (GH-23278)
https://github.com/python/cpython/commit/a045991f60b51636a784623dda7ad84b5b2c6b73


--

___
Python tracker 

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



[issue44654] Refactor and clean up the union type implementation

2021-07-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8f50f44592190b5a8cb115f0d58d577036e68308 by Serhiy Storchaka in 
branch 'main':
bpo-44654: Do not export the union type related symbols (GH-27223)
https://github.com/python/cpython/commit/8f50f44592190b5a8cb115f0d58d577036e68308


--

___
Python tracker 

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



[issue44633] Indexing the union type can return NotImplemented

2021-07-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 85b58292cf94de74d028053ac33a65f269f305cb by Miss Islington (bot) 
in branch '3.10':
bpo-44633: Fix parameter substitution of the union type with wrong types. 
(GH-27218) (GH-27224)
https://github.com/python/cpython/commit/85b58292cf94de74d028053ac33a65f269f305cb


--

___
Python tracker 

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



[issue44664] builtins.chr and the 'c' format flag raise different errors

2021-07-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Is there any example where it causes troubles?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44633] Indexing the union type can return NotImplemented

2021-07-18 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +25765
pull_request: https://github.com/python/cpython/pull/27224

___
Python tracker 

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



[issue44633] Indexing the union type can return NotImplemented

2021-07-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3ea5332a4365bdd771286b3e9692495116e9ceef by Serhiy Storchaka in 
branch 'main':
bpo-44633: Fix parameter substitution of the union type with wrong types. 
(GH-27218)
https://github.com/python/cpython/commit/3ea5332a4365bdd771286b3e9692495116e9ceef


--

___
Python tracker 

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



[issue44654] Refactor and clean up the union type implementation

2021-07-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +25764
pull_request: https://github.com/python/cpython/pull/27223

___
Python tracker 

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



[issue44666] compileall.compile_file fails when sys.stdout is redirected to StringIO

2021-07-18 Thread Stefan Hölzl

New submission from Stefan Hölzl :

compile_files tries to escape non-printable characters in error messages by 
using sys.stdout.encoding
https://github.com/python/cpython/blob/main/Lib/compileall.py#L256

when using contextlib.redirect_stdout to redirect stdout to io.StringIO as 
explained in the documentation
https://docs.python.org/3/library/contextlib.html#contextlib.redirect_stdout

compile_file fails, because io.StringIO has encoding set to None.

see the attached file to reproduce the issue

--
components: Library (Lib)
files: compile_file_bug.py
messages: 397743
nosy: stefanhoelzl
priority: normal
severity: normal
status: open
title: compileall.compile_file fails when sys.stdout is redirected to StringIO
type: crash
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9
Added file: https://bugs.python.org/file50156/compile_file_bug.py

___
Python tracker 

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



[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-07-18 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +25763
pull_request: https://github.com/python/cpython/pull/27222

___
Python tracker 

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



[issue44659] Remove Ivan from list of typing experts

2021-07-18 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Thank you everyone! I hope our paths will cross someday.

--

___
Python tracker 

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



[issue44665] asyncio.create_task() documentation should mention user needs to keep reference to the task

2021-07-18 Thread Vincent Bernat


New submission from Vincent Bernat :

asyncio will only keep weak references to alive tasks (in `_all_tasks`). If a 
user does not keep a reference to a task and the task is not currently 
executing or sleeping, the user may get "Task was destroyed but it is pending!".

I would suggest adding the following paragraph to `create_task()` documentation:

Python only keeps weak references to the scheduled tasks. To avoid the task 
being destroyed by the garbage collector while still pending, a reference to it 
should be kept until the task is done.

And maybe an example in case a user wants something "fire and forget"?

```python
running_tasks = set()
# [...]
task = asyncio.create_task(some_background_function())
running_tasks.add(task)
task.add_done_callback(lambda t: running_tasks.remove(t))
```

The same applies to ensure_future as it now uses create_task, so maybe a "See 
create_task()".

--
assignee: docs@python
components: Documentation
messages: 397741
nosy: bernat, docs@python
priority: normal
severity: normal
status: open
title: asyncio.create_task() documentation should mention user needs to keep 
reference to the task
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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