summaryrefslogtreecommitdiffstats
path: root/Misc
Commit message (Collapse)AuthorAgeFilesLines
* gh-53203: Fix strptime() for %c and %x formats on many locales (GH-124946)Serhiy Storchaka2024-10-121-0/+5
| | | | | | | | | | | | | | | | | | | In some locales (like French or Hebrew) the full or abbreviated names of the default month and weekday used in __calc_date_time can be part of other name or constant part of the %c format. The month name can also match %m with constant suffix (like in Japanese). So the code failed to correctly distinguish formats %a, %A, %b, %B and %m. Cycle all month and all days of the week to find the variable part and distinguish %a from %A and %b from %B or %m. Fixed locales for the following languges: Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish, Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol, Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi, Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese. Co-authored-by: Eli Bendersky <eliben@gmail.com>
* gh-125260: Change the default ``gzip.compress()`` mtime to 0 (#125261)Bernhard M. Wiedemann2024-10-121-0/+2
| | | | | | | | | This follows GNU gzip, which defaults to using 0 as the mtime for compressing stdin, where no file mtime is involved. This makes the output of gzip.compress() deterministic by default, greatly helping reproducible builds. Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-85935: Check for nargs=0 for positional arguments in argparse (GH-124839)Serhiy Storchaka2024-10-121-0/+4
| | | | | | Raise ValueError in add_argument() if either explicit nargs=0 or action that does not consume arguments (like 'store_const' or 'store_true') is specified for positional argument.
* gh-125254: Fix error report about ambiguous option in argparse (GH-125273)Serhiy Storchaka2024-10-121-0/+1
| | | | | This was a regression introduced in gh-58573. It was only tested for the case when the ambiguous option is the last argument in the command line.
* gh-65865: Raise early errors for invalid help strings in argparse (GH-124899)Serhiy Storchaka2024-10-121-0/+3
|
* gh-124309: fix staggered race on eager tasks (#124847)Thomas Grainger2024-10-111-0/+1
| | | | | | | This patch is entirely by Thomas and Peter Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* gh-124917: Allow keyword args to os.path.exists/lexists on Windows (#124918)Jelle Zijlstra2024-10-111-0/+2
|
* gh-124787: Fix `TypeAliasType` and incorrect `type_params` (#124795)sobolevn2024-10-111-0/+4
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-125235: Keep `_tkinter` TCL paths pointing to base installation on ↵Y52024-10-111-0/+2
| | | | | Windows (#125250) Signed-off-by: y5c4l3 <y5c4l3@proton.me>
* gh-61011: Fix inheritance of nested mutually exclusive groups in argparse ↵Serhiy Storchaka2024-10-112-0/+5
| | | | | | | | | (GH-125210) Previously, all nested mutually exclusive groups lost their connection to the group containing them and were displayed as belonging directly to the parser. Co-authored-by: Danica J. Sutherland <djsutherland@users.noreply.github.com>
* gh-125221: Fix free-threading data race in `object.__reduce_ex__` (#125267)Sam Gross2024-10-111-0/+2
|
* gh-124872: Rename blurb file to reference the correct issue (#125285)Richard Hansen2024-10-111-0/+0
|
* GH-125174: Make immortal objects more robust, following design from PEP 683 ↵Mark Shannon2024-10-101-0/+4
| | | | (GH-125251)
* gh-125118: don't copy arbitrary values to _Bool in the struct module (GH-125169)Sergey B Kirpichev2024-10-101-0/+1
| | | | | | | | | | | memcopy'ing arbitrary values to _Bool variable triggers undefined behaviour. Avoid this. We assume that `false` is represented by all zero bytes. Credits to Alex Gaynor. Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-124872: Refine contextvars documentation (#124773)Richard Hansen2024-10-091-0/+3
| | | | | | | | | | | | | * Add definitions for "context", "current context", and "context management protocol". * Update related definitions to be consistent with the new definitions. * Restructure the documentation for the `contextvars.Context` class to prepare for adding context manager support, and for consistency with the definitions. * Use `testcode` and `testoutput` to test the `Context.run` example. * Expand the documentation for the `Py_CONTEXT_EVENT_ENTER` and `Py_CONTEXT_EVENT_EXIT` events to clarify and to prepare for planned changes.
* gh-125140: Remove the current directory from sys.path when using pyrepl ↵Pablo Galindo Salgado2024-10-091-0/+1
| | | | | | | (GH-125212) Signed-off-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* GH-124693: Support parsing negative scientific and complex numbers argparse ↵Savannah Ostrowski2024-10-091-0/+1
| | | | | (GH-124823) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-91818: Use default program name in the CLI of many modules (GH-124867)Serhiy Storchaka2024-10-091-0/+4
| | | | | | As argparse now detects by default when the code was run as a module. This leads to using the actual executable name instead of simply "python" to display in the usage message ("usage: python -m ...").
* gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865)Eric Snow2024-10-091-0/+5
| | | | | | | | | | Fix a crash caused by immortal interned strings being shared between sub-interpreters that use basic single-phase init. In that case, the string can be used by an interpreter that outlives the interpreter that created and interned it. For interpreters that share obmalloc state, also share the interned dict with the main interpreter. This is an un-revert of gh-124646 that then addresses the Py_TRACE_REFS failures identified by gh-124785.
* gh-125039: Make `this_instr`/`prev_instr` const in cases generator (GH-125071)Tomas R.2024-10-091-0/+1
|
* gh-101100: Consolidate documentation on `ModuleType` attributes (#124709)Alex Waygood2024-10-094-8/+8
| | | | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Barry Warsaw <barry@python.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-107562: make_ssl_certs.py: produce test certificates that expire far in ↵Alexander Kanavin2024-10-091-0/+3
| | | | | | | | | the future by default (GH-107594) This allows testing Y2038 with system time set to after that, so that actual Y2038 issues can be exposed, and not masked by expired certificate errors. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
* gh-124969: Fix locale.nl_langinfo(locale.ALT_DIGITS) (GH-124974)Serhiy Storchaka2024-10-091-0/+3
| | | | | Now it returns a tuple of up to 100 strings (an empty tuple on most locales). Previously it returned the first item of that tuple or an empty string.
* gh-101552: Allow pydoc to display signatures in source format (#124669)Jelle Zijlstra2024-10-091-0/+4
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-116110: remove extra processing for the __signature__ attribute (GH-116234)Sergey B Kirpichev2024-10-081-0/+3
| | | This is an alternative to GH-100168.
* gh-125096: Don't import _pyrepl in site if PYTHON_BASIC_REPL (#125097)Victor Stinner2024-10-081-0/+5
| | | | | | | If the PYTHON_BASIC_REPL environment variable is set, the site module no longer imports the _pyrepl module. Moreover, the site module now respects -E and -I command line options: ignore PYTHON_BASIC_REPL in this case.
* gh-123961: Convert _curses to a multi-phase init module (PEP-489) (#124965)Bénédikt Tran2024-10-081-0/+2
|
* gh-123378: fix a crash in `UnicodeError.__str__` (#124935)Bénédikt Tran2024-10-081-0/+3
|
* bpo-34206: Improve docs and test coverage for pre-init functions (#8023)Alyssa Coghlan2024-10-082-0/+10
| | | | | | | | | | | | | | | | | | | | - move the Py_Main documentation from the very high level API section to the initialization and finalization section - make it clear that it encapsulates a full Py_Initialize/Finalize cycle of its own - point out that exactly which settings will be read and applied correctly when Py_Main is called after a separate runtime initialization call is version dependent - be explicit that Py_IsInitialized can be called prior to initialization - actually test that Py_IsInitialized can be called prior to initialization - flush stdout in the embedding tests that run code so it appears in the expected order when running with "-vv" - make "-vv" on the subinterpreter embedding tests less spammy --------- Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-69998: Fix decoding error in locale.nl_langinfo() (GH-124963)Serhiy Storchaka2024-10-081-0/+3
| | | | | | | The function now sets temporarily the LC_CTYPE locale to the locale of the category that determines the requested value if the locales are different and the resulting string is non-ASCII. This temporary change affects other threads.
* gh-70870: Clarify dual usage of 'free variable' (#122545)Alyssa Coghlan2024-10-081-0/+3
| | | | | | | | | | | | | | The term "free variable" has unfortunately become genuinely ambiguous over the years (presumably due to the names of some relevant code object instance attributes). While we can't eliminate that ambiguity at this late date, we can at least alert people to the potential ambiguity by describing both the formal meaning of the term and the common alternative use as a direct synonym for "closure variable". --------- Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-90102: Remove isatty call during regular open (#124922)Cody Maloney2024-10-081-0/+3
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-124502: Add PyUnicode_Equal() function (#124504)Victor Stinner2024-10-072-0/+4
|
* gh-122392: IDLE - Fix overlapping lines in browsers (#122392) (#124975)Zhikang Yan2024-10-071-0/+2
| | | | | | | Increase currently inadequate vertical spacing for the IDLE browsers (path, module, and stack) on high-resolution monitors. --------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* gh-124653: Relax (again) detection of queue API for logging handlers ↵Bénédikt Tran2024-10-071-0/+2
| | | | (GH-124897)
* gh-125018: Add importlib.metadata semantic link targets (#125027)Alyssa Coghlan2024-10-071-0/+4
| | | | | | | | | This allows direct intersphinx references to APIs via references like `` :func:`importlib.metadata.version` ``. --------- Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-121249: Support _Complex types in the struct module (#121613)Sergey B Kirpichev2024-10-071-0/+3
| | | | | Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-125008: Fix `tokenize.untokenize` roundtrip for `\n{{` (#125013)Tomas R.2024-10-061-0/+2
|
* gh-124552 : Improve the accuracy of possible breakpoint check in bdb (#124553)Tian Gao2024-10-051-0/+1
|
* gh-117151: increase default buffer size of shutil.copyfileobj() to 256k. ↵morotti2024-10-041-0/+3
| | | | | | | | | | | | | | | | | | | | (GH-119783) * gh-117151: increase default buffer size of shutil.copyfileobj() to 256k. it was set to 16k in the 1990s. it was raised to 64k in 2019. the discussion at the time mentioned another 5% improvement by raising to 128k and settled for a very conservative setting. it's 2024 now, I think it should be revisited to match modern hardware. I am measuring 0-15% performance improvement when raising to 256k on various types of disk. there is no downside as far as I can tell. this function is only intended for sequential copy of full files (or file like objects). it's the typical use case that benefits from larger operations. for reference, I came across this function while trying to profile pip that is using it to copy files when installing python packages. * add news --------- Co-authored-by: rmorotti <romain.morotti@man.com>
* gh-124871: fix 'visited' tracking in compiler's reachability analysis (#124952)Irit Katriel2024-10-041-0/+2
|
* gh-123961: Convert `curses.window` static type into a heap type (#124934)Bénédikt Tran2024-10-041-0/+3
|
* gh-124858: fix happy eyeballs refcyles (#124859)Thomas Grainger2024-10-021-0/+1
|
* GH-118093: Don't lose confidence when tracing through 100% biased branches ↵Brandt Bucher2024-10-021-0/+2
| | | | (GH-124813)
* GH-119726: Deduplicate AArch64 trampolines within a trace (GH-123872)Diego Russo2024-10-021-0/+2
|
* gh-87135: Hang non-main threads that attempt to acquire the GIL during ↵Jeremy Maitin-Shepard2024-10-021-0/+15
| | | | | | | finalization (GH-105805) Instead of surprise crashes and memory corruption, we now hang threads that attempt to re-enter the Python interpreter after Python runtime finalization has started. These are typically daemon threads (our long standing mis-feature) but could also be threads spawned by extension modules that then try to call into Python. This marks the `PyThread_exit_thread` public C API as deprecated as there is no plausible safe way to accomplish that on any supported platform in the face of things like C++ code with finalizers anywhere on a thread's stack. Doing this was the least bad option. Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-120378: Fix crash caused by integer overflow in `curses` (#124555)Peter Bierma2024-10-021-0/+2
| | | | | | | | | This is actually an upstream problem in curses, and has been reported to them already: https://lists.gnu.org/archive/html/bug-ncurses/2024-09/msg00101.html This is a nice workaround in the meantime to prevent the segfault. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-58282: Fix support of tuple metavar for positional arguments in argparse ↵Serhiy Storchaka2024-10-021-0/+2
| | | | | | | | (GH-124782) Previously, formatting help output or error message for positional argument with a tuple metavar raised exception. Co-authored-by: Cyker Way <cykerway@gmail.com>
* gh-124835: `tomllib.loads`: Raise TypeError not AttributeError. Improve ↵Taneli Hukkinen2024-10-021-0/+3
| | | | message (#124587)
* gh-66436: Improved prog default value for argparse.ArgumentParser (GH-124799)Serhiy Storchaka2024-10-011-0/+4
| | | | | | | | | It can now have one of three forms: * basename(argv0) -- for simple scripts * python arv0 -- for directories, ZIP files, etc * python -m module -- for imported modules Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>