[issue46493] Add an API to indicate if the process might have multiple threads

2022-01-23 Thread Gregory P. Smith
New submission from Gregory P. Smith : It'd be handy to have a function to determine if there are multiple threads in the current process or not - at least on POSIXish systems. This would be useful anytime a library is trying to use os.fork(), as fork() is not safe in a multi-threaded proces

[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: > With the current design, it isn't possible though because the code objects > are modified in place so if co_quickened is freed the VM still tries to > execute the copied instructions. Or the cleanup code could also restore co_firstinstr and other things

[issue46376] PyMapping_Check returns 1 for list

2022-01-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would really like this to be left alone. We've been without a reliable version for over a decade. That is strong evidence that we really don't need this unless it can be done perfectly (which it can't). Also, PyMapping_Check is just a CPython specif

[issue46486] Rename DesciptorClassification => DescriptorClassification in specialize.c

2022-01-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset d1beb241d9bdf912682bc8323a59c052f99b82a8 by Kumar Aditya in branch 'main': bpo-46486: Fixed misspelled name DesciptorClassification https://github.com/python/cpython/commit/d1beb241d9bdf912682bc8323a59c052f99b82a8 -- nosy: +rhetting

[issue46486] Rename DesciptorClassification => DescriptorClassification in specialize.c

2022-01-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for noticing this and submitting a PR. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker _

[issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time.

2022-01-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Presumably the OP is referring to this text: """ `powerloop()` emulates these divisions, 1 bit at a time, using comparisons, subtractions, and shifts in a loop. You'll notice the paper uses an O(1) method instead, but that relies on two things we don't hav

[issue5404] Cross-compiling CPython - need a buildbot

2022-01-23 Thread Gregory P. Smith
Change by Gregory P. Smith : -- title: Cross-compiling Python -> Cross-compiling CPython - need a buildbot versions: +Python 3.11 -Python 3.4 ___ Python tracker ___

[issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time.

2022-01-23 Thread Barry Schwartz
Barry Schwartz added the comment: Yes. Actually the issue is branching, not order of complexity, because looping at most 64 times is a linear-bounded operation. The methods I point out involve no branching! And so can be rather fast. I don't suggest they be used, but that the listsort.txt be

[issue37295] Possible optimizations for math.comb()

2022-01-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: > But I won't post code (unless someone asks) Okay, I'll ask. -- ___ Python tracker ___ ___ P

[issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time.

2022-01-23 Thread Tim Peters
Tim Peters added the comment: I'm not inclined to change anything here. It's a trivial point, and by "primitive" I had in mind a dedicated hardware instruction, blazing fast. Yes, I was aware of long-winded ways of doing it for specific fixed integer widths. But that's not what `O(1)` means.

[issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time.

2022-01-23 Thread Barry Schwartz
Barry Schwartz added the comment: I meant constant bounded -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37295] Possible optimizations for math.comb()

2022-01-23 Thread Tim Peters
Tim Peters added the comment: OK, here's the last version I had. Preconditions are that d > 0, n > 0, and n % d == 0. This version tries to use the narrowest possible integers on each step. The lowermost `good_bits` of dinv at the start of the loop are correct already. Taking out all the mo

[issue46475] typing.Never and typing.assert_never

2022-01-23 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +29023 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30842 ___ Python tracker ___ _

[issue40771] Add a platform neutral version of localtime/gmtime

2022-01-23 Thread Irit Katriel
Change by Irit Katriel : -- title: python3 fromtimestamp generates OSError -> Add a platform neutral version of localtime/gmtime type: behavior -> enhancement versions: +Python 3.11 -Python 3.10 ___ Python tracker

[issue34429] [doc] On Windows tempfile.TemporaryFile behaves like NamedTemporaryFile

2022-01-23 Thread Irit Katriel
Irit Katriel added the comment: The docs and the code are the same now. I would add just the first half of the suggested sentence: "On platforms that are neither Posix nor Cygwin, TemporaryFile behaves exactly like NamedTemporaryFile". -- keywords: +easy nosy: +iritkatriel title: On

[issue40356] OverflowError: mktime argument out of range

2022-01-23 Thread Irit Katriel
Irit Katriel added the comment: 3.7 is no longer maintained. I was unable to reproduce this on 3.11 on windows or Mac. Please create a new issue if you are still seeing this on a current version. -- nosy: +iritkatriel resolution: -> works for me stage: -> resolved status: open ->

[issue42091] strftime returns empty string for -d, -I 3.8.3

2022-01-23 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-b

[issue40674] Deprecate urllib.request.urlretrieve() and cleanup()

2022-01-23 Thread Irit Katriel
New submission from Irit Katriel : Remi, there is no background for this here or on the PR. Can you explain the reason for deprecating them? -- nosy: +iritkatriel ___ Python tracker _

[issue46480] Implement typing.assert_type

2022-01-23 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- keywords: +patch pull_requests: +29024 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30843 ___ Python tracker ___ _

[issue46494] Mention typing_extensions in the typing documentation

2022-01-23 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : I've often seen people say things like "I can't use TypeGuard yet, I'm stuck on 3.9". That's not true, because the typing_extensions package backports all typing features to all supported Python versions. To help make people aware of this option, we should

[issue46494] Mention typing_extensions in the typing documentation

2022-01-23 Thread Alex Waygood
Alex Waygood added the comment: Sounds like a great idea. I like the idea of putting it in the "Relevant PEPs" section, as that section already details how the typing module has evolved over the past few major versions of Python. -- ___ Python tra

[issue45193] IDLE Show completions pop-up not working on Ubuntu Linux

2022-01-23 Thread Tal Einat
Change by Tal Einat : -- pull_requests: +29025 pull_request: https://github.com/python/cpython/pull/28332 ___ Python tracker ___ ___

[issue33822] IDLE subsection of What's New 3.8

2022-01-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Backports to 3.8 ended when it went on security status about June 1, 2021. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46490] Add "follow_symlinks=False" support for "os.utime()" on Windows

2022-01-23 Thread Eryk Sun
Eryk Sun added the comment: The Windows API doesn't directly support opening a 'symlink' as Python defines it for the follow_symlinks parameter. That problem should be resolved in a separate issue. Then updating os.utime() would be relatively trivial. -- components: +Windows nosy: +e

[issue41844] IDLE subsection of What's New 3.9

2022-01-23 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: +Python 3.11 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue41846] IDLE subsection of What's New 3.10

2022-01-23 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: +Python 3.11 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue46495] IDLE subsection of What's New 3.11

2022-01-23 Thread Terry J. Reedy
New submission from Terry J. Reedy : Following #41846, master issue for IDLE entries in Doc/whatsnew/3.11.rst. When appropriate, add subsection 'idlelib and IDLE' to 'Improved Modules' The initial entries include important enhancements to IDLE since 3.10.0. (Anything included in 3.10.0 does

[issue41846] IDLE subsection of What's New 3.10

2022-01-23 Thread Terry J. Reedy
Change by Terry J. Reedy : -- superseder: -> IDLE subsection of What's New 3.11 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46496] idlelib/NEWS.txt for 3.11.0 and backports

2022-01-23 Thread Terry J. Reedy
New submission from Terry J. Reedy : Main became 3.11 as of 3.10.0 beta 1: 2021-05-03. However, backported IDLE issues continued going under What's New 3.10 on both main and 3.10 until 3.10.0rc1, 2021-08-03. Subsequent idlelib/NEWS.txt items go under What's New 3.11.0 on main branch What's New 3

[issue33983] unify types for lib2to3.pytree.Base.children

2022-01-23 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: lib2to3 is deprecated as of Python 3.11, and there's an available workaround. I don't think it still makes sense to change anything here. -- nosy: +Jelle Zijlstra resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___

[issue41841] idlelib/NEWS.txt for 3.10.0 and backports

2022-01-23 Thread Terry J. Reedy
Change by Terry J. Reedy : -- superseder: -> IDLE subsection of What's New 3.11 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46497] IDLE macOS shortcut ctrl+S doesn’t work for show completions

2022-01-23 Thread David Contreras
New submission from David Contreras : I noticed that selecting Edit>Show Completions works as expected on Python 3.10.2 and macOS 12.1 after issue 40128 was resolved. But trying the default keyboard shortcut ctrl+S only highlights the edit menu but doesn't work. I understand that it's suppose

[issue22859] unittest.TestProgram.usageExit no longer invoked

2022-01-23 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I suggest we mark the method as deprecated and remove it in 3.13. Making the argparse objects public can be done in a separate enhancement request if there is demand for it. -- nosy: +Jelle Zijlstra ___ Python tra

[issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders

2022-01-23 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: If the old code is incorrect, can you give an example where it fails? Is it possible to write a unit test demonstrating that the current behavior is wrong? -- nosy: +Jelle Zijlstra ___ Python tracker

[issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time.

2022-01-23 Thread Tim Peters
Tim Peters added the comment: For any fixed width integer type, the worst case of the dead simple loop (all bits are zero) is a fixed upper bound. So you don't mean "constant bounded" either. You mean something more like "clever C code that usually runs faster than the obvious loop". See my

[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-23 Thread Kumar Aditya
Kumar Aditya added the comment: > Kumar, I'm not sure I follow your concerns about the bootstrap working > differently on Windows than on Unix. Is the problem that on Unix the > bootstrap interpreter is linked without deepfreeze.c so there is no > definition of the symbol _Py_Deepfreeze_Fini

[issue46498] Add new triplets for loongarch64

2022-01-23 Thread Zhang Na
Change by Zhang Na : -- components: Build files: loongarch64.diff keywords: patch nosy: zhangna01 priority: normal severity: normal status: open title: Add new triplets for loongarch64 type: compile error versions: Python 3.9 Added file: https://bugs.python.org/file50579/loongarch64.dif

[issue45860] UnboundLocalError leads to Illegal instruction crashing CPython

2022-01-23 Thread Xinmeng Xia
Xinmeng Xia added the comment: A simpler example to reproduce it: test.py import threading import ctypes from test import test_code def test_free_different_thread(): f = test_code.CoExtra().get_func() class ThreadTest(threading.Thread):

[issue45860] Mutithread leads to Illegal instruction crashing CPython

2022-01-23 Thread Xinmeng Xia
Change by Xinmeng Xia : -- title: UnboundLocalError leads to Illegal instruction crashing CPython -> Mutithread leads to Illegal instruction crashing CPython ___ Python tracker __

[issue46499] circular impoty

2022-01-23 Thread shukurulloxkomiljonov
New submission from shukurulloxkomiljonov : ImportError: cannot import name 'Db' from partially initialized module 'orm_model.db' (most likely due to a circular import) (C:\Users\Komil\OneDrive\Desktop\mymodel\orm_model\db.py) I am making al library! I have model.py and db.py in db.py has c

[issue46488] listsort.txt wrongly assumes you cannot calculate leading zeros in O(1) time.

2022-01-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pyt

[issue46500] make timeit module accept files

2022-01-23 Thread Arjun
New submission from Arjun : currently, timeit accepts programs line by line as commandline arguments. it would be convenient to give it a program as a file to benchmark. -- components: Library (Lib) messages: 411448 nosy: CCLDArjun priority: normal severity: normal status: open title:

[issue46500] make timeit module accept files

2022-01-23 Thread Arjun
Change by Arjun : -- keywords: +patch pull_requests: +29026 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30844 ___ Python tracker ___ __

[issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor

2022-01-23 Thread Gregory P. Smith
Gregory P. Smith added the comment: [bpo-46464](https://bugs.python.org/issue46464) describes a deadlock that the pre-requisite for this feature causes. Spawning new children directly via fork() is impossible once a thread in the parent process has been started and concurrent.futures.process

[issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor

2022-01-23 Thread Gregory P. Smith
Gregory P. Smith added the comment: If we want this feature to stay in, it needs an implementation that does not rely on a multithreaded processing calling fork(). I'm going to have to revert the existing implementation for bpo-46464. -- stage: resolved -> needs patch status: closed

[issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor

2022-01-23 Thread Gregory P. Smith
Change by Gregory P. Smith : -- assignee: -> gregory.p.smith resolution: fixed -> ___ Python tracker ___ ___ Python-bugs-list mail

[issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used

2022-01-23 Thread Gregory P. Smith
Gregory P. Smith added the comment: https://bugs.python.org/issue44733 for 3.11 attempts to build upon the dynamic spawning ability and will need reverting unless a non-thread+fork implementation is provided. -- ___ Python tracker

[issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor

2022-01-23 Thread Ram Rachum
Ram Rachum added the comment: Oh that sucks. Logan and Antoine worked on this feature for so long. Thanks for reporting Greg. -- ___ Python tracker ___ __

<    1   2