[issue42563] max function reports type errors in incorrect order

2020-12-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is because the code of the main() function is roughly equivalent to result = next(iter) for item in iter: if item > result: result = item It can be changed to use "result < item" instead of "item > result", but it can has s

[issue42564] "from .__init__ import ..." syntax imports a duplicate module

2020-12-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Other example is: >>> import sys >>> import xml >>> import xml.__init__ >>> sys.modules['xml'] >>> sys.modules['xml.__init__'] >>> sys.modules['xml'] is sys.modules['xml.__init__'] False I'm not sure we should do anything about it other than say "Don't do

[issue42565] Traceback (most recent call last): File "", line 1, in NameError: name 'python' is not defined

2020-12-03 Thread Josh Rosenberg
Josh Rosenberg added the comment: Looks like someone tried to run python inside an interactive Python shell, rather than the command line. I'm moving to pending and will eventually close unless they add a repro for some actual bug. -- nosy: +josh.r status: open -> pending __

[issue42559] random.getrandbits: Should it be explicit that it returns unsigned/non-negative integer?

2020-12-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: Do you care to propose a minimal PR adding the word "unsigned"? Marking as low priority because the referenced docs are over a decade old and we've not seen a single case of someone being confused by it. -- assignee: -> rhettinger components: +Do

[issue42565] Traceback (most recent call last): File "", line 1, in NameError: name 'python' is not defined

2020-12-03 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : Please attach the program to reproduce the issue along with the full traceback in the issue body. It looks like you are trying to use a variable named 'python' which is not present at the given scope during execution. -- nosy: +xtreak typ

[issue42565] Traceback (most recent call last): File "", line 1, in NameError: name 'python' is not defined

2020-12-03 Thread Siva Krishna Giri Babu Avvaru
Change by Siva Krishna Giri Babu Avvaru : -- nosy: sivakrishnaavvaru priority: normal severity: normal status: open title: Traceback (most recent call last): File "", line 1, in NameError: name 'python' is not defined type: compile error versions: Python 3.9 ___

[issue42564] "from .__init__ import ..." syntax imports a duplicate module

