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-131529
# Caching the tuple hash calculation speeds up some code significantly ### Proposal: [Back in 2013](https://bugs.python.org/issue9685), it was determined that caching the result of `tuple_hash` did not have any significant speedup. However, a lot has changed since then, and in a [recent experiment](https://github.co...
8614f86b7163b1c39798b481902dbb511292a537
cf5e438c0297954c4411c1c3ae4ba67a48b134ea
python/cpython
python__cpython-131542
# Improve `platform` CLI # Feature or enhancement ### Proposal: Currently, the `platform` module's CLI is fairly hidden and inaccessible. I think there are two main issues with the module CLI. 1. There is no "Command Line Interface" section of the [docs](https://docs.python.org/3/library/platform.html#module-platfo...
77c391a1b178a35b0157e00689acb3904b77694d
ac56f8cc8d36ed65228d7eaa245569f66ad16d2b
python/cpython
python__cpython-131526
# clang-cl on Windows fails to compile after zlib-ng Since https://github.com/python/cpython/pull/131438, clang-cl fails to compile, see e.g. the tailcall Windows CI https://github.com/python/cpython/actions/runs/13967899073/job/39102464260 Discussion started with @zooba in https://github.com/python/cpython/pull/131...
d16f455cd8cabbc1e7bd2369cdb8718c30ab8957
1d6a2e648130cd834f7ed4fd210ef7dd4d4fc797
python/cpython
python__cpython-131515
# Code generator is overly restrictive about writing to input variables. # Bug report ### Bug description: In https://github.com/python/cpython/pull/130708/files#r2005817604 we want to replace an input variable, writing `v = PyStackRef_MakeHeapSafe(v);` but the code generator rejects this as unsafe: "writing to an i...
d3f6063af18a008e316e4342492e877ee51463e2
b70d45ab22e1d0f3b8a0b6ff5ff71157da5f2dfb
python/cpython
python__cpython-131509
# Syntax highlighting in PyREPL We want PyREPL to syntax highlight Python code, like this: <img width="796" alt="Image" src="https://github.com/user-attachments/assets/5bb47d56-2e80-4a9f-92c8-173f2836f4fb" /> Theming support is planned, but a separate concern. This issue is about enabling syntax to highlight correctl...
4cc82ffa377db5073fdc6f85c6f35f9c47397796
61317074d450f72fa121ceb1c7b0c52698a71106
python/cpython
python__cpython-131536
# Checking len bounds after usage in bytesio.c In _io_BytesIO_readinto_impl() len value is used in memcpy and then checked for being positive. It's better to move assertions before memcpy. This may be done with the following commit: https://github.com/python/cpython/commit/da720c10f6d841737195ca49440a038ae29bc9b9 ...
c45e661226558e997e265cf53ce1419213cc10b7
3fa30d9e9c13c4b84bdc9fc04e33130775679e98
python/cpython
python__cpython-131499
# Top-of-stack caching in the interpreter [Top-of-stack caching](https://dl.acm.org/doi/pdf/10.1145/223428.207165) is technique where one or more values on the top of the stack are kept in local variables, with the assumption that the C compiler will put them in registers. We should implement this for the interpreter...
7ebd71ee14a497bb5dc7a693dd00f074a9f4831f
443c0cd17c5b0c71ee45c3621777454c6b8b0cbd
python/cpython
python__cpython-131462
# GzipFile leaves GzipFile.myfileobject open in constructor if exception is raised # Bug report ### Bug description: consider the following program, it should raise an ExceptionGroup(..., [ValueError(), ValueError(), ...] but actually it raises OSError: [Errno 24] Too many open files: '/tmp/tmpk8gaprry' ```python ...
ce79274e9f093bd06d2285c9af48dbcbc92173de
f53e7de6a84a0f535efb75c3671283b801a1af0f
python/cpython
python__cpython-131475
# clang-cl on Windows still needs PreferredToolArchitecture I hoped I fixed it in https://github.com/python/cpython/pull/129907/commits/263870dd319e79170f42fc5e05beb3879effff7b, but it turned out, that this is not enough, see https://github.com/astral-sh/python-build-standalone/pull/549#issuecomment-2734831192. Diggi...
54efe296bc3f3e421b57d4487bb87ad4161600b2
8abfaba5a67a99c446f0c13253ee0ce97bf6fa5c
python/cpython
python__cpython-131462
# ResourceWarning in GzipFile (write mode) if constructor raises (3.14 only) # Bug report ### Bug description: ```python import io import gzip class BadFile(io.BytesIO): first = False def write(self, data): if self.first: self.first = False raise OSError def main(): try:...
ce79274e9f093bd06d2285c9af48dbcbc92173de
f53e7de6a84a0f535efb75c3671283b801a1af0f
python/cpython
python__cpython-131460
# Typo in BNF description of function signatures # Documentation The definition of `parameter_list_starargs` is missing a `|`: ``` parameter_list_starargs ::= "*" [star_parameter] ("," defparameter)* ["," [parameter_star_kwargs]] "*" ("," defparameter)+ ["," [parameter_star_kwargs]] ...
8b7d20d3a9dc53344e3803507deafc26b5c09ca8
49fb75c676bd422b03aef9824d1abca1e9d90193
python/cpython
python__cpython-131454
# Some macros are missing in `winsound` module. # Feature or enhancement ### Proposal: Currently we have `SND_*` macros for `winsound.PlaySound` and `MB_*` macros for `winsound.MessageBeep`, but some macros are missing from Microsoft's document: https://learn.microsoft.com/en-us/previous-versions/dd743680(v=vs.85) ...
00a984488894a4e6674018f449eb9ec0cee3a9a1
a2ea4175786e684dd0c1751d49f869e2e4a80e30
python/cpython
python__cpython-131442
# Add a set of asserts to test.test_capi.test_list Add a set of asserts to enhance `test.test_capi.test_list` test. For example, this test lacks some of the **0-sized** tests for some cases, and there is room for other **asserts**. <!-- gh-linked-prs --> ### Linked PRs * gh-131442 * gh-131523 * gh-131533 <!-- /gh-li...
2433cc79d79d9c1db8e53d4b9bde26e9a47fb0b9
39b37b0110d0faaa25d7cdaab008f856eec8173c
python/cpython
python__cpython-131436
# random.randint performance improvement # Feature or enhancement ### Proposal: `randint` is a commonly needed function, but it is fairly slow (compared to `random.random`). Maybe it would be good to port couple of lower level functions to `C`. But for the time being, this small edit results in 20% better performanc...
c83efa7a66e30276c328fa4a5f8f8d26977f3e1c
ce79274e9f093bd06d2285c9af48dbcbc92173de
python/cpython
python__cpython-131568
# `datetime.strptime` no longer raises `ValueError: stray % in format '%Y %'` # Bug report ### Bug description: in 3.13.2 and 3.13.1 `datetime.strptime` no longer raises `ValueError: stray % in format '%Y %'` ``` Python 3.13.2 (main, Mar 19 2025, 01:28:14) [Clang 16.0.0 (clang-1600.0.26.6)] on Darwin >>> from dateti...
3feac7a093b3fcd549c5dc54277f26f585f2ab0c
7ebbd271444d89218870169624921b795a717470
python/cpython
python__cpython-131839
# Update OpenSSL versions for CI and Windows OpenSSL v3.4.1 is out and contains some security patches (see https://github.com/openssl/openssl/releases/tag/openssl-3.4.1). There is one high vulnerabilty ([CVE-2024-12797](https://nvd.nist.gov/vuln/detail/CVE-2024-12797)) that was fixed. However, what I'm interested in,...
d260631be063d97f1a6d1c8f9fa2ce9b0e4f8a58
ce77da5871334bffea722984cb705fd20a763a1f
python/cpython
python__cpython-131419
# Wrong `Python.asdl` type for `keys` in `Dict` literals In the `Python.asdl` syntax description, the file asserts that `Dict` literal `keys` have type `expr*`. This is false. `keys` can be optional. In the ast documentation for Python: * https://docs.python.org/3/library/ast.html#ast.Dict it is made clear that: > ...
483d130e504f63aaf3afe8af3a37650edcdb07a3
30840706b029645b9631b92c687834fcced6413e
python/cpython
python__cpython-131420
# Remove un-necessary typedefs in `md5module.c` and `sha1module.c` We have some legacy typedefs that are no more needed as we're using HACL* and not our own implementation for MD5 and SHA-1: ```c #if SIZEOF_INT == 4 typedef unsigned int MD5_INT32; /* 32-bit integer */ typedef long long MD5_INT64; /* 64-bit integer */...
a9a399f0ecfeeff91425cc089057f1b95799853b
f3bf304c2799c31c045033f22db7eb8766a5f939
python/cpython
python__cpython-131422
# stdtypes don't mention asyncio generic classes # Documentation https://docs.python.org/3/library/stdtypes.html#standard-generic-classes has a list of generic classes. Since ea5b96842e066623a53015d8b2492ed61a5baf96, `asyncio` provides generic Future and Task that are not mentioned. <!-- gh-linked-prs --> ### Link...
61b4b2c57c9327273f2e306bafa23cf2c70eac8e
267c06d6a8290aa299098b4fcd3f270001b01e72
python/cpython
python__cpython-131407
# Extend HMAC tests by using NIST test vectors # Feature or enhancement Currently we do not test HMAC-SHA3 implementation. There is no RFC for test cases, but the NIST gives test vectors: https://csrc.nist.gov/Projects/cryptographic-standards-and-guidelines/example-values. I also need to find a way to declare test v...
8cb57dc3678a8b26772d0fffce525762fee4f234
83479c217523c277cccb9db1e214d99b1c9d6343
python/cpython
python__cpython-131406
# TSAN data race in _PyErr_Restore When running asyncio tests with forever mode, the following race is detected: ```console 0:04:28 load avg: 13.03 [121/1] test_asyncio.test_tasks worker non-zero exit code (Exit code 66) -- running (3): test_asyncio.test_events (1 min 4 sec), test_asyncio.test_sendfile (32.5 sec), te...
74b87515a72a2b7a6e601423f4b3b19b6566377f
61b4b2c57c9327273f2e306bafa23cf2c70eac8e
python/cpython
python__cpython-131370
# Encoding alias csEUCKR not supported # Bug report ### Bug description: The encoding 'csEUCKR' has been spotted in emails, and has been supported by Java since at least version 8 [1] It would be good if this could be added to the list of encoding aliases as an alias for euc_kr [1] https://docs.oracle.com/javase/8...
7558980a18b5573aac19b37535780a02bf918f89
74b87515a72a2b7a6e601423f4b3b19b6566377f
python/cpython
python__cpython-131554
# Add more tests for zero-sized bytes objects in `capi` tests # Bug report Quoting @picnixz: https://github.com/python/cpython/pull/131343#issuecomment-2729251433 > We could add more 0-size bytes tests in other functions as well I think. For instance `PyBytes_FromObject(b'')` is not tested. PRs are welcome! <!-- g...
f3bf304c2799c31c045033f22db7eb8766a5f939
bc26f95e8ff60ccca9818ca8522d2d0cde1b55fb
python/cpython
python__cpython-131340
# PyBytes_Size test for a zero-size bytes object `test.test_capi.test_bytes.CAPITest.test_size` that test `PyBytes_Size()` does not check for a zero-size bytes object. <!-- gh-linked-prs --> ### Linked PRs * gh-131340 * gh-131343 * gh-131344 <!-- /gh-linked-prs -->
3ae67ba97e88d6f066a5b6f0c809f57fe4a1ecbe
cf288e3c250f5538aa632cc46ce960681efec2ae
python/cpython
python__cpython-134336
# Stack overflow test errors in Alpine after GH-130398 # Bug report ### Bug description: After GH-130398 (014223649) was applied, `test.test_dynamic.RebindBuiltinsTests.test_load_global_specialization_failure_keeps_oparg` and `test.test_functools.TestLRUC.test_lru_recursion` fail with `RecursionError: Stack overflow...
1e9b8f2f8512ca4ede6ca24113a70e13c9a7cf6b
7040aa54f14676938970e10c5f74ea93cd56aa38
python/cpython
python__cpython-132232
# ctypes resize and byref/addressof is not thread-safe under free-threaded build # Bug report ### Bug description: I'm reviewing the https://github.com/python/cpython/blob/main/Modules/_ctypes/callproc.c. I believe I found a possible UB if `resize` and `byref`/`addressof` are used from different threads without any ...
d47584aae6fab1b767e2d2ea6611b9c0c3ff36e2
a26d58ce5242022c6ac2c8e408cf95eb5383a8e2
python/cpython
python__cpython-131334
# Cannot include `cpython/Include/internal/pycore_optimizer.h` in C++ extension due to use of protected C++ keyword "not" # Bug report ### Bug description: The code in `cpython/Include/internal/pycore_optimizer.h` causing problems ```C typedef struct { uint8_t tag; bool not; uint16_t value; } JitOptTrut...
883c2f682bab38344bf8c2bc345d52a9325543cc
844765b20f993e69fd6b7b70341f636fb84b473d
python/cpython
python__cpython-131328
# `winsound.SND_APPLICATION` is not documented `winsound.SND_APPLICATION` exists for a very long time but it's not documented unlike other `winsound.SND_*` consts, so I think we should document it. <!-- gh-linked-prs --> ### Linked PRs * gh-131328 * gh-131329 * gh-131330 <!-- /gh-linked-prs -->
bf4c1bf344ed1f80c4e8f4fd5b1a8f0e0858777e
9b6cef0f5dcb309096a68fdd04158e0e1313e8ec
python/cpython
python__cpython-131376
# data race while running `test_asyncio.test_sendfile` in TSAN TSAN output: ```console ❯ env TSAN_OPTIONS="halt_on_error=1" ./python -m test test_asyncio.test_sendfile -j 4 -F Using random seed: 1915823234 0:00:00 load avg: 5.66 Run tests in parallel using 4 worker processes 0:00:06 load avg: 5.53 [ 1/1] test_asynci...
94f4d87aeb4d2d7bddcb4c3aad4f62a727ac91ee
46e88540e6f15a461d6f91e45d1c68819a7f074c
python/cpython
python__cpython-131324
# Handle error scenarios of HACL* functions This is a follow-up on https://github.com/python/cpython/pull/130960#issuecomment-2726897435: >For all hash algorithms (NEW with this PR): malloc, malloc_with_params_and_key, malloc_with_key: may return NULL (out of memory) copy: may return NULL (out of memory) Full list fr...
261633bd3f48607478f50d12d8025cd4bb36f6f4
de8890f5ab1c1e767029d46c20f513beefc47b18
python/cpython
python__cpython-131312
# Possible memory leak in _ctypes/PyCStructUnionType_update_stginfo on fail path # Bug report ### Bug description: 1. [x] I have found that `layout_func `may leak when creating of `kwnames `fails: https://github.com/python/cpython/blob/e82c2ca2a59235bc1965b259f4421635861e0470/Modules/_ctypes/stgdict.c#L260-L270 But ...
812074e291d559824d496909a87fb5c26c37f60c
3453b5c1d652a0424a333332b576f9b878424061
python/cpython
python__cpython-131307
# Remove unused code related to the removed `BINARY_SUBSCR` instruction `BINARY_SUBSCR` was replaced with `BINARY_OP` and the `NB_SUBSCR` oparg in https://github.com/python/cpython/pull/129700 but there is still some code related to `BINARY_SUBSCR` that I believe can be removed. Some examples: https://github.com/pyth...
d07e9ebbe89ce701e73d25777ae057da8dffd506
bf4c1bf344ed1f80c4e8f4fd5b1a8f0e0858777e
python/cpython
python__cpython-132438
# Undefined references to HACL symbols when statically linking Python 3.12 # Bug report ### Bug description: I am developing an application that uses Python 3.12's static library (libpython3.12.a). Due to some restrictions, I am required to use a package manager to install Python and cannot compile it from source. A...
5f2ba152a0471f6f556ca2d9486e5ba486fcfbde
492e3e6976d05b8de1892c37c900ada23eaeaf06
python/cpython
python__cpython-131297
# clang-cl issues many warnings when building on Windows See e.g. https://github.com/python/cpython/actions/runs/13681800146/job/38255779088. I went through roughly 100 warnings to find this one https://github.com/python/cpython/issues/131020. Others are mostly benign, yet I'd like to reduce them. Since many of the...
f104c19a94ae43f788e509019901b1f48fbd134e
faa80fcf46f379dd13ad2d4d2a406449d37c2d60
python/cpython
python__cpython-131292
# Fix compiling python_uwp.cpp with clang-cl on Windows clang-cl fails with the following error when compiling `python_uwp.cpp`: ``` 1>In file included from ..\PC\python_uwp.cpp:14: 1>In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt\winrt\Windows.ApplicationModel.h:9: 1>In fi...
ef4fe7078513c658ef8239d2e64ddc33e4c3d4c1
30d52058493e07fd1d3efea960482f4001bd2f86
python/cpython
python__cpython-131371
# Multiple tests failing when invoked directly via `./python Lib/test/...` Besides `test_pickle` reported in https://github.com/python/cpython/issues/131031, there are a few more (`test_regrtest`, `test_metaclass` and `test_pyclbr`): ```sh ~ ./python Lib/test/test_regrtest.py ... Ran 115 tests in 35.727s FAILED (fai...
292a7248cda89f497e06eff4aa0147d6ff22f6bb
2aab2db1461ef49b42549255af16a74b1bf8a5ef
python/cpython
python__cpython-131289
# MSVC emits warnings in non-debug builds Since https://github.com/python/cpython/pull/130398, the below warning is emitted several times in case of MSVC release (or PGO) builds: ``` Include\internal\pycore_ceval.h(209): warning C4172: returning address of local variable or temporary : here ``` So the comment in the ...
20098719dffe837fb0e516fbb97336e9a8e3354f
37d47d496525142d12a94fb234c8b8311292c349
python/cpython
python__cpython-131283
# Compile fails when `--enable-pystats` # Bug report ### Bug description: I've tried to compile CPython with `--enable-pystats`, but it fails ```python mkdir build && cd build ../configure --with-pydebug --enable-test-modules --enable-pystats make -j8 ... In file included from ../Include/internal/pycore_interp.h:1...
1821f8f10c7a4a43a4fb55fe4e3da4cadfec699d
55815a6474c59001f0230e44560341b643268e87
python/cpython
python__cpython-131279
# Support building using "computed gotos" for clang-cl on Windows Per suggestion from @zooba in https://github.com/python/cpython/pull/130040#issuecomment-2714375928, don't be too fancy here: - just support a new optimizing build flag `WITH_COMPUTED_GOTOS` and keep `build.bat` out of the loop. It does not have to lear...
468a7aaeb4dfcd21697dfa46362b9f415b9daf1b
94f4d87aeb4d2d7bddcb4c3aad4f62a727ac91ee
python/cpython
python__cpython-131280
# Enhance `test.support.os_helper.EnvironmentVarGuard` interface # Feature or enhancement Currently, we have a lot of pattern of the form: ```py with EnvironmentVarGuard() as env: if no_c in env: env.unset(no_c) if no_d in env: env.unset(no_d) for ev in {no_a, no_b}: if ev in env: ...
3185e3115c918ec189e16cf9f5b51a13a0146556
9558d22ac308c102e4f843541eead2022050225e
python/cpython
python__cpython-131270
# Avoid binding functions to temporaries in `random.py` # Feature or enhancement The random module has a bunch of code that binds methods to temporary local variables like: ```python getrandbits = self.getrandbits ``` https://github.com/python/cpython/blob/55815a6474c59001f0230e44560341b643268e87/Lib/random.py#L248...
844765b20f993e69fd6b7b70341f636fb84b473d
c83efa7a66e30276c328fa4a5f8f8d26977f3e1c
python/cpython
python__cpython-131345
# _thread.set_name(): doubt about _PYTHREAD_NAME_MAXLEN values for BSD operating systems # Bug report ## FreeBSD ### Bug description: https://github.com/python/cpython/pull/127338/commits/6088b37759f0ce6cc1414a092ee7c4814d182256 states that "FreeBSD truncates to 98 bytes silently". This figure stems from an [empiri...
aabab76c8af3e2efb6c5d55bd0274c7e0bc029dd
b2ed7a6d6aae9860110f6ec495dc88dde670cfe4
python/cpython
python__cpython-131431
# test_timerfd_negative hangs indefinitely, causes system freeze on NetBSD # Bug report ### Bug description: When running the `test_timerfd_negative` test from `test_os.TimerfdTests`, the test process hangs indefinitely, cannot be interrupted with Control-C or Control-D, and eventually causes the entire system to fr...
8ad4646c675211dc1df0254a3160f50a18e4c6c3
3118693a1a3db0da96c565a2de015a806c892625
python/cpython
python__cpython-131272
# Please upgrade bundled Expat to 2.7.0 (e.g. for the fix to CVE-2024-8176) # Bug report ### Bug description: Hi! 👋 Please upgrade bundled Expat to 2.7.0 (e.g. for the fix to CVE-2024-8176). - GitHub release: https://github.com/libexpat/libexpat/releases/tag/R_2_7_0 - Change log: https://github.com/libexpat/libex...
bb0268f60dfe903a9bdb8d84104247a9318c6b18
978e37bb5f979cccce36613637ac2d94b43c71b2
python/cpython
python__cpython-131276
# test_webbrowser failure on MacOS if BROWSER set to "open" # Bug report ### Bug description: I just noticed a new-to-me failure on `main` for the `test_webbrowser` unit test. Here's the rundown: ```pytb % ./python.exe -E -m test test_webbrowser Using random seed: 3730311481 Raised RLIMIT_NOFILE: 256 -> 1024 0:00:...
9b6cef0f5dcb309096a68fdd04158e0e1313e8ec
3185e3115c918ec189e16cf9f5b51a13a0146556
python/cpython
python__cpython-131250
# Our internal headers are far too interlinked Adding a small feature like https://github.com/python/cpython/pull/131198#discussion_r1994046212 becomes a complicated puzzle of moving functions and structs between header files to avoid cycles. I was ultimately defeated in this case. This is a bit silly. We should brea...
a1aeec61c4321ba9a6966109343bd88dcf9cb26a
3ae67ba97e88d6f066a5b6f0c809f57fe4a1ecbe
python/cpython
python__cpython-131218
# Allow to generate multiple UUIDs at once via CLI # Feature or enhancement ### Proposal: Add `--count` to the main() of the uuid module. Sometimes you need more than one UUID. In order to print 42 UUIDs, run `python -m uuid --count 42` Inspired by https://www.man7.org/linux/man-pages/man1/uuidgen.1.html ### Has...
52b5eb95b770fa00ebbd449ba40cab4a0e7c7df7
4b3d5b604210f68005ef64d5346ca169385f5acf
python/cpython
python__cpython-131235
# `test_keywords` in `test_popen` can be improved # Bug report `test_keywords` here: https://github.com/python/cpython/blob/7fd61607cd28ec466717c78adfb1eb5b63add1f0/Lib/test/test_popen.py#L65-L68 does not assert anything. I propose to use an example similar to this one: https://github.com/python/cpython/blob/7fd616...
fc07f863ee2a942dd96e1ca9edf049603fbb574e
2250ab6a13dd269b738cfd391851933fca75533d
python/cpython
python__cpython-131416
# return-in-finally in multiprocessing/connection.py https://github.com/python/cpython/blob/7fd61607cd28ec466717c78adfb1eb5b63add1f0/Lib/multiprocessing/connection.py#L330C1-L340C68 This is clearly a bug, because the `except:` clause contains a naked `raise`, i.e., asks for the exception to propagate on. But the retu...
3e2cceaa871a742a66711519d8e6998b186ae263
4cc82ffa377db5073fdc6f85c6f35f9c47397796
python/cpython
python__cpython-131220
# `FileTestCase` in `test_lzma` can be improved There are several tests that do not assert anything: https://github.com/python/cpython/blob/96492785b202a92af1b71f8c011ea839ca3ebb07/Lib/test/test_lzma.py#L539-L547 https://github.com/python/cpython/blob/96492785b202a92af1b71f8c011ea839ca3ebb07/Lib/test/test_lzma.py#L5...
f6c24a5c89a1f08d583ab7f4d5c6751223f8e280
6b932edc5216d9766e70fef300a6b842ab33204c
python/cpython
python__cpython-131221
# `difflib`-generated HTML file does not use monospaced font # Bug report ### Bug description: `difflib.HtmlDiff.make_file` writes an HTML file with a CSS rule specifying Courier as the font to use. On systems which don't have it installed, browsers may fall back to the system default font, which likely won't be mon...
7fd61607cd28ec466717c78adfb1eb5b63add1f0
3d797e49c863c26d4d754e970ce6351465a7f50f
python/cpython
python__cpython-131197
# Improve perfomance of UUID.hex and UUID.__str__ by using bytes.hex() # Feature or enhancement ### Proposal: In my tests, using bytes.hex() speeds up calling the UUID.hex property. Additionally, using the hex property and f-strings also provides some speedup in calling uuid.UUID.__str__. ```python import uuid u...
1121c80fdad1fc1a175f4691f33272cf28a66e83
d7d22899e2fdfdc707f98d7297d9406de91b7e0d
python/cpython
python__cpython-132510
# Deletion of autoTSSkey during runtime finalization is not safe # Bug report The `autoTssKey` is deleted during `_PyRuntimeState_Fini` by `gilstate_tss_fini`. This isn't safe because other threads may try calling `PyGILState_Ensure()` or `PyGILState_GetThisThreadState()` concurrently during shutdown. https://github...
b8998fe2d8249565bf30ce6075ed678e1643f2a4
dcfc91e4e552e74a43f5fdf049af7a8fe7a784ee
python/cpython
python__cpython-132620
# `take_ownership` may erroneously clear MemoryError exceptions # Bug report ### Bug description: `take_ownership` clears any MemoryError exceptions when getting the previous frame fails (even if they were not raised by the call to _PyFrame_GetFrameObject): https://github.com/python/cpython/blob/1e4a4344af4f5fdc715...
22830103e598c63663b462c4e42b74e7a9d3bb99
1d529cbc892b824b387d672899265ed4258b2222
python/cpython
python__cpython-131177
# Duplicated section in `InternalDocs/frames.md` In the `InternalDocs`, specifically in the "**frames.md**" file, I think there is a title **duplication** for "Generators and Coroutines," and I think the first title should be related to "**The Specials**." However, we should also review the first line of the first dup...
e9d210bfc248f33cc713a6026b6cbb87fdab3973
10cbd1fe88d1095a03cce24fb126d479668a67c3
python/cpython
python__cpython-131149
# Remove unused imports - March 2025 Edition # Feature or enhancement ### Proposal: There are a bunch of unused imports in Python stdlib. I'm working on pull requests to remove them. ### Has this already been discussed elsewhere? No response given ### Links to previous discussion of this feature: _No response_ ...
14aed5e8abb84018cf48ebd1dd2ccc483013a005
7ffe93faf1db3b90968af1b1d811f39529603780
python/cpython
python__cpython-131142
# Data race between _PyMonitoring_RegisterCallback and _Py_call_instrumentation_2args in instrumentation.c # Bug report ### Bug description: I built cpython 3.13 from source with TSAN and running the following code: ```python import sys import concurrent.futures import threading if __name__ == "__main__": num...
ea57ffa02e42dc430f2cb2312cdfc3d7ff7a5c70
25f24b01e3b675c6afbb653f07034a3c9a6aee32
python/cpython
python__cpython-131128
# Minimal build support when using LibreSSL # Bug report ### Bug description: On systems using LibreSSL, using OpenBSD 7.6 in this example, you see the following: ```shell $ ./configure $ gmake [...] cc -pthread -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -std=c11 -Wextra -Wno-u...
1b49c8c71b90bfa97df5633e2bbf51d4a6e22a57
d87e7f35297d34755026173d84a38eedfbed78de
python/cpython
python__cpython-131124
# Support attribute completion in `pdb` for convenience variables # Feature or enhancement ### Proposal: We have completion for convenience variables, but not their attributes. `$_fra\t` gives us `$_frame`, but `$_frame.f_line\t` does not give us `$_frame.f_lineno`. We should support attributes just like other varia...
b52866953a64c5e0fe57784fbcfc6bec87861563
17d06aeb5476099bc1acd89cd6f69e239e0f9350
python/cpython
python__cpython-131122
# `_Py_atomic_store_char_relaxed` uses wrong memory ordering # Bug report https://github.com/python/cpython/blob/ebc24d54bcf554403e9bf4b590d5c1f49e648e0d/Include/cpython/pyatomic_gcc.h#L520-L522 `__ATOMIC_RELEASE` should be `__ATOMIC_RELAXED`. It's not really a correctness issue because `__ATOMIC_RELEASE` is strong...
7ffe93faf1db3b90968af1b1d811f39529603780
1fb7e2aeb7e4312b7f20f0d5f39ddd00d7762004
python/cpython
python__cpython-131118
# Update tp_finalize example to use PyErr_GetRaisedException # Documentation The [`tp_finalize`](https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_finalize ) C API doc currently uses the older [PyErr_Fetch](https://docs.python.org/3/c-api/exceptions.html#c.PyErr_Fetch) + [PyErr_Restore](https://docs.pytho...
a4832f6b9a62771725b159bc7cd6c49fb45e3bc8
5c44d7d99c470b4270b2f0e4841cf5a7f2499e15
python/cpython
python__cpython-131115
# Possibly data race in dict popitem vs do_lookup, dictobject.c # Bug report ### Bug description: I built cpython 3.13 from source with TSAN and running the following code: ```python import concurrent.futures import threading if __name__ == "__main__": num_workers = 20 num_runs = 100 barrier = threa...
c00ac578241b3213ceb79c1f32bc83ea471f02da
ad90c5fabc415d4e46205947cceda82893ec1460
python/cpython
python__cpython-131044
# Guards for WIN32_LEAN_AND_MEAN missing in some places # Bug report ### Bug description: Macro guards for the `WIN32_LEAN_AND_MEAN` macro are missing in some places. This leads to redefinition warnings on the xbox that define this as part of it's toolchain. ### CPython versions tested on: 3.13 ### Operating syst...
de8818ae233b8e7722aa5d6f91d4b5a04bd039df
425e0af74fb882b95f81923123bd4afad0cda157
python/cpython
python__cpython-131051
# Allow CPython test to handle TLS libraries lacking FFDHE ciphersuites # Feature or enhancement ### Proposal: Some cryptography TLS libraries, such as [AWS-LC](https://github.com/search?q=repo%3Aaws%2Faws-lc+path%3Assl%2F+%28%28%22DHE%22+OR+%22dhe%22%29+AND+NOT+%28%22ECDHE%22+OR+%22ecdhe%22%29%29&type=code) and [Bo...
be2d2181e62cd138b0cdf80ebc0dd4058187c52a
a5949986d631391d37b1b329ad8badcf2000f9a9
python/cpython
python__cpython-131053
# `enum.Flag.__contains__` changed behavior since python 3.12 # Bug report ### Bug description: I noticed some strange behavior with `enum.Flag` an the `__contains__` method in Python 3.12/3.13, as shown in the following examples. **Problem 1: Behavior changes at runtime** In the following code snippet the first pr...
17d06aeb5476099bc1acd89cd6f69e239e0f9350
db6a998b18e9476226507144b3b2fab854095dbc
python/cpython
python__cpython-131036
# use -flto=thin for clang-cl on Windows This started off as a build time analysis (https://github.com/python/cpython/issues/130090#issuecomment-2709951815), but since I now have the infrastructure, I tried `-flto=thin`, too: - faster in building 520.6 vs 651.2 seconds - is neutral on the pyperformance benchmarks - w...
91d6db7ee0006860a93d96c4c8bc58bfd8a38f6b
2bef8ea8ea045d20394f0daec7a5c5b1046a4e22
python/cpython
python__cpython-131071
# test_math.test_fma_zero_result() fails with the musl C library # Bug report ### Bug description: 1. While installing Python 3.13 version in docker:dind endingup without installation, getting the issue like as mentioned below ``` 675.0 0:00:26 load avg: 0.94 [18/44] test_fstring 675.0 /Python-3.13.2/Lib/test/te...
6146295a5b8e9286ccb8f90818b764c9a0192090
4b540313238de9d53bd9d9866eb481e954ad508f
python/cpython
python__cpython-131021
# Pylauncher does not correctly detect a BOM when searching for the shebang # Bug report ### Bug description: This is due to https://github.com/python/cpython/blob/475f933ed8b1c9546f1b5497a2241140c7065b5f/PC/launcher2.c#L1080-L1081 for wich clang-cl creates the following warnings: ``` 1>..\PC\launcher2.c(1080,29)...
36ef3bfe39d767e283b55fe86f34e7671b7f5d1c
5a484714c3497dd5c67a1469c0cc246bf1452892
python/cpython
python__cpython-131881
# Add tests for errors during byte formatting as for strings # Bug report ### Bug description: There are tests for string formatting errors - https://github.com/python/cpython/blob/main/Lib/test/test_str.py#L1581-L1591, but no tests for byte formatting errors - https://github.com/python/cpython/blob/main/Lib/test/te...
05557788f3c284ede73e6f94810ec796bb9d3721
06a110f5227ba9d52f6205fde55924a14cab36ff
python/cpython
python__cpython-131006
# [sqlite3] Converter Not Called with Aggregate Functions # Bug report ### Bug description: The converter functions are correctly called when using the raw field name in a query, but when you use an aggregate function like `MIN(fieldname)` the value is returned as a string. ## Minimal Example ```python import sqli...
f48887fb97651c02c5e412a75ed8b51a4ca11e6a
149fbb01f2f49e6d87ab916d099d19c57f7ed80a
python/cpython
python__cpython-131001
# New REPL exits when there are non-string candidates for suggestions # Crash report ### What happened? The new REPL in main will exit if a suggestion would be offered, but there are non-string candidates like below: ```python >>> import runpy ... runpy._run_module_code("blech", {0: "", "bluch": ""}, "") ... Except...
baccfdb3d4d004cfb5308674e5e6ea6e598abcd7
5f61cde80a9b33c8e118b1c009fe2aaa4bb87356
python/cpython
python__cpython-130962
# datetime: pure Python implementation of `fromisoformat()` handles times with trailing spaces inconsistently with the C extension # Bug report ### Bug description: Discovered primarily because PyPy uses the Python version of `datetime` from the stdlib, and `django.utils.dateparse.parse_datetime()` supports wider ra...
33494b4d0dafc34ff4f1c118b7b3b5d8de3dd0f4
69309a55bcb5381a9a218edc910da135f4d67479
python/cpython
python__cpython-130958
# `test_concurrent_futures`: `test_free_reference` is flaky # Bug report Seen in https://buildbot.python.org/#/builders/1368/builds/2775/steps/6/logs/stdio The test attempts to ensure that the executor doesn't hold on to the result object, but the executor necessarily holds onto it for a brief period from when it se...
19081158713526a3042c2ad3c6d5a589579b420f
44c55c23563fd27fced2ac575fd205f3e5c0a836
python/cpython
python__cpython-131041
# JIT: emit the AArch64 trampoline only when needed # Feature or enhancement ### Proposal: When emitting AArch64 trampoline we should check that the address we jump to is within 28bits range. If it is, we don't need the trampoline and we can jump directly to it. ### Has this already been discussed elsewhere? Thi...
8a33034d82314e2a5a8f39f9348e93135f94807d
63a638c43f821e9c8b3256e7122c06e539dc585d
python/cpython
python__cpython-130955
# `test_multiprocessing_spawn.test_manager`: `test_notify_n` deadlock # Bug report Seen in https://buildbot.python.org/all/#/builders/1606/builds/220/steps/6/logs/stdio. This looks like the same type of failures as we had with `test_notify_all`. It would have been nice to fix it in https://github.com/python/cpython/...
edd1eca336976b3431cf636aea87f08a40c94935
72e5b25efb580fb1f0fdfade516be90d90822164
python/cpython
python__cpython-130948
# PyQt6 uses PySequence_Fast() which was removed from the limited C API 3.14 # Bug report ### Bug description: In the issue https://github.com/python/cpython/issues/91417 I removed PySequence_Fast(), commit 2ad069d906c6952250dabbffbcb882676011b310: > Remove PySequence_Fast() from the limited C API. The function nev...
10cbd1fe88d1095a03cce24fb126d479668a67c3
3a189af4b203b9b3bd466680161b32016502defb
python/cpython
python__cpython-130949
# configparser throws TypeError for combination of interpolation and allow_no_value # Bug report ### Bug description: The configparser modules throws an Exception as: ``` Traceback (most recent call last): File "test.py", line 4, in <module> config.get("dummy", "b") File "python3.12/configparser.py", line 77...
c35c7353eb8fbccff2d3a6ab664426b31af00d4d
8b7cb947c5046d8fb32aad532048de87e09ed3f9
python/cpython
python__cpython-130934
# `_PyModule_IsPossiblyShadowing` can return `-1` without an exception set # Bug report ### Bug description: This can lead to an assertion failure: ``` #6 0x00007ffff7ca9e96 in __GI___assert_fail (assertion=0x555555a5e2da "PyErr_Occurred()", file=0x555555a6edcd "Objects/object.c", line=1253, function=0x555555a6f36...
0a9ae5ed48e6ea078f67ba03635c1c26209b5def
8190571a75fc46278042e7fffbe8aeb1f71ab21d
python/cpython
python__cpython-130967
# Not accurate when outputting an error during byte formatting for the 'i' flag, the 'd' flag is output, which can be misleading # Bug report ### Bug description: Code for demonstration: ```python >>> b"%i" % "str" Traceback (most recent call last): File "<python-input-0>", line 1, in <module> b"%i" % "str" ...
7c3692fe275088e986f92cec34dcccb823b31fa2
929afd1d6ee4fb89ac818037effe6577947103de
python/cpython
python__cpython-131843
# Local annotation turns local variables in cells # Bug report ### Bug description: Compiling this function ```python def f(x): a:x return x ``` Gives this bytecode: ``` -- MAKE_CELL 0 (x) 1 RESUME 0 3 LOAD_DEREF 0 (x) ...
425f60b9eb253c57bc32b453a02f1cf09963f85a
c6b1a073438d93d4e62957accc73487df6711851
python/cpython
python__cpython-130923
# TSAN complains on free-threaded list operations # Bug report ### Bug description: Discovered a case where TSAN complains about list operations in free-threaded build and posting it here on the suggestion of @colesbury. Reproducer: ``` import threading def copy_back_and_forth(b, a, count): b.wait() for _...
a025f27d94afe732be2e9e6f05b9007d04f983a8
6c6600f6831aec15b2acbd7a9bb9c275bd5f4a32
python/cpython
python__cpython-130918
# test_signal.test_itimer_virtual times out on macOS # Bug report ### Bug description: The test `test_signal.test_itimer_virtual` fails (in TIMEOUT) on our internal CI mac infrastructure (and also on my mac used for development) ``` [2025-03-06T12:21:58.340Z] Re-running test_signal in verbose mode (matching: test_i...
78790811989ab47319e2ee725e0c435b3cdd21ab
b1b4f9625c5f2a6b2c32bc5ee91c9fef3894b5e6
python/cpython
python__cpython-131317
# graphlib.TopologicalSorter.prepare() should be idempotent # Feature or enhancement ### Proposal: ## Proposed Behaviour [`TopologicalSorter.prepare()`](https://docs.python.org/3/library/graphlib.html#graphlib.TopologicalSorter.prepare) should be idempotent such that calling it repeatedly without draining anything ...
c1b42db9e47b76fca3c2993cb172cc4991b04839
f81990024554a75e2ab31133a72d9f0954690435
python/cpython
python__cpython-131550
# PEP 649 behavior for partially executed modules # Bug report ### Bug description: Consider this package: ``` $ ls recmod/ __main__.py a.py b.py $ cat recmod/__main__.py from . import a print(a.__annotations__) $ cat recmod/a.py v1: int from . import b v2: int $ cat recmod/b.py from . import a print(a.__an...
922049b613d155ade4c4a8f83452767bea003a9f
5bf0f3666e272798789ff900b1071760c73b46fd
python/cpython
python__cpython-130904
# Typo in `_GUARD_BOTH_UNICODE` dsl # Bug report ### Bug description: There appears to be a typo in the `optimizer_bytecodes` for `_GUARD_BOTH_UNICODE` where the right operand is not getting checked: https://github.com/python/cpython/blob/5e73ece95e8aa92d0695acb039ef54e2103ce66b/Python/optimizer_bytecodes.c#L163-L1...
10cdd7f91ff45737e409a2e2c58fd8a9aa7c5a16
aeb23273867b27818a3dabd5fca086a1a2e8d229
python/cpython
python__cpython-130894
# Typo in sqlite3.__main__.SqliteInteractiveConsole # Documentation The docstring for sqlite3.\_\_main\_\_.SqliteInteractiveConsole.runsource is ``` """Override runsource, the core of the InteractiveConsole REPL. Return True if more input is needed; buffering is done automatically. Return False is input is a comple...
8190571a75fc46278042e7fffbe8aeb1f71ab21d
886a4d74ee7b19d027fae1ba4579a99a805878a2
python/cpython
python__cpython-131042
# JIT: remove jumps at the end of every micro op on aarch64 # Feature or enhancement ### Bug description: AArch64 JIT stencils contain a jump at the end of every micro op: ``` ... // d4: a8c17bfd ldp x29, x30, [sp], #0x10 // d8: 14000000 b 0xd8 <_JIT_ENTRY+0xd8> // 00000000000000d8: ...
ea0453ee979174d6fc14aae0fd85e4ede6742a86
0a91456ad14bb598646f50bf8f034e8887c0c468
python/cpython
python__cpython-130935
# conditional blocks in class definitions seem to be evaluating types even when these conditionals are false # Bug report ### Bug description: using a conditional in a class definition like `if TYPE_CHECKING` where `TYPE_CHECKING` is False, or any kind of false conditional, seems to be ignored when types are evaluat...
898e6b395e63ad7f8bbe421adf0af8947d429925
7bb41aef4b7b8f3c3f07c11b801c5b7f8afaac7f
python/cpython
python__cpython-130879
# PCBuild ssl restore some functionaly # Bug report ### Bug description: My changes is work around this commit - https://github.com/python/cpython/commit/8c9d99ff2227d7a069b29f26004f33d65a1df177 Old realization uses `(exit_ok=True)` which raise exceptions only if `errno` == `EEXIST`. => We get exception only if dir...
2904ec2273762df58645a8e245b2281884855b8c
4f6218959e35f649061484cce9de7fc810586533
python/cpython
python__cpython-131098
# Perf doesn't show the Python functions when using the -O0 compilation flag without frame pointers # Bug report ### Bug description: When compiling without frame pointers and the -O0 optimization flag, Perf cannot see the Python functions. This is not the case when using -O3, -O2, -O1, -Og or when enabling frame p...
d134bd272f90bfc2dfb55b126d4552c996251fc1
b9f0943c1e31acd0895a4b57b4af57a5a1e0a2b1
python/cpython
python__cpython-130865
# Thousands separators in fractional part are ignored in width computation # Bug report ### Bug description: Examples: ```pycon >>> f"{0.1234567891:010.6,f}" # should be '00.123,457' '000.123,457' >>> len(_) 11 >>> f"{0.1234567891:010.7,f}" # should be '0.123,456,8' '00.123,456,8' >>> len(_) 12 ``` ### CPython ve...
2352bd418a7a0c38f8ea135bd1879937d90ecce1
10cdd7f91ff45737e409a2e2c58fd8a9aa7c5a16
python/cpython
python__cpython-130853
# Python 3.13t crashes when constructing code objects with non-standard constants # Bug report PyTorch Dynamo constructs code objects with non-standard constants. This is unusual, but seems to work with the default (non-free threaded build) of CPython. However, it crashes in the free threaded build due to a few asse...
2905690a91bf72cdf0fb919b5193849bb67732e2
78d50e91ff31bc7fd0ac877cf59ee083e94d0915
python/cpython
python__cpython-130828
# PyLong_AsLongAndOverflow does not guarantee overflow is -1 when value is -1 # Bug report ### Bug description: In the function `pylong_aslongandoverflow` https://github.com/python/cpython/blob/3929af5e3a203291dc07b40c9c3515492e3ba7b4/Modules/_testlimitedcapi/long.c#L621-L632 there is an assertion `overflow == -1` ...
90130807d9c5a55b2a64024f5dfbee4785b9a27c
e53d105872fafa77507ea33b7ecf0faddd4c3b60
python/cpython
python__cpython-130817
# Fix the title of "Type Objects" page # Documentation [Type Objects](https://docs.python.org/3/c-api/typeobj.html) and [Type Objects](https://docs.python.org/3/c-api/type.html) have the same page title even though their contents are different. For consistency with other pages, the title of the former page might be s...
6b932edc5216d9766e70fef300a6b842ab33204c
a5776639c8fde8b3b7c90821ab78ddb64130f4c0
python/cpython
python__cpython-130905
# Emit ResourceWarning when GzipFile is deleted with unwritten data # Feature or enhancement ### Proposal: This may indicate accidental data loss. Ways to make sure all data is written: 1. Use the [file-like object](https://docs.python.org/3/glossary.html#term-file-object) as a [“With Statement Context Manager”](ht...
93089c073661f5aa9f8cca574a3e223716728639
d12d8c50cddeb79f8d6e3d26a33f8f6b14bb4071
python/cpython
python__cpython-130805
# [Windows] New REPL doesn't allow to input non-ASCII Unicode characters # Bug report ### Bug description: I got following error when I tried to type Cyrillic characters (tried ч in this example) in the new repl: ```pytb .\python.bat Running Release|x64 interpreter... Python 3.14.0a5+ (heads/main-dirty:d0eb01c9de9, ...
7c98b0674daa3e4eb3e8f35afb61a0dba61d1780
6ab5c4aa05bf35832a3ccd1e71b28b8475fa30f4
python/cpython
python__cpython-130808
# Free-threading QSBR delayed free mem fails in high thread turnover environment # Crash report ### What happened? When cycling a lot of threads and modifying objects which use `PyMem_FreeDelayed()` in those threads the queues of memory blocks to free build up without ever being freed until the process runs out of m...
2f6e0e9f7001769be746ee96356656d3ebdc7f96
cb67b44ca92f9930b3aa2aba8420c89d12a25303
python/cpython
python__cpython-130801
# Remove references to Unicode objects being ready We have some code referrencing readiness of Unicode objects but this property is deprecated (see https://github.com/python/cpython/issues/129894#issuecomment-2693828966). Following @encukou's advice, we should address each module with a separate PR so that experts can...
3a7f17c7e2f72a836a019c316818c446a0c71d75
8a64a62002fa3cdc93cb4cfee315edb235cad8cb
python/cpython
python__cpython-130795
# Crash in Python/assemble.c:301: write_location_info_entry: Assertion `column >= -1' failed. # Crash report ### What happened? ## Bug Description This is a bug that only affects DEBUG builds. The reproducer is as follow: ```python import ast tree = ast.Module(body=[ ast.Import(names=[ast.alias(name='tracebac...
bc5233b6a5cdd8f77a4737ce317f94110869c082
8e260b384aad1910e12b68981cd8390919184d5d
python/cpython
python__cpython-130738
# Ensure `stdbool.h` is included after `Python.h` # Bug report Including `stdbool.h` before `Python.h` may cause build issues when using `zig cc`. See https://github.com/python/cpython/pull/130641 and https://github.com/python/cpython/pull/130641#issuecomment-2692299464. <!-- gh-linked-prs --> ### Linked PRs * gh-1...
214562ed4ddc248b007f718ed92ebcc0c3669611
051f0e5683fec3840fa7fc99723741dd2d701eae