repo stringclasses 1
value | instance_id stringlengths 20 22 | problem_statement stringlengths 126 60.8k | merge_commit stringlengths 40 40 | base_commit stringlengths 40 40 |
|---|---|---|---|---|
python/cpython | python__cpython-113128 | # `TemporaryDirectory.__exit__` sometimes raises bad PermissionError
# Bug report
`TemporaryDirectory.__exit__` usually raises PermissionError if another process keeping a handle to a file in the tmp directory has just finished its execution.
### Bug description:
Please consider the following block of code:
... | 4026ad5b2c595b855a3605420cfa0e3d49e63db7 | d1a2adfb0820ee730fa3e4bbc4bd88a67aa50666 |
python/cpython | python__cpython-113085 | # argparse drops "|" when a positional, then a special "-" argument (order-sensitive), are defined in a mutually exclusive group
# Bug report
### Bug description:
I'm defining a argparse parser that works like vim:
> support a file as a positional:
> ```shell
> vim file.py
> ```
> or reading from stdin:
... | d21b0b5d36834d4d35aec3a01661597019594936 | 4a5e4aade420c594c5b3fe0589e9e6b444bd6ee5 |
python/cpython | python__cpython-113000 | # Replace the outdated "deprecated" directives with "versionchanged"
In few cases the **deprecated** directive was left after the end of the deprecation period and removing the deprecated features. The **versionchanged** directive is more appropriate here.
<!-- gh-linked-prs -->
### Linked PRs
* gh-113000
* gh-113019... | fe9991bb672dd95fb9cd38b5a03180719ac4e722 | eafc2381a0b891383098b08300ae766868a19ba6 |
python/cpython | python__cpython-115667 | # Asyncio exception handling breaks convention by logging callback parameter values
# Bug report
### Bug description:
My understanding is that Python usually does not attempt to log or show parameter and variable values when errors occur. It seems uncharacteristic that asyncio does so, e.g. when it handles uncaught ... | 5a1559d9493dd298a08c4be32b52295aa3eb89e5 | a355f60b032306651ca27bc53bbb82eb5106ff71 |
python/cpython | python__cpython-112991 | # Calling loop.sock_connect has a KeyError exception in the success path
# Bug report
### Bug description:
Similar to #106527 and #106664
```python
loop.sock_connect()
```
https://github.com/python/cpython/blob/616622cab7200bac476bf753d6cc98f4ee48808c/Lib/asyncio/selector_events.py#L266
<img width="1252... | 7e2d93f30b157e414924c32232bb748c8f66c828 | a3c031884d2f16d84aacc3f733c047b3a6cae208 |
python/cpython | python__cpython-113129 | # Build changes for Windows free-threaded builds
We should use a different `$(IntDir)` and `$(OutDir)` for free threaded builds so that it's faster to switch between them and so they can be built in parallel.
The output filename should be `python{major}.{minor}t.exe` and `python{major}{minor}t.dll`. Debug builds ar... | f56d132deb9fff861439ed56ed7414d22e4e4bb9 | 78fcde039a33d8463e34356d5462fecee0f2831a |
python/cpython | python__cpython-112985 | # Add magic number of 3.11 final bytecode
# Bug report
### Bug description:
The magic number 3495 of Python 3.11 final is somehow magically disappeared from main branch.
It's there in all 3.11.x:
https://github.com/python/cpython/blob/v3.11.0/Lib/importlib/_bootstrap_external.py#L406
...
https://github.com/python/... | 616622cab7200bac476bf753d6cc98f4ee48808c | 5b8664433829ea967c150363cf49a5c4c1380fe8 |
python/cpython | python__cpython-112979 | # Remove redundant condition inside `take_gil`
Based on discussion: https://discuss.python.org/t/redundant-condition-inside-take-gil-function/40882
<!-- gh-linked-prs -->
### Linked PRs
* gh-112979
<!-- /gh-linked-prs -->
| fed294c6453527addd1644633849e2d8492058c5 | 1c5fc02fd0576be125638a5261be12eb3224be81 |
python/cpython | python__cpython-112969 | # closefrom check is too strict
# Bug report
### Bug description:
`closefrom(3)` is available with >=glibc-2.34 on Linux (and Hurd, but, well...)
The check in `Python/fileutils.c` is a bit too strict, as it hardcodes FreeBSD. This excludes both the aforementioned systems but also other BSDs where I believe it's ava... | c454e934d36193709aadba8e8e28739790086b95 | 0d2fe6bab01541301abe98a23ee15a16f493fe74 |
python/cpython | python__cpython-113016 | # Make cache information a part of dis.Instruction
# Feature or enhancement
We currently create fake Instruction objects to represent cache entries. It would make more sense to make the cache info part of the Instruction.
This will change the output of ``dis.get_instructions``, but not anything which is documented.... | 428c9812cb4ff3521e5904719224fe63fba5370a | 3531ea441b8b76bff90d2ecc062335da65fd3341 |
python/cpython | python__cpython-112988 | # idlelib/News3.txt for 3.13.0 and backports
Branch 'main' became 3.13.0a0 as of 3.12.0 beta 1: 2023-05-22
However, unless an patch is not backported to 3.12.b#, idlelib/News3.txt items continue going under
What's New in IDLE 3.12.0 on both main and 3.12 until 3.12.0rc?, 2023-08 or so. (None for 3.12.0b_.)
Subsequ... | e0fb7004ede71389c9dd462cd03352cc3c3a4d8c | 616622cab7200bac476bf753d6cc98f4ee48808c |
python/cpython | python__cpython-112950 | # Make `pdb` completion similar to repl completion
# Feature or enhancement
### Proposal:
Currently there are a couple of issues with `pdb`'s completion:
1. It does not know about built-in functions like repl. So `pri\t` won't complete to `print`.
2. Disabling of completion in multi-line mode is a bit too strong - ... | 01e7405da400e8997f8964d06cc414045e144681 | 9db2a8f914ad59019d448cecc43b6d45f46424a0 |
python/cpython | python__cpython-112949 | # Change in tokenize.generate_tokens behaviour with non-ASCII
# Bug report
### Bug description:
This docstring has non-ASCII characters:
```python
import io
import tokenize
src = '''\
def thing():
"""Autorzy, którzy tą jednostkę mają wpisani jako AKTUALNA -- czyli
aktualni pracownicy, obecni pracownicy"""
... | a135a6d2c6d503b186695f01efa7eed65611b04e | 4c5b9c107a1d158b245f21a1839a2bec97d05383 |
python/cpython | python__cpython-124310 | # IDLE: infinite print loop hangs and crashes
# Bug report
Interactively execute `while 1: 1` and Python hangs while, on Windows, a steady stream of `1`s is printed. In REPL, ^C stops execution with KeyboardInterrupt. In IDLE, ^C has no effect. Same for ^F6, which (at least on Windows) should kill and restart th... | d5f95ec07bb47a4d6554e04d13a979dbeac05f74 | 342e654b8eda24c68da64cc21bc9583e480d9e8e |
python/cpython | python__cpython-126598 | # IDLE: no Shell menu item in single-process mode
Start IDLE with `python -m idlelib -n` and the Shell menu is missing 'Shell'.
-n mode is semi-deprecated, but this is egregious and should be easily fixed.
<!-- gh-linked-prs -->
### Linked PRs
* gh-126598
* gh-133310
<!-- /gh-linked-prs -->
| 7e7e49be78e26d0a3b861a04bbec1635aabb71b9 | a512905e156bc09a20b171686ac129e66c13f26a |
python/cpython | python__cpython-112931 | # Error in example of `datetime.time.fromisoformat`
# Documentation
https://github.com/python/cpython/blob/5bf7580d72259d7d64f5ee8cfc2df677de5310a4/Doc/library/datetime.rst?plain=1#L1811-L1812
I consider the correct example should be below.
```pycon
>>> time.fromisoformat('04:23:01,000384')
datetime.time(... | bdc8d667ab545ccec0bf8c2769f5c5573ed293ea | 4e5b27e6a3be85853bd04d45128dd7cc706bb1c8 |
python/cpython | python__cpython-112921 | # datetime.replace() is very slow
# Bug report
### Bug description:
datetime.replace() is very slow when called with keyword arguments. For example, with python 3.13 from main on my laptop
```console
$ python -m timeit -s "from datetime import datetime; dt = datetime.now()" "dt.replace(microsecond=0)"
500000 ... | 1f515e8a109204f7399d85b7fd806135166422d9 | 4287e8608bcabcc5bde851d838d4709db5d69089 |
python/cpython | python__cpython-112907 | # Performance regression in pathlib path instantiation
#110670 has increased the time taken to instantiate a `PurePath` object by ~30%.
<!-- gh-linked-prs -->
### Linked PRs
* gh-112907
<!-- /gh-linked-prs -->
| 23df46a1dde82bc5a51578d9443024cf85827b95 | 96f64a2b1b4e3d4902848c63e42717a9c5539e03 |
python/cpython | python__cpython-113195 | # `unittest` Test Discovery page says "Python 3.11 dropped the namespace packages support," which is inaccurate
# Documentation
The [documentation for `unittest` Test Discovery ](https://docs.python.org/3/library/unittest.html#test-discovery) says: "Changed in version 3.11: Python 3.11 dropped the [namespace packag... | 21d52995ea490328edf9be3ba072821cd445dd30 | 48c907a15ceae7202fcfeb435943addff896c42c |
python/cpython | python__cpython-112885 | # build fails with -DWITH_PYMALLOC_RADIX_TREE=0
# Bug report
### Bug description:
bpo-37448 added a radix tree based memory map, also allowing to disable it:
To disable the radix tree map, set a preprocessor flag as follows:
`-DWITH_PYMALLOC_RADIX_TREE=0`.
However building with that fails:
```
In ... | 890ce430d94b0b2bccc92a8472b1e1030b4faeb8 | c1652d6d6201e5407b94afc297115a584b5a0955 |
python/cpython | python__cpython-112856 | # Optimize pathlib path pickling
`pathlib.PurePath.__reduce__()` currently accesses and returns [the `parts` tuple](https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.parts). Pathlib ensures that the strings therein are [interned](https://docs.python.org/3/library/sys.html#sys.intern).
There's a good r... | 15fbd53ba96be4b6a5abd94ceada684493c36bdd | d8f350309ded3130c43f0d2809dcb8ec13112320 |
python/cpython | python__cpython-115789 | # Add Software Bill-of-Materials for Windows source dependencies
### Proposal:
Part of https://github.com/python/cpython/issues/112302
An SBOM document has been added for dependencies within CPython itself. This document is kept up-to-date using tooling and CI within the CPython repository. For building the Wind... | 45d8871dc4da33fcef92991031707c5bf88a40cf | 6a86030bc2519b4a6b055e0b47b9870c86db8588 |
python/cpython | python__cpython-112850 | # gh-105716 breaks greenlet/eventlet
# Bug report
### Bug description:
gh-105716 breaks greenlet/eventlet, which apparently was working with the 3.12.0 release.
this is greenlet 3.0.1, plus eventlet 0.33.3 plus the python3.12 for eventlet taken from
https://src.fedoraproject.org/rpms/python-eventlet/tree/rawhi... | 64d8b4c7099a6097a7f7340c575679c5622fcd5c | cf6110ba1337cb67e5867d86e7c0e8d923a5bc8d |
python/cpython | python__cpython-112809 | # mimalloc build fails on Solaris due to undeclared 'large_os_page_size'
# Bug report
### Bug description:
The compilation of mimalloc on Solaris currently fails with the following error:
```
In file included from /.../cpython-main/Objects/mimalloc/prim/prim.c:22,
from /.../cpython-main/Objects/mima... | 10d3f04aec745c6676ef31611549b970a78338b3 | ae968d10326165b1114568ab1ca0a7776ea9c234 |
python/cpython | python__cpython-112807 | # Unused function warnings during mimalloc build on Solaris
# Bug report
### Bug description:
Similarly to FreeBSD here #111906, when building Python main on Solaris, we are seeing unused function warnings:
```
/.../cpython-main/Objects/mimalloc/prim/unix/prim.c: At top level:
/.../cpython-main/Objects/mimalloc/prim... | ae968d10326165b1114568ab1ca0a7776ea9c234 | 0b2340263172ad0fdd95aed6266496b7f4db4de3 |
python/cpython | python__cpython-124914 | # parking_lot.c should check for overflow in Windows `_PySemaphore_PlatformWait` code path
# Bug report
The cast in `millis = (DWORD) (timeout / 1000000);` may overflow because `DWORD` is an unsigned 32-bit integer and `timeout` is a 64-bit integer. We should clamp the result if the cast would overflow.
https://gith... | a5fc50994a3fae46d0c3d496c4e1d5e00548a1b8 | adfe7657a3f1ce5d8384694ed27a40376a18fa6c |
python/cpython | python__cpython-112803 | # SubprocessTransport .close() can fail with PermissionError with setuid programs
# Bug report
### Bug description:
```
Python 3.12.0 (main, Oct 2 2023, 00:00:00) [GCC 13.2.1 20230918 (Red Hat 13.2.1-3)] on linux
```
aka `python3-3.12.0-1.fc39.x86_64`.
Run this code on your Linux system with pkexec setup. That s... | 0187a7e4ec9550a6e35dd06b26f22863520242ab | ca71987f4e3be56a369a1dd57763c6077b3c4899 |
python/cpython | python__cpython-112932 | # zlib extractall can not extract zip because of '/' in namelist
# Bug report
### Bug description:
I am trying to extract all members from zipfile, and this zipfile is created by my code. In python3.11 and MacOS default archiver I can extract this file, but using 3.12 I see an error because of '/' in the zipfile.nam... | 541c5dbb81c784afd587406be2cc82645979a107 | 84d1f76092c24c4d6614797cc10eb8a231397646 |
python/cpython | python__cpython-112819 | # Build Error on RISC-V: undefined reference to `__atomic_exchange_1'
# Bug report
### Bug description:
Configuration:
```
./configure
```
Build Output ([full-build-output.txt](https://github.com/python/cpython/files/13573831/full-build-output.txt)):
```sh
user@starfive:~/cpython$ make
gcc -c -fno-strict-overflow... | 4d1eea59bd26d329417cc2252f1c91b52d0f4a28 | c744dbe9ac0e88e395a7464f20a4fd4184a0a222 |
python/cpython | python__cpython-112771 | # test.test_zlib.CompressObjectTestCase.test_flushes fails to parse ZLIB_VERSION with zlib-ng
# Bug report
### Bug description:
Hello. Fedora is switching from zlib to zlib-ng. https://fedoraproject.org/wiki/Changes/ZlibNGTransition
zlib-ng defines `ZLIB_VERSION` as `"1.3.0.zlib-ng"`:
https://github.com/zlib-ng/zl... | d384813ff18b33280a90b6d2011654528a2b6ad1 | d109f637c048c2b5fc95dc7fdfd50f8ac41a7747 |
python/cpython | python__cpython-112814 | # `PurePath.match` accepts a `PurePath` pattern only since Python 3.12
# Documentation
In the docs on [`PurePath.match(pattern, *, case_sensitive=None)`](https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.match) on `pathlib`, it says:
> The pattern may be another path object; this speeds up matching... | ed8720ace4f73e49f149a1fdd548063ee05f42d5 | f3bff4ee9d3e4276949e5cde81180195b95bacb9 |
python/cpython | python__cpython-112738 | # del-safe symbols in subprocess module cannot be overwritten in cross-build environment
# Bug report
### Bug description:
The subprocess module has a number of symbols that must be available during the deletion process. To ensure this, the symbols that must be available for deletion are pre-declared, then used as t... | dc824c5dc120ffed84bafd23f95e95a99678ed6a | 304a1b3f3a8ed9a734ef1d098cafccb6725162db |
python/cpython | python__cpython-112732 | # Use color to highlight error locations
This has several advantages:
* Will help a lot with readability as parsing the error lines is easier if color highlights the error ranges.
* In the future we can optionally (via config) drop the ranges and only use color, recovering back the extra lines that the carets are ... | 16448cab44e23d350824e9ac75e699f5bcc48a14 | 3870d19d151c31d77b737d6a480aa946b4e87af6 |
python/cpython | python__cpython-112728 | # Optimize `pathlib.Path.absolute()`
The implementation of `pathlib.Path.absolute()` can call `with_segments()` with multiple arguments; the resulting path object will be internally unjoined and unparsed, making `str(path.absolute())` slow, amongst other things.
`absolute()` already has most of the information it n... | 304a1b3f3a8ed9a734ef1d098cafccb6725162db | 9fe7655c6ce0b8e9adc229daf681b6d30e6b1610 |
python/cpython | python__cpython-112776 | # `PyThreadState_Clear()` should only be called from the same interpreter
`PyThreadState_Clear()` includes the following comment:
https://github.com/python/cpython/blob/1e4680ce52ab6c065f5e0bb27e0b156b897aff67/Python/pystate.c#L1553-L1558
We should enforce this, particularly the comment about the matching interp... | a3c031884d2f16d84aacc3f733c047b3a6cae208 | 8a4c1f3ff1e3d7ed2e00e77b94056f9bb7f9ae3b |
python/cpython | python__cpython-112722 | # Refactor dis module to separate instructions creation from formatting
The dis module is not very flexible, because the formatting and instruction creation are all entangled with one another. I will refactor it so that we are able to feed an instruction sequence to a formatter, or to plug in a different formatter int... | c98c40227e8cd976a08ff0f6dc386b5d33f62f84 | 10e9bb13b8dcaa414645b9bd10718d8f7179e82b |
python/cpython | python__cpython-112770 | # SystemError when builtins is not a dict + eval
# Bug report
### Bug description:
If `__builtins__` is not a dict, you can get a SystemError:
```pycon
>>> import types
>>> exec("import builtins; builtins.print(3)", {"__builtins__": types.MappingProxyType({})})
Traceback (most recent call last):
File "<stdin>", li... | 1161c14e8c68296fc465cd48970b32be9bee012e | 12f0bbd6e08bcc1e7165f2641716f7685c1db35c |
python/cpython | python__cpython-112714 | # Support for Partitioned cookies attribute
# Feature or enhancement
### Proposal:
Chrome is phasing out support for Third Party Cookies in Q1 2024, and for several key use cases, the proposed solution is CHIPS (https://github.com/privacycg/CHIPS).
See Chrome's blogpost about these changes: https://developer.chrom... | 9abbb58e3f023555473d9e8b82738ef44077cfa8 | 3a3a6b86f4069a5a3561c65692937eb798053ae5 |
python/cpython | python__cpython-112679 | # Tkinter: `Tkapp_CallDeallocArgs()` should be `static`
…as per [PEP 7](https://peps.python.org/pep-0007/#code-lay-out).
<!-- gh-linked-prs -->
### Linked PRs
* gh-112679
* gh-112690
* gh-112691
<!-- /gh-linked-prs -->
| 23e001fa9f1897ba3384c02bbbe634313358a549 | e5b0db0315941b968ebcc2414bfcdd2da44fd3c2 |
python/cpython | python__cpython-112676 | # Tests for path joining in `test_pathlib` are misplaced
Pathlib originally implemented its own path joining algorithm with its own tests. Nowadays pathlib now calls through to `os.path.join()` (see #95450), but there's still a handful of tests for path joining remaining that are better suited to `test_posixpath` and ... | 28b2b7407c25d448ff5d8836efabbe7c02316568 | 2c3906bc4b7ee62bf9d122a6fdd98b6ae330643f |
python/cpython | python__cpython-112681 | # Tkinter: incompatible pointer types warnings when built with Tcl 9
Tcl/Tk 9 changes C APIs to use a different type for sizes to allow transferring ≥32-bit sized things. The new type is `Tcl_Size`, which as of [TIP 660](https://core.tcl-lang.org/tips/doc/trunk/tip/660.md) is defined as either `ptrdiff_t` in Tcl 9, or... | e0799352823289fafb8131341abd751923ee9c08 | 7111d9605f9db7aa0b095bb8ece7ccc0b8115c3f |
python/cpython | python__cpython-112715 | # Typo in Macro/C/Python Type Table
The (*) footnote to the table in [this section](https://docs.python.org/3/c-api/structures.html#member-types) of the documentation has a typo. It says:
`with Py_T_STRING_INLINE the string is stored directly in the structure`
but it seems like it should be:
`with Py_T_STR... | a8ce149628c9eaafb8c38fbf25fbd1ed483d2902 | 4eddb4c9d9452482c9af7fa9eec223d12b5a9f33 |
python/cpython | python__cpython-112661 | # Do not clear arbitrary errors on import
Currently the import and module code can clear arbitrary errors when format error message for ImportError or AttributeError and override them with ImportError or AttributeError. Usually it is not an issue, because these errors (accessing missed attribute or dict key) should be... | 45e6dd63b88a782f2ec96ab1da54eb5a074d8f4c | daa260ebb1c1b20321e7f26df7c9dbd35d4edcbf |
python/cpython | python__cpython-112659 | # Undeprecate the onerror argument in shutil.rmtree()
# Bug report
A new `onexc` parameter was added in `shutil.rmtree()` in 3.12 (see #102828). At the same time passing the `onerror` argument was deprecated. It creates inconvenience for code that should run on several Python versions. It forces users to modify their... | 97857ac0580057c3a4f75d34209841c81ee11a96 | 162d3d428a836850ba29c58bbf37c931843d9e37 |
python/cpython | python__cpython-112641 | # `types.FunctionType` is missing `kwdefaults` from the constructor
# Feature or enhancement
https://github.com/python/cpython/blob/a9574c68f04695eecd19866faaf4cdee5965bc70/Objects/funcobject.c#L800-L813
It is rather strange to have `defaults`, but not `kwdefaults`.
I propose adding `kwdefaults` as the last paramete... | 2ac4cf4743a65ac54c7ac6a762bed636800598fe | f653caa5a88d3b5027a8f286ff3a3ccd9e6fe4ed |
python/cpython | python__cpython-112626 | # stringlib bytearray.join function has the potential to leak memory when used with a custom iterator
# Bug report
### Bug description:
If a custom iterator is passed into `bytearray.join`, and then it frees the bytearray inside of its `__iter__`, then memory can be read after it is freed:
```python
# stringlib_joi... | 0e732d0997cff08855d98c17af4dd5527f10e419 | 23e001fa9f1897ba3384c02bbbe634313358a549 |
python/cpython | python__cpython-112623 | # create_task does not pass name parameter to event loop
# Bug report
### Bug description:
The name parameter in the `asyncio.create_task` function is never passed to the event loop.
[Task names are instead only ever set by the `asyncio.create_task` function](https://github.com/python/cpython/blob/main/Lib/as... | a3a1cb48456c809f7b1ab6a6ffe83e8b3f69be0f | c6e614fd81d7dca436fe640d63a307c7dc9f6f3b |
python/cpython | python__cpython-112621 | # AttributeError in 'python -m dis -C'
# Bug report
### Bug description:
Sorry @iritkatriel, I hit another crash in the new `dis` code:
```pytb
~/cpython$ ./python.exe -m dis -C Lib/re/_compiler.py >/dev/null
Traceback (most recent call last):
File "/Users/guido/cpython/Lib/runpy.py", line 198, in _run_m... | 162d3d428a836850ba29c58bbf37c931843d9e37 | 4ed46d224401243399b41c7ceef4532bd249da27 |
python/cpython | python__cpython-112619 | # `typing.get_type_hints` Can Return Incorrect Type for Annotated Metadata
# Bug report
### Bug description:
When running the following example:
```python
from typing import Annotated, get_type_hints
class MessageCode(str):
pass
class DisplayName(str):
pass
class Message:
field_a: Annotated[str, Messa... | a35a30509820f956d6feeaa0dbf42e9ca82c12bb | a74daba7ca8b68f47284d82d4604721b8748bbde |
python/cpython | python__cpython-112579 | # `python -m zipfile` issues RuntimeWarning
Running `python -m zipfile` on main gives:
```
<frozen runpy>:128: RuntimeWarning: 'zipfile.__main__' found in sys.modules after import of package 'zipfile', but prior to execution of 'zipfile.__main__'; this may result in unpredictable behaviour
```
This can be traced... | 29e6c7b68acac628b084a82670708008be262379 | fc9e24b01fb7da4160b82cef26981d72bb678c13 |
python/cpython | python__cpython-117169 | # [windows/msys2] venv doesn't create activition script for `fish` shell
# Bug report
### Bug description:
1. Install MSYS2 for Windows
2. Install `fish` shell under MSYS2
3. Start MSYS2 environment with `fish` shell
4. Run `python -m venv venv`
Expect:
`venv\Scripts` includes `activate.fish`
Actual:
`venv\Scrip... | 83485a095363dad6c97b19af2826ca0c34343bfc | 78a651fd7fbe7a3d1702e40f4cbfa72d87241ef0 |
python/cpython | python__cpython-112568 | # time.perf_counter(): compute Greatest Common Denonimator (GCD) to reduce risk of integer overflow
The `time.perf_counter()` function is implemented by calling `QueryPerformanceCounter()` and `QueryPerformanceFrequency()`. It computes `QueryPerformanceCounter() * SEC_TO_SEC / QueryPerformanceFrequency()` using int64_... | 5c5022b8625e34f0035ad5a23bc4c2f16649d134 | 05a370abd6cdfe4b54be60b3b911f3a441026bb2 |
python/cpython | python__cpython-113040 | # asyncio.run unnecessarily calls the repr of the task result twice since Python 3.11
# Bug report
### Bug description:
Given the following code:
```python
import asyncio
import time
class Foo:
def __repr__(self):
time.sleep(1)
print('i am a repr, i should not be called. ')
return '<Foo... | 050783cb37d6a09d8238fa640814df8a915f6a68 | 0187a7e4ec9550a6e35dd06b26f22863520242ab |
python/cpython | python__cpython-112880 | # Add zero value support for statistics.geometric_mean()
# Bug report
### Bug description:
The [implementation of `statistics.geometric_mean` using logarithms](https://github.com/python/cpython/blob/3.12/Lib/statistics.py#L539C20-L539C20) requires that all input values must be positive. However, a real geometric mea... | f3bff4ee9d3e4276949e5cde81180195b95bacb9 | 76929fdeebc5f89655a7a535c19fdcece9728a7d |
python/cpython | python__cpython-112560 | # Add internal-only `_PyThreadStateImpl` "wrapper" for `PyThreadState`
# Feature or enhancement
The `PyThreadState` struct definitions (i.e., `struct _ts`) is visible in Python's public C API. Our [documentation](https://docs.python.org/3/c-api/init.html#c.PyThreadState) lists only the "interp" field as public. In pr... | db460735af7503984d1b7d878069722db44b11e8 | bf0beae6a05f3266606a21e22a4d803abbb8d731 |
python/cpython | python__cpython-112648 | # Add support for thread sanitizer (TSAN) via `--with-thread-sanitizer`
# Feature or enhancement
GCC and Clang provide ThreadSanitizer, a tool that detects data races. We should add support for thread sanitizer to CPython. Note that Python already supports the memory and address sanitizers.
* Add `--with-thread-sani... | 88cb9720001295f82c7771ab4ebf20f3cd0b31fb | f46987b8281148503568516c29a4a04a75aaba8d |
python/cpython | python__cpython-112883 | # mimalloc: additional integration and changes for `--disable-gil` builds
# Feature or enhancement
Mimalloc was added as an allocator in https://github.com/python/cpython/issues/90815. The `--disable-gil` builds need further integration with mimalloc, as well as some modifications to mimalloc to support thread-safe... | fdee7b7b3e15931d58f07e5449de2e55b4d48b05 | fed294c6453527addd1644633849e2d8492058c5 |
python/cpython | python__cpython-112533 | # Make the garbage collector thread-safe in `--disable-gil` builds
# Feature or enhancement
Python's cyclic garbage collector relies on the global interpreter lock for thread-safety. There are a number of changes needed to make the GC thread-safe in `--disable-gil` builds.
My intention is to implement these as a... | d70e27f25886e3ac1aa9fcc2d44dd38b4001d8bb | 0738b9a338fd27ff2d4456dd9c15801a8858ffd9 |
python/cpython | python__cpython-112520 | # Make it possible to specify flags for pseudo instructions defined in bytecodes.c
The instruction metadata is incorrect for some of the pseudo instructions. For instance, these map to ``NOP``, and take their metadata from it, but they should have the ``HAS_ARG`` flag set.
```
[SETUP_FINALLY] = { true, 0, 0 },... | 07ebd46f9e55ed2f18c5ea2a79ec5054bc26b915 | 7eeea13403882af63a71226433c9a13b80c22564 |
python/cpython | python__cpython-112517 | # Update the bundled version of pip to 23.3.1
# Feature or enhancement
### Proposal:
Update the bundled pip in ensurepip to the latest version of pip (23.3.1).
This ensures that users who install newest release of Python get the newest version of pip. Also the latest pip version includes a couple of security improv... | 1e4680ce52ab6c065f5e0bb27e0b156b897aff67 | e08b70fab1fbc45fa498020aac522ae1d5da6136 |
python/cpython | python__cpython-112511 | # Add `readline.backend` for the backend `readline` uses
# Feature or enhancement
### Proposal:
Currently we support two backends with readline: GNU readline and editline. They work in a similar way but have some differences. Notably the way to set `<tab>` as the complete key.
The users need to distinguish the back... | c2982380f827e53057068eccf9f1a16b5a653728 | f8ff80f63536e96b004d29112452a8f1738fde37 |
python/cpython | python__cpython-112512 | # TypedDict: `__required_keys__` and `__optional_keys__` can be wrong in the presence of inheritance
# Bug report
### Bug description:
```python
from typing import NotRequired, Required, TypedDict
class A(TypedDict):
a: NotRequired[int]
b: Required[int]
class B(A):
a: Required[int]
b: NotRequired[i... | 403886942376210662610627b01fea6acd77d331 | e0449b9a7fffc0c0eed806bf4cbb8f1f65397bbb |
python/cpython | python__cpython-112508 | # venv/scripts/common/activate should use `uname` instead of `$OSTYPE` to detect Cygwin and MSYS
# Bug report
### Bug description:
The venv activate script uses the `$OSTYPE` variable to determine if it's running on Cygwin or MSYS.
https://github.com/python/cpython/blob/fb202af4470d6051a69bb9d2f44d7e8a1c99eb4f/Lib/... | 2a378dba987e125521b678364f0cd44b92dd5d52 | 4b421e8aca7f2dccc5ac8604b78589941dd7974c |
python/cpython | python__cpython-112562 | # gc.collect() docs are wrong
https://docs.python.org/3/library/gc.html#gc.collect says "The number of unreachable objects found is returned."
In fact, it returns (https://github.com/python/cpython/blob/48dfd74a9db9d4aa9c6f23b4a67b461e5d977173/Modules/gcmodule.c#L1378) the sum of two numbers: the number of objects ... | 730d450d4334978f07e3cf39e1b320f2954e7963 | 482b0ee8f6cdecd96c246c8bcbda93292f4d08cc |
python/cpython | python__cpython-112491 | # AIX build break because of openssl with no PSK support
# Bug report
### Bug description:
AIX build broke after the commit #103181
`./Modules/_ssl.c:4757:5: error: unknown type name 'SSL_psk_client_cb_func'
4757 | SSL_psk_client_cb_func ssl_callback;
| ^~~~~~~~~~~~~~~~~~~~~~
./Modules/_ssl.c:4761:2... | e413daf5f6b983bdb4e1965d76b5313cb93b266e | 48dfd74a9db9d4aa9c6f23b4a67b461e5d977173 |
python/cpython | python__cpython-112439 | # Fix support of format units with the "e" prefix in nested tuples in PyArg_Parse
# Bug report
`PyArg_Parse` format units `es`, `et`, `es#`, and `et#` are not correctly supported in nested tuples. This is because the code for parsing nested tuples counts the number of alphabetical symbols to determine the number of i... | 4eea1e82369fbf7a795d1956e7a8212a1b58009f | 812360fddda86d7aff5823f529ab720f57ddc411 |
python/cpython | python__cpython-113790 | # Add ability to force alignment of ctypes.Structure
# Feature or enhancement
### Proposal:
When creating a `ctypes.Structure` to map data from c/c++ to python, I have been coming up against issues where I have a structure which has an alignment due to a `#pragma align`.
Currently there is no way to define a `c... | 298bcdc185d1a9709271e61a4cc529d33483add4 | f42e112fd86edb5507a38a2eb850d0ebc6bc27a2 |
python/cpython | python__cpython-112432 | # venv/scripts/common/activate should unconditionally call `hash -r`
# Bug report
### Bug description:
The venv/scripts/common/activate script calls `hash -r` in two places to make sure the shell picks up the environment changes the script makes. Before that, it checks to see if the shell running the script is bash ... | a194938f33a71e727e53490815bae874eece1460 | f14d741daa1b9e5b9c9fc1edba93d0fa92b5ba8d |
python/cpython | python__cpython-112421 | # The `find_module` fallback has been removed but is still mentioned in `sys.meta_path`'s document
# Documentation
The `find_module` fallback for `sys.meta_path` has been [removed](https://github.com/python/cpython/issues/98040) in Python3.12, but is still mentioned in `sys.meta_path`'s document: https://docs.pytho... | ec23e90082ffdedc7f0bdd2dfadfc4983ddc0712 | 2ac4cf4743a65ac54c7ac6a762bed636800598fe |
python/cpython | python__cpython-112425 | # `ModuleType.__repr__` can fail on py312+
# Bug report
### Bug description:
Calling `repr()` on a `ModuleType` instance can fail with `AttributeError` on py312+, due to changes made in #98870. This is because the implementation of `importlib._bootstrap._module_repr_from_spec` assumes that all loaders will have a `_... | 0622839cfedacbb48eba27180fd0f0586fe97771 | e954ac7205d7a6e356c1736eb372d2b50dbd9f69 |
python/cpython | python__cpython-112406 | # Optimise `pathlib.Path.relative_to()`
# Feature or enhancement
### Proposal:
`pathlib.Path.relative_to()` can be significantly optimised by making use of `itertools.chain`
### Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
### Links to previ... | 418d585febd280e779274f313f910613ac1a1c30 | 9fe60340d7e8dc22b3aec205c557bc69a1b2d18c |
python/cpython | python__cpython-112410 | # Assertion failure in `Objects/call.c`:342: `!_PyErr_Occurred(tstate)` failed
# Crash report
### What happened?
I found some crashes when adding an additional fuzz target in https://github.com/python/cpython/pull/111721.
```python
# This script fails with a C assertion failure when assertions are enabled.
#
# I ra... | 2c8b19174274c183eb652932871f60570123fe99 | 967f2a3052c2d22e31564b428a9aa8cc63dc2a9f |
python/cpython | python__cpython-112409 | # Assertion failure in `get_error_line_from_tokenizer_buffers` in `pegen_errors.c`
# Crash report
### What happened?
I found some crashes when adding an additional fuzz target in #111721.
```python
# This script fails in two different ways.
#
# First, it fails with a C assertion failure when assertions are enabled.... | 45d648597b1146431bf3d91041e60d7f040e70bf | 2c8b19174274c183eb652932871f60570123fe99 |
python/cpython | python__cpython-113153 | # teach dis how to interpret the oparg of ENTER_EXECUTOR
The oparg of `ENTER_EXECUTOR` is not consistent with that of `JUMP_BACKWARD`. See https://github.com/python/cpython/pull/112377/files#r1404568464
<!-- gh-linked-prs -->
### Linked PRs
* gh-113153
* gh-117171
<!-- /gh-linked-prs -->
| d07483292b115a5a0e9b9b09f3ec1000ce879986 | 1addde0c698f7f8eb716bcecf63d119e19e1ecda |
python/cpython | python__cpython-112368 | # The perf trampoline can free the jitted code when is still used
Deactivating the trampoline frees the code arenas but this can happen when we are under the trampolines themselves so this leads to UB.
<!-- gh-linked-prs -->
### Linked PRs
* gh-112368
* gh-112590
<!-- /gh-linked-prs -->
| a73aa48e6bec900be7edd3431deaa5fc1d809e6f | bfb576ee23c133bec0ce7c26a8ecea76926b9d8e |
python/cpython | python__cpython-115696 | # can not unparse code with ' in format_spec
# Bug report
### Bug description:
The following example shows that it is not possible to unparse a f-string with a ' in the format_spec, but such code can be generated when the f-string is double-quoted.
expected behaviour:
`unparse` should use different quotes if quotes... | 69ab93082d14425aaac48b8393711c716575b132 | 074bbec9c4911da1d1155e56bd1693665800b814 |
python/cpython | python__cpython-112362 | # Speed up pathlib by removing a few temporary objects
A handful of pathlib methods that create paths with modified names, or additional segments, use list objects that are quickly thrown away. We can speed these methods up by only creating new lists where strictly necessary.
Specifically:
- `with_name()` (perfo... | 19a1fc1b3df30f64450d157dc3a5d40c992e347f | 6b961b8ceaba372b78d03feaceb4837bf7236694 |
python/cpython | python__cpython-112424 | # struct.Struct inheritance with Python 3.12.0
# Bug report
### Bug description:
```python
import struct
class MyStruct(struct.Struct):
def __init__(self):
super().__init__('>h')
obj = MyStruct()
```
When I run this code I receive an error:
```
Traceback (most recent call last):
File "/home/user/bug... | 9fe60340d7e8dc22b3aec205c557bc69a1b2d18c | 3faf8e586d36e73faba13d9b61663afed6a24cb4 |
python/cpython | python__cpython-112377 | # New dis.py gets tripped up by ENTER_EXECUTOR
# Bug report
### Bug description:
I have some code that calls `dis.dis(test, adaptive=True)` where `test` is simple function containing a loop containing a branch. Somehow `dis` crashes like this:
```
Traceback (most recent call last):
File "/Users/guido/cpython/t.py"... | 9eb3b35dd7d72ff73005abf20266a618215b9ae0 | fafae08cc7caa25f2bd6b29106b50ef76c3e296f |
python/cpython | python__cpython-112344 | # Improve error message when trying to call `issubclass()` against a Protocol that has non-method members
# Feature or enhancement
### Proposal:
The error message could tell the user what the non-method members in the protocol are.
### Has this already been discussed elsewhere?
This is a minor feature, which does ... | e9d1360c9a1072aa23950b321491dc542c3a19b8 | d9fc15222e96942e30ea8b0561dec5c82ecb4663 |
python/cpython | python__cpython-112380 | # pdb unintentionally interpolates strings with convenience variables
# Bug report
### Bug description:
Python 3.12 introduced $-prefixed convenience variables to pdb (#103693).
It automatically replaces $-words in strings, which is undocumented. @nedbat suggests this is unintended behavior.
```
(Pdb) p '$i... | 5c351fc85afd2ed167694a7dfe066741a5cdab53 | f49752552e673e5192f22eae0076b2650c7d6afc |
python/cpython | python__cpython-112617 | # subprocess.Popen: Performance regression on Linux since 124af17b6e [CVE-2023-6507]
# Bug report
### Bug description:
Apologies if this is a duplicate. I couldn’t find a similar report, though.
# The issue and how to reproduce
We’re seeing a performance regression since 124af17b6e. The best way to reproduce it is... | 9fe7655c6ce0b8e9adc229daf681b6d30e6b1610 | c5fa8a54dbdf564d482e2e3857aa3efa61edd329 |
python/cpython | python__cpython-112333 | # Deprecate TracebackException.exc_type
``TracebackException`` is supposed to be a printable snapshot of an exception. It is intended to be lightweight (release references to frames, etc) and easily serialised.
Since the ``exc_type`` field is causing issues for subinterpreters, I suggest we deprecate it and replac... | 2c68011780bd68463f5183601ea9c10af368dff6 | 2df26d83486b8f9ac6b7df2a9a4669508aa61983 |
python/cpython | python__cpython-112375 | # Reference Manual 6.3.1: wrong method mentioned
# Documentation
6.3.1. Attribute references
This section states that "This production can be customized by overriding the `__getattr__()` method."
This is wrong and should be replaced with "This production can be customized by overriding the `__getattribute__(se... | 97f8f28b3e50196f6713faceccc2e15039117470 | f93a4ef7a9e8d6f831c62707c0d39e0be306c4e6 |
python/cpython | python__cpython-112514 | # [Enum] make some private attributes public
# Feature or enhancement
Make `_EnumDict`, `_EnumDict._member_names`, and possibly other private names public.
This is to make subclassing `EnumType` and other advanced behavior supported, such as having multiple values per member.
<!-- gh-linked-prs -->
### Lin... | de6bca956432cc852a4a41e2a2cee9cdacd19f35 | 563ccded6e83bfdd8c5622663c4edb679e96e08b |
python/cpython | python__cpython-112321 | # Branch confidence decay in Tier 2 translator
This is a follow-up to gh-109039 (and to a lesser extent gh-111848). (I'm sure I read about it somewhere on https://github.com/faster-cpython/ideas/issues too, but I can't find the relevant issue, so I'll describe the idea from scratch here.)
When we translate a branc... | 7316dfb0ebc46aedf484c1f15f03a0a309d12a42 | dfaa9e060bf6d69cb862a2ac140b8fccbebf3000 |
python/cpython | python__cpython-112317 | # Docs: incorrect signature for `inspect.Signature.from_callable`
# Bug report
https://github.com/python/cpython/blob/fef6fb876267f28fbb2c5fcb17aebe1a52cc8e12/Doc/library/inspect.rst#L755-L775
It has several problems:
1. Two `.. versionadded` entries, one should be `.. versionchanged` instead
2. `eval_str` is missin... | a74daba7ca8b68f47284d82d4604721b8748bbde | 939fc6d6eab9b7ea8c244d513610dbdd556503a7 |
python/cpython | python__cpython-113344 | # Builds outside source folder broken, failed import of _importlib - no detection or valid error message or recommended cleanup.
### Bug description:
This bug was exposed by GH-108716. I think it was not the cause, just that it exposed an existing issue.
The build fails with:
```
./python -E -c 'import sys ; ... | 103c4ea27464cef8d1793dab347f5ff3629dc243 | a2dd0e7038ad65a2464541f91604524d871d98a7 |
python/cpython | python__cpython-112303 | # Add Software Bill of Materials (SBOM) for Python releases
# Feature or enhancement
### Proposal:
Software Bill of Materials (SBOM) is a format for tracking software and its components. This information will also soon become relevant for Python users due to [this Executive Order](https://www.federalregister.gov... | 21221c398f6d89b2d9295895d8a2fd71d28138fa | 2d76be251d0aee89f76e6fa5a63fa1ad3f2b76cf |
python/cpython | python__cpython-112313 | # Check for sub interpreter support is not catching readline global state and crashing
# Bug report
### Bug description:
Sub interpreters have a check (`_PyImport_CheckSubinterpIncompatibleExtensionAllowed`) for extensions which aren't compatible.
One example of an incompatible extension is `readline`. It has a glo... | 154f099e611cea74daa755c77df3b8003861cc76 | 2e632fa07d13a58be62f59be4e656ad58b378f9b |
python/cpython | python__cpython-112283 | # Unioned types should be hashable: not documented?
# Documentation
It seems that `typing.Union[X, Y]` as well as `X | Y` type hints require `X` and `Y` to be hashable.
This is not documented as far as I can see.
Considering this example:
```python
@dataclass
class ValueRange:
lo: int
hi: int
... | a7549b03cec1699b5342cddf292c179315433fa2 | 2713c2abc8d0f30cd0060cd307bb4ec92f1f04bf |
python/cpython | python__cpython-112658 | # platform module functions execute for a long time if user has no permissions to WMI
# Bug report
### Bug description:
From Python 3.12, probably since https://github.com/python/cpython/issues/89545 was implemented, the invocation of functions from `platform` modules takes a multiple of 5 seconds if the user has no... | a955fd68d6451bd42199110c978e99b3d2959db2 | b2923a61a10dc2717f4662b590cc9f6d181c6983 |
python/cpython | python__cpython-112268 | # `help()` on types has strange `(if defined)` notice for attributes that are defined
# Feature or enhancement
Let's say we have a regular class and we call `help()` on it:
```python
>>> class A: ...
...
>>> help(A)
Help on class A in module __main__:
class A(builtins.object)
| Data descriptors defined here:
|
... | f8129146ef9e1b71609ef4becc5d508061970733 | 77d9f1e6d9aad637667264c16c83d255526cc1ba |
python/cpython | python__cpython-112253 | # Error in `venv/scripts/common/activate` when $OSTYPE is not set
# Bug report
### Bug description:
When trying to use `. .venv/bin/activate` to activate a virtualenv from within a `Justfile` the script exits with an error `"sh: 42: .venv/bin/activate: OSTYPE: parameter not set"`.
Failing Test on 3.12.0: ht... | e1540ae74d1fce62f53e25838ba21746ba5d8444 | 44aa603d591388316d4e671656272d2a5bb9b334 |
python/cpython | python__cpython-112246 | # Promote free-threaded CI
# Feature or enhancement
### Proposal:
I propose to promote the existing free-threaded GitHub Actions CI, following the official acceptance of PEP 703, including:
1. Change the triggering of the free-threaded jobs to always trigger, instead of conditionally on the presence of the topic-fre... | 48dfd74a9db9d4aa9c6f23b4a67b461e5d977173 | 3fdf7ae3d1a08894e53c263945fba67fe62ac05b |
python/cpython | python__cpython-112284 | # Decide how to handle comments with debug expressions in f-strings
After PEP 701, having comments mixed with debug expressions is possible but the interactions has not been discussed. For instance, consider this code:
```
a = 1
f"{a = # my comment
}"
```
this produces:
```
'a = # my comment\n1'
```
... | d59feb5dbe5395615d06c30a95e6a6a9b7681d4d | 3b3ec0d77f0f836cbe5ff1ab97efcc8b7ed5d787 |
python/cpython | python__cpython-112241 | # Add option to calendar module CLI to specify the weekday to start each week
# Feature or enhancement
### Proposal:
When running the calendar module CLI, there is no option to specify the weekday to start each week. It defaults to Monday (0).
```sh
python -m calendar -h
```
Please consider adding an op... | 2c089b09ac0872e08d146c55ed60d754154761c3 | 39c766b579cabc71a4a50773d299d4350221a70b |
python/cpython | python__cpython-112235 | # Remove the toplevel parameter in converttuple()
It is always 0. And it always was 0, since adding this code in Python 1.1.
<!-- gh-linked-prs -->
### Linked PRs
* gh-112235
<!-- /gh-linked-prs -->
| 91d17305414923ae3f1cf98108ca42c50e60c8ea | 0566ab9c4d966c7280a1c02fdeea8129ba65de81 |
python/cpython | python__cpython-112216 | # `do_raise()` doesn't make sure the constructed cause is an exception.
# Bug report
### Bug description:
Consider the following:
```python
class ConstructsNone(BaseException):
@classmethod
def __new__(*args, **kwargs): return None
raise Exception("Printing this exception raises an exception. Mwa-ha-n... | 8f71b349de1ff2b11223ff7a8241c62a5a932339 | 4dcfd02bed0d7958703ef44baa79a4a98475be2e |
python/cpython | python__cpython-112232 | # Support specifying object to lock in Argument Clinic's `@critical_section` directive
# Feature or enhancement
https://github.com/python/cpython/issues/111903 added support for the `@critical_section` directive to Argument Clinic. It currently assumes that the first argument is the one that should be locked. This is... | e52cc80f7fc3a560bf3d0053e0821a2db070cdd1 | 607b5e30c67bad35b90240d9ac176131e51423a5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.