2020-12-03 Thread Gregory Szorc
New submission from Gregory Szorc : (Rereporting from https://github.com/indygreg/PyOxidizer/issues/317.) $ mkdir foo $ cat > foo/__init__.py < test = True > EOF $ cat > foo/bar.py < from .__init__ import test > EOF $ python3.9 Python 3.9.0 (default, Nov 1 2020, 22:40:00) [GCC 10.2.0] on linux

[issue42563] max function reports type errors in incorrect order

2020-12-03 Thread Nicholas Kobald
New submission from Nicholas Kobald : I'm not _sure_ this is a bug, but I thought the behaviour was a bit odd. If you run max with a str and an int in different orders, you get this behaviour: >>> max(123, 'hello') Traceback (most recent call last): File "", line 1, in TypeError: '>' not s

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Brandt Bucher
Brandt Bucher added the comment: Adding: - collections.OrderedDict.items -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Brandt Bucher
Brandt Bucher added the comment: Yeah, I'm fine with that. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > I'll merge it and move on to similar PRs for the other affected stuff: Not sure if is more ergonomic, but I would prefer to fix this in one PR so the buildbots don't test the partial fixes. Also is easier to revert if something goes wrong with the

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Brandt Bucher
Brandt Bucher added the comment: Thanks for that detailed explanation, Pablo. If nobody objects to the current zip fix, I'll merge it and move on to similar PRs for the other affected stuff: - dict.items - enumerate - functools.reduce - itertools.product - itertools.combinations - itertools.

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I forgot to mention the conclusion: my conclusion is that although the GC is resilient to these shenanigans (it was also extensive validation along with the algorithm), I still prefer to track it on the next() call because is technically the right thi

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Or, if z's refcount drops to zero and it's cleaned up, its traverse function > may *never* be called, which leaves the untracked r -> o -> r cycle. This is a real problem, indeed. We would need to add the tracking to the tp_dealloc of the zip object

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

2020-12-03 Thread Jan Tojnar
Jan Tojnar added the comment: One benefit of using a compile time feature over a runtime method is that the former allows for more predictable dedenting by first dedenting and only then interpolating variables. For example, the following code does not dedent the test string at all: ```pytho

[issue17735] inspect.findsource raises IndexError

2020-12-03 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch pull_requests: +22502 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23633 ___ Python tracker ___ ___

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Brandt Bucher
Brandt Bucher added the comment: > I added some comments in the PR regarding the possibility of forcing the > tracking on the visiting function Thinking about this more, I'm a bit hesitant to put the re-tracking code in the traverse function (mostly stemming from my lack of knowledge about o

[issue42541] Tkinter colours wrong on MacOS universal2

2020-12-03 Thread Marc Culler
Marc Culler added the comment: Yes, I can provide a good commit ID to work with. Please give me a couple of days. The current tip is almost an ideal choice. There have been no Aqua bug reports for quite some time. But now there is one new one (from Kevin) so I'd like to fix that, discuss

[issue42562] dis failed to parse function that has only annotations

2020-12-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +Mark.Shannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue42562] dis failed to parse function that has only annotations

2020-12-03 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch pull_requests: +22501 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23632 ___ Python tracker

[issue42562] dis failed to parse function that has only annotations

2020-12-03 Thread Yurii Karabas
New submission from Yurii Karabas <1998uri...@gmail.com>: `dis` module failed when trying to parse function that has only annotations at the function body: ``` def foo(): a: int ``` Failed with stacktrace: ``` 1 0 LOAD_CONST 0 () 2 LOAD_CONST

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > The GC visit may happen when the refcount of the result tuple is > 1, but it > may drop back to 1 before __next__ called again Good point. Also, is it possible that a more complex cycle ends having more than one reference to that result, so indeed t

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Brandt Bucher
Brandt Bucher added the comment: > I added some comments in the PR regarding the possibility of forcing the > tracking on the visiting function to redirect the cost to gc passes instead > of when calling next()... Yep, I agree that this approach is better. > ...but there is another option:

[issue42561] better error reporting in ast

2020-12-03 Thread sds
New submission from sds : ast parsing error locations are hard to pinpoint. See https://stackoverflow.com/q/46933995/850781. -- components: Library (Lib) files: ast.diff keywords: patch messages: 382449 nosy: sam-s priority: normal severity: normal status: open title: better error repor

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > not untracking tuples that have refcount == 1. Actually, this may not be a good idea as well: running test_list shows that there are 14786 tuples with refcount == 1 that would have been untracked. This is a non-trivial workload to the gc passes that

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I added some comments in the PR regarding the possibility of forcing the tracking on the visiting function to redirect the cost to gc passes instead of when calling next() but there is another option: not untracking tuples that have refcount == 1. --

[issue42507] test_ttk_guionly test failures on macOS with Tcl/Tk 8.6.10

2020-12-03 Thread Ronald Oussoren
Ronald Oussoren added the comment: I might be able to debug during the weekend, but my main focus will be on back porting the changes in #41100 to the 3.8 branch (or at least parts of it). -- ___ Python tracker

[issue42507] test_ttk_guionly test failures on macOS with Tcl/Tk 8.6.10

2020-12-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All these failures point not on some details of appearance, but that the widget is not rendered at all. -- ___ Python tracker ___

[issue17735] inspect.findsource raises IndexError

2020-12-03 Thread Irit Katriel
Irit Katriel added the comment: Sorry, you're right - now the issue is when you remove functions from the module: >>> reload(x) >>> help(x) Traceback (most recent call last): File "", line 1, in File "C:\Users\User\src\cpython\\lib\_sitebuiltins.py", line 103, in __call__ return pyd

[issue17735] inspect.findsource raises IndexError

2020-12-03 Thread Irit Katriel
Irit Katriel added the comment: I'm unable to reproduce it now. Has it been fixed? >>> import x >>> help(x) Help on module x: NAME x FUNCTIONS func() FILE c:\users\user\src\cpython\x.py >>> from importlib import reload >>> reload(x) >>> help(x) Help on module x: NAME x

[issue42541] Tkinter colours wrong on MacOS universal2

2020-12-03 Thread Ned Deily
Ned Deily added the comment: I agree that moving forward (using an unreleased 8.6.10+ snapshot) is better than moving backwards (back to 8.6.9). Perhaps Marc or Kevin can suggest Tcl and Tk dev heads to use. -- nosy: +culler ___ Python tracker <

[issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur

2020-12-03 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'd prefer to (effectively) revert the PR and treat MACOSX_DEPLOYMENT_TARGET=11 the same as MACOSX_DEPLOYMENT_TARGET=11.0. The same issue has crept up on the wheel and packaging repos (in the context of changing the platform tag in wheel names). As I wrote

[issue42507] test_ttk_guionly test failures on macOS with Tcl/Tk 8.6.10

2020-12-03 Thread Ned Deily
Ned Deily added the comment: OK, thanks for the clarification, Terry. Considering that our tkinter tests make assumptions about the underlying Tk widgets behavior, assumptions not necessarily shared by the Tk developers :), these kind of version-dependent failures are a risk of and shortcomi

[issue42116] Inspect library ignore comments at the end of a function (inspect.getsource)

2020-12-03 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur

2020-12-03 Thread Ned Deily
Ned Deily added the comment: I agree with Ronald that it would be safest if the sysconfigs (all of them) always returned deployment target as a string and I would be fine with a PR that did that. That doesn't mean that the already applied PR needs to be changed, though, right? Just extra ins

[issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur

2020-12-03 Thread Ronald Oussoren
Ronald Oussoren added the comment: The value *for this key* is a dot separated sequence of integer labels in a string. The limit of that is a single integer label that could be converted to a Python int. With the current patch get_config_var('MACOSX_DEPLOYMENT_TARGET') mostly returns a str

[issue26582] asyncio documentation links to wrong CancelledError

2020-12-03 Thread Irit Katriel
Irit Katriel added the comment: I think this has been fixed in the docs by now. See for instance: https://docs.python.org/3/library/asyncio-task.html#asyncio.gather https://docs.python.org/3/library/asyncio-future.html#asyncio.Future.result -- nosy: +iritkatriel _

[issue42560] Improve Tkinter Documentation

2020-12-03 Thread Mason Ginter
New submission from Mason Ginter : Online python Tkinter documentation (https://docs.python.org/3/library/tkinter.html) lacks many features. The main part I find lacking is documentation on methods, as many of them either aren't listed in the documentation and/or take *args as the only parame

[issue42543] case sensitivity in open() arguments

2020-12-03 Thread Eric V. Smith
Eric V. Smith added the comment: Although I'm not sure the existing message needs changing, if a change is going to be made I think listing the valid option characters might be more useful. -- nosy: +eric.smith ___ Python tracker

[issue42508] macOS IDLE with Tk 8.6.10 in 3.9.1rc1 universal2 installer fails smoke test

2020-12-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: The new commit to PR 23577 works around the double run_module_event call. Removing the delay changed timings, so I instead measured the time between closing the errorbox and the 2nd call. The allowed difference had to be increased to .015, so I selected .0

[issue41915] unittest.mock.create_autospec(Obj, instance=True) has self keyword in _spec_signature if Obj implements __call__

2020-12-03 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue42559] random.getrandbits: Should it be explicit that it returns unsigned/non-negative integer?

2020-12-03 Thread Paul Sokolovsky
New submission from Paul Sokolovsky : Current docs for random.getrandbits() ( https://docs.python.org/3/library/random.html#random.getrandbits ) read (3.9.1rc1 at the top of the page): Returns a Python integer with k random bits. This method is supplied with the MersenneTwister generator and

[issue42541] Tkinter colours wrong on MacOS universal2

2020-12-03 Thread Ronald Oussoren
Ronald Oussoren added the comment: It is possible to opt out of dark mode using a key in the Info.plist file. This can also be used in the Python.app hidden in the framework to globally disable support for dark mode. I wouldn't switch back to 8.6.9, if only because that doesn't build properl

[issue42523] using windows doc incorrectly states version support

2020-12-03 Thread miss-islington
miss-islington added the comment: New changeset 3689c25a1010c2acdb05f1b1b0229f4766b4440a by Miss Islington (bot) in branch '3.9': bpo-42523: Fix supported versions in "Using Python on Windows" (GH-23603) https://github.com/python/cpython/commit/3689c25a1010c2acdb05f1b1b0229f4766b4440a -

[issue42523] using windows doc incorrectly states version support

2020-12-03 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue42523] using windows doc incorrectly states version support

2020-12-03 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +22500 pull_request: https://github.com/python/cpython/pull/23631 ___ Python tracker _

[issue42523] using windows doc incorrectly states version support

2020-12-03 Thread Steve Dower
Steve Dower added the comment: New changeset db68544122f5a0c7b80f69c0e643049efa6699c6 by Zackery Spytz in branch 'master': bpo-42523: Fix supported versions in "Using Python on Windows" (GH-23603) https://github.com/python/cpython/commit/db68544122f5a0c7b80f69c0e643049efa6699c6 --

[issue38630] subprocess.Popen.send_signal() should poll the process

2020-12-03 Thread Jack O'Connor
Jack O'Connor added the comment: Filed separately as https://bugs.python.org/issue42558. -- ___ Python tracker ___ ___ Python-bugs-

[issue42558] waitpid/waitid race caused by change to Popen.send_signal in Python 3.9

2020-12-03 Thread Jack O'Connor
New submission from Jack O'Connor : In Python 3.9, Popen.send_signal() was changed to call Popen.poll() internally before signaling. (Tracking bug: https://bugs.python.org/issue38630.) This is a best-effort check for the famous kill/wait race condition. However, because this can now reap an a

[issue42507] test_ttk_guionly test failures on macOS with Tcl/Tk 8.6.10

2020-12-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: The test may be correctly detecting a change in widget behavior. This is less surprising to me than some keypresses acting like two keypresses a millesecond apart. -- ___ Python tracker

[issue40550] Popen.terminate fails with ProcessLookupError under certain conditions

2020-12-03 Thread Jack O'Connor
Jack O'Connor added the comment: I'm late to the party, but I want to explain what's going on here in case it's helpful to folks. The issue you're seeing here has to do with whether a child processs has been "reaped". (Windows is different from Unix here, because the parent keeps an open han

[issue42541] Tkinter colours wrong on MacOS universal2

2020-12-03 Thread E. Paine
E. Paine added the comment: > we should at least opt out of dark mode for IDLE That still leaves tkinter almost unusable when dark mode is turned on. I am looking into solutions but am not hopeful (maybe we should ask Marc?). @Ned, what are the alternatives if we decide 8.6.10 is not the way

[issue42555] math function sqrt() not working in 3.9

2020-12-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: Mike, please ask questions on question forums such as python-list (mail.python.org) or stackoverflow.com, where other beginners can see the answer. Also, IDLE is not Python. In particular, python's response to code you send to python usually has nothing to

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Brandt Bucher
Brandt Bucher added the comment: functools.reduce looks affected, too. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42531] importlib.resources.path() raises TypeError for packages without __file__

2020-12-03 Thread William Schwartz
William Schwartz added the comment: > If the issue has been fixed on Python 3.9 but not on 3.8, then it was likely > a redesign that enabled the improved behavior That appears to be the case: path() shares code with files(). > a redesign that won't be ported back to Python 3.8 and earlier. N

[issue38261] Tkinter CheckButton default label white in macOS dark mode

2020-12-03 Thread Ronald Oussoren
Ronald Oussoren added the comment: This is a duplicate of #42541. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Tkinter colours wrong on MacOS universal2 ___ Python tracker

[issue42541] Tkinter colours wrong on MacOS universal2

2020-12-03 Thread Ronald Oussoren
Ronald Oussoren added the comment: This is a duplicate of #38261. I'm closing that other issue because this issue has more discussion. -- ___ Python tracker ___

[issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur

2020-12-03 Thread FX Coudert
FX Coudert added the comment: "It has always resulted in a string value": only MACOSX_DEPLOYMENT_TARGET always took the form of a non-integer. The code for sysconfig.get_config_var() has a pretty clear intent: it will try to cast its return value to an int. I don't have a strong opinion whet

[issue42557] Make asyncio.__main__ reusable, also adding a preamble feature.

2020-12-03 Thread Berry Schoenmakers
New submission from Berry Schoenmakers : The async REPL introduced in Python 3.8 is very nice for quick tests and experiments, supporting top-level "await" (see https://bugs.python.org/issue37028). I'm using it often when developing code that heavily relies on Python's asyncio module. A draw

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread Brandt Bucher
Brandt Bucher added the comment: > I add Pablo and Tim who love GC puzzles. Well, I don’t think the GC is really doing anything wrong here... untracking these sort of tuples likely results in a noticeable reduction in collection times. This code is definitely testing the limits of what is “ok

[issue42116] Inspect library ignore comments at the end of a function (inspect.getsource)

2020-12-03 Thread Irit Katriel
Irit Katriel added the comment: For reference - this script: - import inspect import tokenize from pprint import pprint as pp src=[ 'def f():\n', 'return 1\n', '#that was fun', '\n', '#Now comes g\n', 'def g():\n', 'return 2\n'] p

[issue42116] Inspect library ignore comments at the end of a function (inspect.getsource)

2020-12-03 Thread Irit Katriel
Irit Katriel added the comment: 1. For a comment line, the tokenizer emits a COMMENT token followed by an NL token for the newline. The inspect.BlockFinder.tokeneater increments its "last" field to the last line it identified as belonging to the code block. Currently it increments it when it

[issue36094] When using an SMTP SSL connection,, get ValueError.

2020-12-03 Thread Roundup Robot
Change by Roundup Robot : -- nosy: +python-dev nosy_count: 8.0 -> 9.0 pull_requests: +22499 pull_request: https://github.com/python/cpython/pull/23490 ___ Python tracker ___ __

[issue42116] Inspect library ignore comments at the end of a function (inspect.getsource)

2020-12-03 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch nosy: +iritkatriel nosy_count: 2.0 -> 3.0 pull_requests: +22498 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23630 ___ Python tracker _

[issue42556] unittest.mock.patch() cannot properly mock methods

2020-12-03 Thread Pierre Ossman
New submission from Pierre Ossman : unittest.mock.patch() as it currently works cannot properly mock a method as it currently replaces it with something more mimicking a function. I.e. the descriptor magic that includes "self" isn't properly set up. In most cases this doesn't really matter, b

[issue42554] distutils.util.get_platform() depends on minor version for macOS 11

2020-12-03 Thread FX Coudert
FX Coudert added the comment: Actually, I can find some distribution of Python where the minor version is returned, for example on Apple macOS 10.15.4: /usr/bin/python3 -c 'import distutils.util; print(distutils.util.get_platform())' macosx-10.14.6-x86_64 Therefore maybe I misunderstand an

[issue42553] test_asyncio: test_call_later() fails on Windows x64 GitHub Action

2020-12-03 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8, Python 3.9 ___ Python tracker ___

[issue42554] distutils.util.get_platform() depends on minor version for macOS 11

2020-12-03 Thread Ned Deily
Change by Ned Deily : -- components: +Distutils, macOS nosy: +dstufft, eric.araujo, ned.deily, ronaldoussoren ___ Python tracker ___ ___

[issue42553] test_asyncio: test_call_later() fails on Windows x64 GitHub Action

2020-12-03 Thread miss-islington
miss-islington added the comment: New changeset 9f26833cedd33439b11059d423f599982abeb180 by Miss Islington (bot) in branch '3.9': bpo-42553: Fix test_asyncio.test_call_later() (GH-23627) https://github.com/python/cpython/commit/9f26833cedd33439b11059d423f599982abeb180 -- __

[issue42555] math function sqrt() not working in 3.9

2020-12-03 Thread Christian Heimes
Christian Heimes added the comment: You have to import the math module first and then reference the sqrt function of the math module. >>> import math >>> math.sqrt(25) 5.0 -- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed ___

[issue42555] math function sqrt() not working in 3.9

2020-12-03 Thread mike dalrymple
New submission from mike dalrymple : Downloaded Python 3.9.0 Documentation indicates: math.sqrt(x) Return the square root of x. When I use in IDLE shell 3.9.0, I receive error: >>> sqrt(25) Traceback (most recent call last): File "", line 1, in sqrt(25) NameError: name 'sqrt' is not defi

[issue38780] SysLogHandler crash atexit

2020-12-03 Thread Alessio Bogon
Change by Alessio Bogon : -- nosy: +youtux ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue42553] test_asyncio: test_call_later() fails on Windows x64 GitHub Action

2020-12-03 Thread miss-islington
miss-islington added the comment: New changeset 930d5377c5877a631c3c23929e2cb6211bb0e2fb by Miss Islington (bot) in branch '3.8': bpo-42553: Fix test_asyncio.test_call_later() (GH-23627) https://github.com/python/cpython/commit/930d5377c5877a631c3c23929e2cb6211bb0e2fb -- __

[issue42554] distutils.util.get_platform() depends on minor version for macOS 11

2020-12-03 Thread FX Coudert
FX Coudert added the comment: What I think should be the logical solution to this bug: make distutils.util.get_platform() return "macosx-11-x86_64" on all Big Sur (macOS 11.x.y) versions, independent of the minor OS version. However, if the Python developers decide that this should not (for s

[issue42554] distutils.util.get_platform() depends on minor version for macOS 11

2020-12-03 Thread FX Coudert
New submission from FX Coudert : On macOS Big Sur (11.y.z), the return value of distutils.util.get_platform() records in some cases the minor version of OS. For example: - with a Python 3.9 built on macOS 10.0.1, distutils.util.get_platform() will return macosx-11.0-x86_64 - with a Python 3.9

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-12-03 Thread STINNER Victor
STINNER Victor added the comment: New changeset 8b6c4a921af6d5d0a9640211ac93d7886a55a8f3 by Victor Stinner in branch 'master': bpo-42262: Py_NewRef() casts its argument to PyObject* (GH-23626) https://github.com/python/cpython/commit/8b6c4a921af6d5d0a9640211ac93d7886a55a8f3 --

[issue42553] test_asyncio: test_call_later() fails on Windows x64 GitHub Action

2020-12-03 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7e5e13d113798117d5ef25c5ffdbd0eb39420f98 by Victor Stinner in branch 'master': bpo-42553: Fix test_asyncio.test_call_later() (GH-23627) https://github.com/python/cpython/commit/7e5e13d113798117d5ef25c5ffdbd0eb39420f98 -- _

[issue42553] test_asyncio: test_call_later() fails on Windows x64 GitHub Action

2020-12-03 Thread miss-islington
Change by miss-islington : -- pull_requests: +22497 pull_request: https://github.com/python/cpython/pull/23629 ___ Python tracker ___ __

[issue42553] test_asyncio: test_call_later() fails on Windows x64 GitHub Action

2020-12-03 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +22496 pull_request: https://github.com/python/cpython/pull/23628 ___ Python tracker _

[issue42411] respect cgroups limits when trying to allocate memory

2020-12-03 Thread Carlos Alexandro Becker
Carlos Alexandro Becker added the comment: Any updates? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue42553] test_asyncio: test_call_later() fails on Windows x64 GitHub Action

2020-12-03 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +22495 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23627 ___ Python tracker ___ _

[issue42545] Check that all symbols in the limited ABI are exported

2020-12-03 Thread Igor Skochinsky
Change by Igor Skochinsky : -- nosy: +Igor.Skochinsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue42553] test_asyncio: test_call_later() fails on Windows x64 GitHub Action

2020-12-03 Thread STINNER Victor
New submission from STINNER Victor : FAIL: test_call_later (test.test_asyncio.test_events.SelectEventLoopTests) -- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_asyncio\test_events.py", line 301,

[issue42532] spec_arg's __bool__ is called while initializing NonCallableMock

2020-12-03 Thread Idan Weiss
New submission from Idan Weiss : To reproduce: import unittest.mock class LogicInBool: def __bool__(self): print("In Bool!") return True class SomeClass: def __init__(self): self.logic_in_bool = LogicInBool() obj = SomeClass() with unittest.mock.patch.object(o

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-12-03 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22494 pull_request: https://github.com/python/cpython/pull/23626 ___ Python tracker ___ __

[issue42504] Failure to build with MACOSX_DEPLOYMENT_TARGET=11 on Big Sur

2020-12-03 Thread Ronald Oussoren
Ronald Oussoren added the comment: FWIW I don't agree with this fix. sys.get_config_var('MACOSX_DEPLOYMENT_TARGET') has always resulted in a string value. There's bound to be someone relying on this. As I wrote in comment on the PR a nicer fix is to teach sysconfig (and distutils.sysconfig

[issue42537] Implement built-in shorthand b() for breakpoint()

2020-12-03 Thread Qingyao Sun
Qingyao Sun added the comment: See https://mail.python.org/archives/list/python-id...@python.org/thread/6UAJRDKVJNZ7EACXUTUCKSGAEYPJHME5/ -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue42431] Fix outdated bytes comments

2020-12-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue42431] Fix outdated bytes comments

2020-12-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2ad93821a69e6efac3b0efe1d205d6e5ef030791 by Serhiy Storchaka in branch 'master': bpo-42431: Fix outdated bytes comments (GH-23458) https://github.com/python/cpython/commit/2ad93821a69e6efac3b0efe1d205d6e5ef030791 --

[issue42525] Optimize class/module level annotation

2020-12-03 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue42525] Optimize class/module level annotation

2020-12-03 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > For instance, we have such code: But what about this, what would the bytecode will look like in this case (where the annotations don't exactly follow each other?) a: int T = TypeVar('T') b: T b1: Gen[T] X = TypeVar('X') c: X d: str Do you propose to buil

[issue42552] Automatically set parent thread idents on thread start

2020-12-03 Thread gaborjbernat
New submission from gaborjbernat : I want to request automatically adding the current thread ident on the thread start as parent_ident. I would like this to be able to implement thread-local variables that inherit their values from the parent thread. See https://gist.github.com/gaborbernat/67

[issue38630] subprocess.Popen.send_signal() should poll the process

2020-12-03 Thread STINNER Victor
STINNER Victor added the comment: On Linux, a pidfd file descriptor can be created with os.pidfd_open() (added to Python 3.9). It would avoid even more race conditions. The best would be to request a pidfd file descriptor directly when we spawn the process which is possible on recent Linux k

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread STINNER Victor
STINNER Victor added the comment: The zip bug is quite old and was already tested by test_itertools for a very long time. Suddenly, it started to fail on more and more Refleaks buildbots. It may be because the GC must be triggered at a very specific point, and the default GC threshold trigge

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread STINNER Victor
STINNER Victor added the comment: I add Pablo and Tim who love GC puzzles. -- nosy: +pablogsal, tim.peters ___ Python tracker ___ _

[issue42525] Optimize class/module level annotation

2020-12-03 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: As all annotations are known at compilation time we can optimize annotations creating. For instance, we have such code: ``` a: int b: int ``` With the current implementation, we will have such bytecode: ``` 1 0 SETUP_ANNOTATI

[issue31990] Pickling deadlocks in thread with python -m

2020-12-03 Thread Werner Smidt
Werner Smidt added the comment: Thanks for going to the trouble, Sara. Curiosity remains, but I'll mark this as closed. -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: > Why there are cycles at all? In normal case there should not be cycle and the > result tuple should be destroyed when the iteration ends. test_itertools creates a reference cycle *on purpose*. See test_zip_leak2.py simplified code, it co

[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

2020-12-03 Thread STINNER Victor
STINNER Victor added the comment: test_zip_leak2.py: simplified example to trigger the GC issue. Copy it to Lib/test/ and reproduce the leak with: ./python -m test -R 3:3 test_zip_leak2 Extract of the code: --- container = [] iterator = zip([container], [container]) # untrack the intern

[issue42328] ttk style.map function incorrectly handles the default state for element options.

2020-12-03 Thread miss-islington
miss-islington added the comment: New changeset ae67db6b314e297a1b67ed15c0bb560b8ce5b856 by Miss Islington (bot) in branch '3.9': bpo-42328: Skip some tests with themes vista and xpnative on Windows 7 (GH-23612) https://github.com/python/cpython/commit/ae67db6b314e297a1b67ed15c0bb560b8ce5b85

  1   2   >