[issue31904] Python should support VxWorks RTOS

2020-12-14 Thread Peixing Xin


Change by Peixing Xin :


--
pull_requests: +22632
pull_request: https://github.com/python/cpython/pull/23776

___
Python tracker 

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



[issue42641] Deprecate os.popen() function

2020-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Searching os.popen in code on GitHub gives around 4.5 millions of results. 
Seems that most of them are with literal strings which are very specific to the 
program, like

check2 = os.popen('grep "net\.ipv4\.ip_forward" /etc/sysctl.conf 
/etc/sysctl.d/*').read()

They are not vulnerable to shell injection and other drawbacks of os.popen do 
not matter in that cases. Most of that code looks like specialized scripts 
rather than parts of general libraries.

Yes, some examples can be vulnerable to shell injection (although in they use 
cases, with restricted data and environment, they can be pretty safe). But 
deprecating os.popen can break millions of scripts and cause more harm than 
prevent bugs.

It may be better strategy to document drawbacks and limitations of os.popen and 
advertise alternatives.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2020-12-14 Thread miss-islington


miss-islington  added the comment:


New changeset 925f9987866703b0e7cfde341d23f19b832603cb by Miss Islington (bot) 
in branch '3.8':
bpo-33610: Edit idlelib.codecontext (GH-23773)
https://github.com/python/cpython/commit/925f9987866703b0e7cfde341d23f19b832603cb


--

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2020-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22631
pull_request: https://github.com/python/cpython/pull/23775

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2020-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22630
pull_request: https://github.com/python/cpython/pull/23774

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2020-12-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 6f79e60b66dacefca147bdaa80eb37f936a72991 by Terry Jan Reedy in 
branch 'master':
bpo-33610: Edit idlelib.codecontext (GH-23773)
https://github.com/python/cpython/commit/6f79e60b66dacefca147bdaa80eb37f936a72991


--

___
Python tracker 

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



[issue42567] Enum: manually call __init_subclass__ after members are added

2020-12-14 Thread Ethan Furman


Change by Ethan Furman :


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



[issue31904] Python should support VxWorks RTOS

2020-12-14 Thread dimitri.wei


Change by dimitri.wei :


--
nosy:  -wlf100220

___
Python tracker 

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



[issue42639] Make atexit state per interpreter

2020-12-14 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2020-12-14 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +22629
pull_request: https://github.com/python/cpython/pull/23773

___
Python tracker 

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



[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2020-12-14 Thread Inada Naoki


Inada Naoki  added the comment:

pidigits and regex_v8 are LOAD_ATTR heavy benchmarks?
I will run benchmarks in my machine to confirm the results.

--

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2020-12-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Delete E6.  No bug.  I do have a couple of internal edits.

--
dependencies:  -IDLE: Context lines not working correctly

___
Python tracker 

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



[issue42638] IDLE: Context lines not working correctly

2020-12-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This is a false report due to a brain glitch.

--
resolution:  -> not a bug
stage: test needed -> 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



[issue33610] IDLE: Make multiple improvements to CodeContext

2020-12-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

E4. Max context lines = 0 is treated as infinity.  For depth 0, 
"self.info[-self.context_depth:]" is whole slice.  I don't remember if this is 
intended (if one does not want context, don't toggle it on), but it is not 
documented in settings help or doc section.  In any case,
  offset = max(1, lines - self.context_depth) - 1
fails with depth 0.

E5. test_codecontext is affected by user customization, but should not be.

E6. Bad bug make CC useless.  See #42638.

--
dependencies: +IDLE: Context lines not working correctly
versions: +Python 3.10 -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



[issue42567] Enum: manually call __init_subclass__ after members are added

2020-12-14 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 9d1fff1fcd5332f0ba7f72d0e0f9f66b47ec4e8d by Ethan Furman in 
branch '3.9':
[3.9] bpo-42567: [Enum] call __init_subclass__ after members are added 
(GH-23714) (GH-23772)
https://github.com/python/cpython/commit/9d1fff1fcd5332f0ba7f72d0e0f9f66b47ec4e8d


--

___
Python tracker 

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



[issue42643] http.server does not support HTTP range requests

2020-12-14 Thread Decorater


Decorater  added the comment:

It seems there are some packages that supports the range requests too:

https://github.com/danvk/RangeHTTPServer

Not sure if that supports python 3 or not. It could be used to make a patch for 
http.server though.

--

___
Python tracker 

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



[issue42643] http.server does not support HTTP range requests

2020-12-14 Thread Decorater


New submission from Decorater :

I have issues with range requests on http.server module (ran from python -m 
http.server command)

When requesting files to download from an program written in C (which uses 
range requests to update an progress bar) it ignores this and simply forces 
download of the entire thing at once) which in turn on my program makes the 
progress bar never update to display the progress of the download to the user.

https://tools.ietf.org/id/draft-ietf-httpbis-p5-range-09.html#range.units

It is a part from HTTP/1.1, I think this would be something good to actually 
have to support partial requests (if they request an range in the header of 
their request), for directory listings (which can be used to download files 
from), it could be considered helpful it be able to request specific byte 
ranges inside of the files to download at a time to split up bandwidth to not 
overwhelm an file server.

--
components: Library (Lib)
messages: 383028
nosy: Decorater
priority: normal
severity: normal
status: open
title: http.server does not support HTTP range requests
type: enhancement
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue42642] logging: add high priority log level for warnings being cleared

2020-12-14 Thread Nick Coghlan


New submission from Nick Coghlan :

When using the logging module for long running services, there's one limitation 
of the predefined logging levels that I semi-regularly run into: the only 
entirely reliable log level for reporting that a WARNING state has been cleared 
is itself WARNING.

Using INFO instead means that it is common to get error logs that show warning 
states being entered without any matching "error cleared" notification.

My idea for resolving this would be to define a new ESSENTIAL log level between 
WARNING and ERROR. The idea of the new log level would be to have a 
logged-by-default level for non-fault-but-essential messages like:

* service startup (including version info)
* service shutdown
* warnings being cleared

(NOTICE would be another possible name for such a level)

--
messages: 383027
nosy: ncoghlan, vinay.sajip
priority: low
severity: normal
stage: needs patch
status: open
title: logging: add high priority log level for warnings being cleared
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue42640] tkinter throws exception when key is pressed

2020-12-14 Thread Ned Deily


Ned Deily  added the comment:

> Which version of TK 8.5.X fixes this, 8.5.18.0?

Yes, that version of Tk 8.5 does not have this problem. But Tk 8.5 is no longer 
supported by the Tcl project; we recommend the use of Tk 8.6. In general, you 
usually cannot just swap Tk versions; the Python instance you are using needs 
to be built with the right versions of Tcl and Tk. You should check with the 
provider of the Python you are using and get a more current Python that uses a 
current version of Tcl and Tk.

--

___
Python tracker 

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



[issue42567] Enum: manually call __init_subclass__ after members are added

2020-12-14 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +22628
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/23772

___
Python tracker 

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



[issue42059] TypedDict(...) as function does not respect "total" when setting __required_keys__ and __optional_keys__

2020-12-14 Thread Brandt Bucher


Change by Brandt Bucher :


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



[issue40084] HTTPStatus has incomplete dir() listing

2020-12-14 Thread Ethan Furman


Change by Ethan Furman :


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



[issue42529] CPython DLL initialization routine failed from PYC cache file

2020-12-14 Thread Karl Nelson


Karl Nelson  added the comment:

Any progress on this item?  I am seeing additional reports of this error in the 
conda stream tracker and elsewhere.  As it only occurs when the debugger is not 
hooked up I don't have much traction to make progress myself.

--

___
Python tracker 

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



[issue42517] Enum: do not convert private names into members

2020-12-14 Thread Ethan Furman


Change by Ethan Furman :


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

___
Python tracker 

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



[issue42517] Enum: do not convert private names into members

2020-12-14 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset aba12b67c18b17bb727a0d50dd0653e38cb64dc8 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-42517: [Enum] deprecate private name members (GH-23722) (GH-23748)
https://github.com/python/cpython/commit/aba12b67c18b17bb727a0d50dd0653e38cb64dc8


--

___
Python tracker 

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



[issue42577] Unhelpful syntax error when expression spans multiple lines

2020-12-14 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Thanks for opening an issue here, Christoph. This is the right place to discuss 
this.

Indeed the parser is pretty dumb when reporting errors. In the technical sense 
the colon is the right thing to point to, since it's the first token that's not 
grammatically correct. Of course, it's somewhat misleading that it points to a 
line that *seems* correct, but that probably as good as we can do with the 
parser's current error reporting mechanisms.

Showing more that one lines would indeed solve this specific case, but 
implementing this is also difficult and I don't think it's worth it for such an 
edge case.

Guido, Pablo, your views on this?

--
nosy: +gvanrossum, lys.nikolaou, pablogsal

___
Python tracker 

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



[issue42591] Method Py_FrozenMain missing in libpython3.9

2020-12-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42591] Method Py_FrozenMain missing in libpython3.9

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Christian Bachmaier for the bug report, it's now fixed.

--

___
Python tracker 

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



[issue42591] Method Py_FrozenMain missing in libpython3.9

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6b2ed385094839c1920b934f07d946bf049a3770 by Victor Stinner in 
branch '3.9':
bpo-42591: Export missing Py_FrozenMain() symbol (GH-23730) (GH-23734)
https://github.com/python/cpython/commit/6b2ed385094839c1920b934f07d946bf049a3770


--

___
Python tracker 

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



[issue42641] Deprecate os.popen() function

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

About shell injection, subprocess.getstatusoutput() uses 
subprocess.Popen(shell=True).
https://docs.python.org/dev/library/subprocess.html#subprocess.getstatusoutput

It's done on purpose: "Execute the string cmd in a shell with 
Popen.check_output()".

--

___
Python tracker 

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



[issue42640] tkinter throws exception when key is pressed

2020-12-14 Thread Justin


Justin  added the comment:

Thanks for responding so quickly.
1. My python version is:
Python 3.8.6 (default, Oct  8 2020, 14:07:53) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
2. N/A
3. >>> from tkinter.test.support import *
>>> get_tk_patchlevel()
(8, 5, 9, 'final', 0)
4. No; the pygame sample does not crash with this key input

Which version of TK 8.5.X fixes this, 8.5.18.0? That's what it looks like here: 
https://www.python.org/download/mac/tcltk/

--

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-14 Thread Ivo Shipkaliev


Ivo Shipkaliev  added the comment:

"Attached is a diff which ..." -- Much nicer!

Are you gonna submit a PR so I can eventually use _setup_master() in my PR?

--

___
Python tracker 

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



[issue42641] Deprecate os.popen() function

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-26124: "shlex.quote and pipes.quote do not quote shell keywords".

--

___
Python tracker 

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



[issue42641] Deprecate os.popen() function

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

About the pipes module, see bpo-41150: "... unapplicable for processing binary 
data and text data non-encodable with the locale encoding".

--

___
Python tracker 

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



[issue42641] Deprecate os.popen() function

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

The pipes module uses os.popen(): The open_r() and open_w() methods of 
pipes.Template are implemented with os.popen().

Multiple tests still use os.popen():

* test_select: SelectTestCase.test_select()
* test_posix: PosixTester.test_getgroups()
* test_os: EnvironTests._test_underlying_process_env()
* test_os: EnvironTests.test_update2()

And os.popen() tests:

* test_os: EnvironTests.test_os_popen_iter()
* test_popen

--

___
Python tracker 

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



[issue42641] Deprecate os.popen() function

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

os.popen() doesn't emit a ResourceWarning when close() is not called, leading 
to weird issues like bpo-15408.

--

___
Python tracker 

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



[issue42641] Deprecate os.popen() function

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

In the past, multiple os.popen() usage have been replaced with subprocess in 
the stdlib to prevent the risk of shell injection:

* bpo-22636: ctypes modules
* bpo-22637: uuid module

By the way, there is an open issue bpo-21557 "os.popen & os.system lack 
shell-related security warnings".

See also bpo-6490 "os.popen documentation is probably wrong" (fixed).

--

___
Python tracker 

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



[issue42641] Deprecate os.popen() function

2020-12-14 Thread STINNER Victor


New submission from STINNER Victor :

The os.popen() function uses a shell by default which usually leads to shell 
injection vulnerability.

It also has a weird API:

* closing the file waits until the process completes.
* close() returns a "wait status" (*) not a "returncode"

(*) see https://docs.python.org/dev/library/os.html#os.waitstatus_to_exitcode 
for the meaning of a "wait status".

IMO the subprocess module provides better and safer alternatives with a clean 
API. The subprocess module already explains how to replace os.popen() with 
subprocess:
https://docs.python.org/dev/library/subprocess.html#replacing-os-popen-os-popen2-os-popen3

In Python 2, os.popen() was deprecated since Python 2.6, but Python 3.0 removed 
the deprecation (commit dcf97b98ec5cad972b3a8b4989001c45da87d0ea, then commit 
f5a429295d855267c33c5ef110fbf05ee7a3013e extended os.popen() documentation 
again: bpo-6490).

platform.popen() existed until Python 3.8 (bpo-35345). It was deprecated since 
Python 3.3 (bpo-11377).

--

There is also the os.system() function which exposes the libc system() 
function. Should we deprecate this one as well?

--
components: Library (Lib)
messages: 383012
nosy: vstinner
priority: normal
severity: normal
status: open
title: Deprecate os.popen() function
versions: Python 3.10

___
Python tracker 

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



[issue40084] HTTPStatus has incomplete dir() listing

2020-12-14 Thread miss-islington


miss-islington  added the comment:


New changeset 33cbb04986d0dabb9c542edc52bb4ea6106d3a81 by Miss Islington (bot) 
in branch '3.9':
bpo-40084: Enum - dir() includes member attributes (GH-19219)
https://github.com/python/cpython/commit/33cbb04986d0dabb9c542edc52bb4ea6106d3a81


--

___
Python tracker 

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



[issue42059] TypedDict(...) as function does not respect "total" when setting __required_keys__ and __optional_keys__

2020-12-14 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset dbb00062dc3afb12c41c87564e6faefe60766b01 by Miss Islington (bot) 
in branch '3.9':
bpo-42059: Fix required/optional keys for TypedDict(..., total=False) 
(GH-22736) (GH-23747)
https://github.com/python/cpython/commit/dbb00062dc3afb12c41c87564e6faefe60766b01


--

___
Python tracker 

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



[issue42609] Eval with too high string multiplication crashes newer Python versions

2020-12-14 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c117426bf8e7dd7a25e7d15bfbc88253b6ed42de by pxinwr in branch 
'master':
bpo-31904: Enable libpython3.so shared library for VxWorks (GH-23741)
https://github.com/python/cpython/commit/c117426bf8e7dd7a25e7d15bfbc88253b6ed42de


--

___
Python tracker 

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



[issue42639] Make atexit state per interpreter

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 357704c9f2375f29ed5b3a93adac086fa714538d by Victor Stinner in 
branch 'master':
bpo-42639: atexit now logs callbacks exceptions (GH-23771)
https://github.com/python/cpython/commit/357704c9f2375f29ed5b3a93adac086fa714538d


--

___
Python tracker 

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



[issue42551] Generator `yield`s counted as primitive calls by cProfile

2020-12-14 Thread Matthew Suozzo


Matthew Suozzo  added the comment:

One of the problems with my proposed solution that I glossed over was how and 
where to count the primitive call. If the primitive call is only registered on 
RETURN (i.e. after all yields), a generator that is incompletely exhausted 
would have 0 primitive calls. However if the primitive call is registered 
immediately when the call context is entered, the recorded call would be 
instantaneous (i.e. 0s duration) which could throw off the percall statistics.

Even with the incomplete generator case, I think registering the primitive call 
on RETURN is the best of the two options. Although seeing 2/0 for the call 
count when RETURN wasn't reached might seem odd, it lines up with a conceptual 
model of a coroutine: An iterator represents a function returning a sequence; 
Exhausting that iterator corresponds to the function call completing; 
Incompletely exhausting corresponds to an abbreviated/incomplete function call.

--

___
Python tracker 

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



[issue42639] Make atexit state per interpreter

2020-12-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22627
pull_request: https://github.com/python/cpython/pull/23771

___
Python tracker 

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



[issue42640] tkinter throws exception when key is pressed

2020-12-14 Thread Ned Deily

Ned Deily  added the comment:

The problem here undoubtedly is that the Python you are using is linked with 
the Apple-provided system version of Tk 8.5.9 which exhibits this nasty 
behavior of crashing when pressing a composing key. The system version of Tk is 
woefully out of date with other serious bugs and hasn’t been updated by Apple 
for many macOS releases despite many bug reports. Their response has been to 
deprecate the system Tk and they will eventually remove it. That’s why Python 
binary installers from Python.org now provide their own copy of Tk 8.6. You 
should update to a macOS build of Python 3.8 or 3.9 that also uses a newer 
version of Tk. Issue22566 has more details.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> International keyboard makes IDLE crash on OSX

___
Python tracker 

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



[issue42639] Make atexit state per interpreter

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 83d52044ae4def1e8611a4b1b9263b850ca5c458 by Victor Stinner in 
branch 'master':
bpo-42639: Cleanup atexitmodule.c (GH-23770)
https://github.com/python/cpython/commit/83d52044ae4def1e8611a4b1b9263b850ca5c458


--

___
Python tracker 

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



[issue42639] Make atexit state per interpreter

2020-12-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22626
pull_request: https://github.com/python/cpython/pull/23770

___
Python tracker 

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



[issue42640] tkinter throws exception when key is pressed

2020-12-14 Thread E. Paine


E. Paine  added the comment:

Thank you for reporting this. I just have a few questions:
1. Which Python version are you using?
2. If Python 3.9.1, which installer did you use?
3. What does `tkinter.test.support.get_tk_patchlevel()` output?
4. Does your pygame example suffer the same issue (I assume not)?

I am unable to reproduce on macOS 11 with Python 3.8.6, but am almost certain 
this is a Tk issue due to the nature of it.

--
components: +Tkinter, macOS
nosy: +epaine, ned.deily, ronaldoussoren, serhiy.storchaka
type:  -> behavior
versions: +Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-14 Thread E. Paine


E. Paine  added the comment:

Attached is a diff which moves the logic for `setup_master` to the tkinter 
module while allowing it to still be imported from the tkinter.ttk module (in 
case someone uses it...) The diff also replaces the logic in a few other places 
to:
A. make behaviour more consistent
B. give nicer errors in other methods (i.e. avoiding what this issue is about 
but in other places)

I guess my question is whether we are limiting most changes to just __init__.py 
or whether we want to do more of a cleanup throughout the tkinter module (e.g. 
tkinter.dialog.Dialog can be neatened and no longer needs to inherit the Widget 
class).

--
keywords: +patch
Added file: https://bugs.python.org/file49681/setup_master.diff

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-14 Thread Ivo Shipkaliev


Ivo Shipkaliev  added the comment:

The current implementation is already relying on _some_ master anyway:

335 > self._root = master._root()

So, initializing a default root, if one isn't present, shouldn't break 
anything. And reusing setup_master() is a good idea. Maybe:

333 > master = setup_master(master)
334 > self._root = master._root()

But:

> from tkinter.ttk import setup_master

leads to a circular import error. I'll look into this.

--

___
Python tracker 

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



[issue41877] Check against misspellings of assert etc. in mock

2020-12-14 Thread Václav Brožek

Václav Brožek  added the comment:

The three PRs which landed for this bug implement what I planned in the 
original comment, so I'm closing this bug.

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



[issue41877] Check against misspellings of assert etc. in mock

2020-12-14 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset fdb9efce6ac211f973088eef508740c3fa2bd182 by vabr-g in branch 
'master':
bpo-41877: Check for misspelled speccing arguments (GH-23737)
https://github.com/python/cpython/commit/fdb9efce6ac211f973088eef508740c3fa2bd182


--

___
Python tracker 

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



[issue42631] Multiprocessing module hangs on os.read() on Linux

2020-12-14 Thread to7m


Change by to7m :


Removed file: https://bugs.python.org/file49675/receive.py

___
Python tracker 

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



[issue42640] tkinter throws exception when key is pressed

2020-12-14 Thread Justin


Justin  added the comment:

Sorry my verification keyboard listener program is not the pygame one. It is 
this one:
```
from tkinter import *
def keyup(e):
print('up', e.__dict__)
def keydown(e):
print('down', e.__dict__)

root = Tk()
frame = Frame(root, width=100, height=100)
frame.bind("", keydown)
frame.bind("", keyup)
frame.pack()
frame.focus_set()
root.mainloop()
```

--

___
Python tracker 

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



[issue42640] tkinter throws exception when key is pressed

2020-12-14 Thread Justin


New submission from Justin :

On macOs 10.14.6 laptop with a qwerty layout, when I switch my keyboard layout 
to `French - PC` and use a tkinter keyboard listener
and press the '[' button which should be the '^' button on the azerty keyboard, 
this Error is thrown:
```
2020-12-14 10:13:26.533 Python[14880:1492926] *** Terminating app due to 
uncaught exception 'NSRangeException', reason: '-[__NSCFConstantString 
characterAtIndex:]: Range or index out of bounds'
*** First throw call stack:
(
0   CoreFoundation  0x7fff41ce49ad 
__exceptionPreprocess + 256
1   libobjc.A.dylib 0x7fff6c3dfa17 
objc_exception_throw + 48
2   CoreFoundation  0x7fff41ce47df 
+[NSException raise:format:] + 201
3   CoreFoundation  0x7fff41c5a159 
-[__NSCFString characterAtIndex:] + 102
4   Tk  0x7fff4da8a806 
TkpInitKeymapInfo + 719
5   Tk  0x7fff4da905e9 
Tk_MacOSXSetupTkNotifier + 793
6   Tcl 0x7fff4d98c48e 
Tcl_DoOneEvent + 301
7   _tkinter.cpython-38-darwin.so   0x0001090802de 
_tkinter_tkapp_mainloop + 342
8   Python  0x000108ac1b0a 
method_vectorcall_FASTCALL + 250
9   Python  0x000108b5a299 
call_function + 346
10  Python  0x000108b51457 
_PyEval_EvalFrameDefault + 3895
11  Python  0x000108b5ae5d 
_PyEval_EvalCodeWithName + 2107
12  Python  0x000108abad39 
_PyFunction_Vectorcall + 217
13  Python  0x000108abcc7d 
method_vectorcall + 135
14  Python  0x000108b5a299 
call_function + 346
15  Python  0x000108b51477 
_PyEval_EvalFrameDefault + 3927
16  Python  0x000108b5ae5d 
_PyEval_EvalCodeWithName + 2107
17  Python  0x000108b5047d 
PyEval_EvalCode + 51
18  Python  0x000108b89025 
run_eval_code_obj + 102
19  Python  0x000108b88473 run_mod + 82
20  Python  0x000108b87345 
PyRun_FileExFlags + 160
21  Python  0x000108b86a29 
PyRun_SimpleFileExFlags + 271
22  Python  0x000108b9e449 Py_RunMain + 
1870
23  Python  0x000108b9e790 pymain_main 
+ 306
24  Python  0x000108b9e7de Py_BytesMain 
+ 42
25  libdyld.dylib   0x7fff6dbae3d5 start + 1
26  ??? 0x0002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
```
One can verify this by running this program on a macOs laptop with a qwerty 
keyboard, switching the layout to French - PC and pressing the '[' key.
```
import pygame
pygame.init()
pygame.display.set_mode((100, 100))
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit(); #sys.exit() if sys is imported
if event.type == pygame.KEYDOWN:
key_name = pygame.key.name(event.key)
print(event, event.key.__class__, event.key, key_name)
elif event.type == pygame.KEYUP:
key_name = pygame.key.name(event.key)
print(event, event.key.__class__, event.key, key_name)
```
```

--
messages: 382998
nosy: spacether
priority: normal
severity: normal
status: open
title: tkinter throws exception when key is pressed

___
Python tracker 

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



[issue36541] Make lib2to3 grammar better match Python, support the := walrus

2020-12-14 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution: out of date -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue36541] Make lib2to3 grammar better match Python, support the := walrus

2020-12-14 Thread miss-islington


miss-islington  added the comment:


New changeset 20bc40ef44b820733848d5838e803b5fe4350b93 by Miss Islington (bot) 
in branch '3.9':
bpo-36541: Add lib2to3 grammar PEP-570 pos-only arg parsing (GH-23759)
https://github.com/python/cpython/commit/20bc40ef44b820733848d5838e803b5fe4350b93


--

___
Python tracker 

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



[issue36541] Make lib2to3 grammar better match Python, support the := walrus

2020-12-14 Thread miss-islington


miss-islington  added the comment:


New changeset 06bfd033e847bedb6e123d131dcf46393a4555df by Miss Islington (bot) 
in branch '3.8':
bpo-36541: Add lib2to3 grammar PEP-570 pos-only arg parsing (GH-23759)
https://github.com/python/cpython/commit/06bfd033e847bedb6e123d131dcf46393a4555df


--

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-12-14 Thread Ned Deily


Ned Deily  added the comment:

> Any reason this wasn't backported to 3.6?

Just an oversight. Thanks for pointing it out.

--
versions: +Python 3.6

___
Python tracker 

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



[issue36541] Make lib2to3 grammar better match Python, support the := walrus

2020-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22625
pull_request: https://github.com/python/cpython/pull/23769

___
Python tracker 

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



[issue36541] Make lib2to3 grammar better match Python, support the := walrus

2020-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22624
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/23768

___
Python tracker 

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



[issue36541] Make lib2to3 grammar better match Python, support the := walrus

2020-12-14 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 42c9f0fd0a5e67d4ae0022bfd7370cb9725a5b01 by Gregory P. Smith in 
branch 'master':
bpo-36541: Add lib2to3 grammar PEP-570 pos-only arg parsing (GH-23759)
https://github.com/python/cpython/commit/42c9f0fd0a5e67d4ae0022bfd7370cb9725a5b01


--

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-12-14 Thread Ned Deily


Ned Deily  added the comment:


New changeset 8bef9ebb1b88cfa4b2a38b93fe4ea22015d8254a by Miss Islington (bot) 
in branch '3.6':
bpo-40791: Make compare_digest more constant-time. (GH-23438) (GH-23767)
https://github.com/python/cpython/commit/8bef9ebb1b88cfa4b2a38b93fe4ea22015d8254a


--
nosy: +ned.deily

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22623
pull_request: https://github.com/python/cpython/pull/23767

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-14 Thread Guido van Rossum


Guido van Rossum  added the comment:

Looks like we can close this. Thanks for the report Zac (hopefully you can live 
with the resolution), and thanks a bundle Ken Jin for all your work on this! I 
hope it was fun and educational for you. I know it was for me.

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



[issue35332] shutil.rmtree(..., ignore_errors=True) doesn't ignore errors from os.close()

2020-12-14 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 2.0 -> 3.0
pull_requests: +22622
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23766

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-14 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 33b3fedd43e10e5a227ec8b7d251496e7cad4717 by kj in branch '3.9':
[3.9] bpo-42195: Ensure consistency of Callable's __args__ in collections.abc 
and typing (GH-23765)
https://github.com/python/cpython/commit/33b3fedd43e10e5a227ec8b7d251496e7cad4717


--

___
Python tracker 

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



[issue38655] ipaddress.ip_network('0.0.0.0/0').is_private == True

2020-12-14 Thread Michael Woodham


Michael Woodham  added the comment:

As far as I can tell this is still broken. A hard check for '0.0.0.0/0' should 
fix this issue.

--
nosy: +maw1395

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-14 Thread Ivo Shipkaliev


Change by Ivo Shipkaliev :


--
resolution: works for me -> 

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-14 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +22621
pull_request: https://github.com/python/cpython/pull/23765

___
Python tracker 

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



[issue42571] Make documentation of * in function signatures easier to find

2020-12-14 Thread Éric Araujo

Éric Araujo  added the comment:

Thank you for the details!  This helps finding a good place to document this.
A link to function parameters from the top of the section may be good.
But maybe we need a sidebar link on all pages that goes to a description of doc 
conventions! (and includes link to basic syntax doc, function parameter 
glossary, tutorial).

(As you thought, there are notations in the docs (and even in some docstrings) 
that are documentation conventions but not valid Python, such as "range(start, 
stop[, step]) -> range object")

Even the enty for '* (asterisk)' in the general index 
https://docs.python.org/3/genindex-Symbols.html links to places explaining 
*args, not * alone.

I agree that the glossary entry for parameter is the best place to link to: 
it’s short and complete and can link to language reference for more.

--
title: [docs] add links to Glossary#parameter in libraries -> Make 
documentation of * in function signatures easier to find
versions: +Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue42632] Reassgining ZeroDivisionError will lead to bug in Except clause

2020-12-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

And thanks, Dennis, for the explanation as to why it's the expected behavior.

--

___
Python tracker 

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



[issue42632] Reassgining ZeroDivisionError will lead to bug in Except clause

2020-12-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

This code is working as expected, so I'm closing this.

--
nosy: +eric.smith
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



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

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote https://github.com/benjaminp/six/pull/343 to fix the six module. I 
would appreciate a review.

--
nosy: +vstinner

___
Python tracker 

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



[issue42635] Incorrect line number in bytecode for nested loops

2020-12-14 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue42634] Incorrect line number in bytecode for try-except-finally

2020-12-14 Thread Mark Shannon


Change by Mark Shannon :


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



[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2020-12-14 Thread Mark Shannon


Mark Shannon  added the comment:

Thanks Ned, that's really helpful. I'll go through those points:

Code after break/continue is no longer compiled.
Expected

First line number of modules
Expected

Except clause when no exception
https://bugs.python.org/issue42634

Double loops (this also covers End-of-loop jumps, I think)
https://bugs.python.org/issue42635

I want to merge https://github.com/python/cpython/pull/23743 before I fix any 
of the others, but here is a summary of what I think are the root causes.

if-break
Exit block duplication does not preserve line number of jump to final block

Finally handling
Combination of two things. Not preserving line numbers when performing 
jump-to-jump elimination and not marking try cleanup code as artificial.

--

___
Python tracker 

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



[issue42614] Pathlib does not support a Cyrillic character 'й'

2020-12-14 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm closing this as "not a bug" because this is likely caused by different 
unicode normalisations for strings.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue40600] Add option to disallow > 1 instance of an extension module

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-42639 and PR 23763 to move the atexit module to 
PyInterpreterState and so allow to have more than one atexit instance.

--

___
Python tracker 

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



[issue42639] Make atexit state per interpreter

2020-12-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42639] Make atexit state per interpreter

2020-12-14 Thread STINNER Victor


New submission from STINNER Victor :

In Python 2.7, atexit was implemented in Python and registered itself using 
sys.exitfunc public attribute:
https://docs.python.org/2.7/library/sys.html#sys.exitfunc
https://docs.python.org/2.7/library/atexit.html#module-atexit

In Python 3.0, the atexit module was rewritten in C. A new private 
_Py_PyAtExit() function was added to set a new private global "pyexitfunc" 
variable: variable used by call_py_exitfuncs() called by Py_Finalize().

In Python 3.7, the global "pyexitfunc" variable was moved int _PyRuntimeState 
(commit 2ebc5ce42a8a9e047e790aefbf9a94811569b2b6), and then into 
PyInterpreterState (commit 776407fe893fd42972c7e3f71423d9d86741d07c).

In Python 3.7, the atexit module was upgrade to the multiphase initialization 
API (PEP 489): PyInit_atexit() uses PyModuleDef_Init().

Since Python 2.7, the atexit module has a limitation: if a second instance is 
created, the new instance overrides the old one, and old registered callbacks 
are newer called.

One option is to disallow creating a second instance: see bpo-40600 and PR 
23699 for that.

Another option is to move the atexit state (callbacks) into PyInterpreterState. 
Two atexit module instances would modify the same list of callbacks. In this 
issue, I propose to investigate this option.

--
components: Library (Lib)
messages: 382982
nosy: vstinner
priority: normal
severity: normal
status: open
title: Make atexit state per interpreter
versions: Python 3.10

___
Python tracker 

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



[issue40600] Add option to disallow > 1 instance of an extension module

2020-12-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22619
pull_request: https://github.com/python/cpython/pull/23763

___
Python tracker 

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



[issue42638] IDLE: Context lines not working correctly

2020-12-14 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Test: open editor.py in editor.  Turn on Code context with large max lines.  
Scroll down to body of _sphinx_version (after line 37).  Nothing appears.  
Scroll down to line 82 in EditorWindow.__init__.  'def _sphinx_version' 
appears.  Scroll up (again with arrow key) to the 'def _sphinx_version' line 
and it diappears from the context.  Usually repeats.

Is it coincidence that 82 - 37 = 45, the lines in the window?  No.  Shrink 
window to 26 lines and context line appears when at line 37 + 26 = 63.

--
assignee: terry.reedy
components: IDLE
messages: 382981
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Context lines not working correctly
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue42635] Incorrect line number in bytecode for nested loops

2020-12-14 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset f5e97b72fecff9b9ced35704ec5e6cad29e2825d by Mark Shannon in 
branch 'master':
bpo-42635: Mark JUMP_ABSOLUTE at end of 'for' loop as artificial to avoid 
spurious line events. (GH-23761)
https://github.com/python/cpython/commit/f5e97b72fecff9b9ced35704ec5e6cad29e2825d


--

___
Python tracker 

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



[issue42636] shielded task exception never retrieved when outer task cancelled

2020-12-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks for the report.

I didn't test but looks like `outer.exception()` call can suppress the message 
about not retrieved exception.

--

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Actually it may be worth to reuse setup_master() from tkinter.ttk.

But I am not sure what is better: raise error (RuntimeError) if the global 
function uses _default_root which is not initialized, or create the root widget 
implicitly. Currently AttributeError or NameError is raised.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue42637] Python macos11.0 release note tkinter problems in news

2020-12-14 Thread E. Paine


Change by E. Paine :


--
title: Python release note tkinter problems -> Python macos11.0 release note 
tkinter problems in news

___
Python tracker 

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



[issue42637] Python release note tkinter problems

2020-12-14 Thread E. Paine


New submission from E. Paine :

Under the "Installer news" for the Python 3.9.1 release, it notes:
"As we are waiting for an updated version of pip, please consider the macos11.0 
installer experimental."

Is it worth also noting that tkinter has serious known problems that are being 
resolved (issue42541)?

--
messages: 382977
nosy: epaine, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python release note tkinter problems

___
Python tracker 

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



[issue42636] shielded task exception never retrieved when outer task cancelled

2020-12-14 Thread Martin Natano


Martin Natano  added the comment:

I'm not sure how to fix this, but here is a regression test for the issue. 
(failing on the current master branch)

--
keywords: +patch
Added file: https://bugs.python.org/file49680/regression-test.patch

___
Python tracker 

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



[issue42636] shielded task exception never retrieved when outer task cancelled

2020-12-14 Thread Martin Natano


New submission from Martin Natano :

A task created with asyncio.shield() never retrieves the task exception, which 
results in a log message being generated. See the attached script for a minimal 
example. Output looks something like this:


Task exception was never retrieved
future:  exception=Exception('foo')>
Traceback (most recent call last):
  File "/Users/natano/python-bug/trigger-warning.py", line 6, in some_coroutine
raise Exception('foo')
Exception: foo


I believe this behaviour is not intended and is an unintended side-effect of 
commit b35acc5b3a0148c5fd4462968b310fb436726d5a 
(https://github.com/python/cpython/commit/b35acc5b3a0148c5fd4462968b310fb436726d5a).
 The _inner_done_callback has has code to retrieve the exception when the outer 
task was cancelled, but since that commit the _inner_done_callback is not 
called anymore when the outer task was cancelled.


(Tested with 3.8, 3.9 and 3.10. I don't have a python 3.7 version available for 
testing, but I think this issue also affects 3.7.)

--
components: asyncio
files: trigger-warning.py
messages: 382975
nosy: asvetlov, natano, yselivanov
priority: normal
severity: normal
status: open
title: shielded task exception never retrieved when outer task cancelled
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49679/trigger-warning.py

___
Python tracker 

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



[issue42630] Variable.__init__ raises obscure AttributeError

2020-12-14 Thread E. Paine


E. Paine  added the comment:

+1 I agree the current AttributeError is not suitable.

I would just copy the code from Lib/tkinter/__init__.py:2524 (or even better: 
refactor it into its own method to avoid duplication). The code there, though, 
would raise a similar AttributeError if the default root is disabled, so I 
suggest that needs a changing to possibly a TypeError (i.e. missing 'master' 
argument). I assume you are alright to create a PR for this?

Please revert the "resolution" field as this is intended to be the reason for 
issue closure.

--
nosy: +epaine, serhiy.storchaka
title: Variable.__init__ to raise a RuntimeError instead of obscure 
AttributeError -> Variable.__init__ raises obscure AttributeError
versions: +Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue42587] memoryview rely on _Bool undefined behavior (test_buffer fails on Python built with GCC 11)

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

> I reported the bug to GCC upstream: 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98190

GCC got a fix:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3e60ddeb8220ed388819bb3f14e8caa9309fd3c2

--

___
Python tracker 

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



[issue40791] hmac.compare_digest could try harder to be constant-time.

2020-12-14 Thread Michał Górny

Michał Górny  added the comment:

Any reason this wasn't backported to 3.6?  FWICS it's supposed to be security 
supported still.

--
nosy: +mgorny

___
Python tracker 

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



[issue30459] PyList_SET_ITEM could be safer

2020-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

> That's not true; at least ALSA's python bindings use PyTuple_SET_ITEM as a 
> lvalue as well.

alsa-python used PyTuple_SET_ITEM(..., obj) to decide if it should call 
Py_INCREF(obj). This code looks suspicious. PyTuple_SET_ITEM() should not be 
used to set an item to NULL.

It's already fixed:
https://github.com/alsa-project/alsa-python/commit/5ea2f8709b4d091700750661231f8a3ddce0fc7c

IMO it's a good thing that such suspicious code is discovered. The surprising 
part is that it worked previously :-)

Downstream Fedora issue: https://bugzilla.redhat.com/show_bug.cgi?id=1906380 
(CLOSED)

--

___
Python tracker 

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



[issue42306] wrong exception handling in case asyncio.shiled usage

2020-12-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Sorry, this issue is not reproduced on 3.8-3.9, 3.7 is in security mode.
The issue doesn't belong to the security set.
Closing.

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-12-14 Thread Evgeny


Change by Evgeny :


--
keywords: +patch
pull_requests: +22618
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/22431

___
Python tracker 

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



[issue42306] wrong exception handling in case asyncio.shiled usage

2020-12-14 Thread Martin Natano


Martin Natano  added the comment:

I just verified that this is not an issue in python 3.8.6 and python 3.9.0. In 
those versions a normal stacktrace is generated, as expected.

--
nosy: +natano

___
Python tracker 

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



[issue42635] Incorrect line number in bytecode for nested loops

2020-12-14 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +22617
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/23761

___
Python tracker 

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



[issue42635] Incorrect line number in bytecode for nested loops

2020-12-14 Thread Mark Shannon


New submission from Mark Shannon :

The following code, when traced, produces a spurious line events at the end of 
the inner loop.


def dloop():
for i in range(3):
for j in range(3):
a = i + j
assert a == 4



Bug reported by Ned Batchelder 
https://gist.github.com/nedbat/6c5dedde9df8d2de13de8a6a39a5f112

--
assignee: Mark.Shannon
messages: 382968
nosy: Mark.Shannon, nedbat
priority: normal
severity: normal
stage: needs patch
status: open
title: Incorrect line number in bytecode for nested loops
type: behavior
versions: Python 3.10

___
Python tracker 

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



  1   2   >