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-125272 | # Fix thread-safety of interpreter cached object `str_replace_inf` (free threading)
# Bug report
We have a number of per-interpreter cached objects. Some of these are lazily initialized in a way that is not thread-safe in the free threading build. (See https://github.com/python/cpython/issues/125221, for example).
... | 427dcf24de4e06d239745d74d08c4b2e541dca5a | bb594e801b6a84823badbb85b88f0fc8b221d7bf |
python/cpython | python__cpython-125261 | # gzip.compress output is non-deterministic
# Bug report
### Bug description:
```python
import gzip
gzip.compress(b'')
```
output varies by default, which breaks reproducible builds in cases such as
https://github.com/getmoto/moto/blob/fc60bd1c5f6e6184e30a6db8b65059a2855cd28e/setup.py#L28
GNU gzip (since 1.10) defa... | dcd58c50844dae0d83517e88518a677914ea594b | 9944ad388c457325456152257b977410c4ec3593 |
python/cpython | python__cpython-125647 | # `TypeError` when raising an exception inside the `__init__` method of an enum class
# Bug report
### Bug description:
With https://github.com/python/cpython/pull/111815, any exception raised inside the `__init__` method of an enum class [^1] is expected to be:
1. instantiable (not the case with Pydantic `Validatio... | 34653bba644aa5481613f398153757d7357e39ea | aaed91cabcedc16c089c4b1c9abb1114659a83d3 |
python/cpython | python__cpython-125273 | # Argparse logs incorrect ambiguous option
# Bug report
### Bug description:
Given this example script
```python
import argparse
class CsvListAction(argparse.Action):
"""
argparse Action to convert "a,b,c" into ["a", "b", "c"]
"""
def __call__(self, parser, namespace, values, option_string=None):
... | 63cf4e914f879ee28a75c02e867baa7c6047ea2b | 07c2d15977738165e9dc4248e7edda7c75ecc14b |
python/cpython | python__cpython-125415 | # Race condition when importing `collections.abc`
# Bug report
### Bug description:
Discovered alongside #125243 with similar steps to reproduce. I don't have a simpler way to trigger this than "run the PyO3 tests in a loop" because I think it requires many threads accessing the python runtime simulatenously.
... | fed501d7247053ce46a2ba512bf0e4bb4f483be6 | 332356b880576a1a00b5dc34f03d7d3995dd4512 |
python/cpython | python__cpython-125281 | # ZoneInfo comparison fails on free-threaded build
# Bug report
### Bug description:
(originally noticed by @davidhewitt in https://github.com/python/cpython/issues/116738#issuecomment-2404360445)
Very infrequently, PyO3 tests for timezone conversions will fail with errors like:
```
---- conversions::chrono_tz::te... | f1d33dbddd3496b062e1fbe024fb6d7b023a35f5 | cb8e5995d89d9b90e83cf43310ec50e177484e70 |
python/cpython | python__cpython-125250 | # win 10 Python-3.13.0 tkinter fails in venv
# Bug report
### Bug description:
Installed python 3.13.0 in windows 10 at c:\python313
created venv at c:\users\rptla\tmp\py313
Tkinter based app failed to start in the venv. After testing tkinter I see these results ie error in venv starting Tk() wotks in installed.
... | b3aa1b5fe260382788a2df416599325ad680a5ee | 18c74497681e0107d7cde53e63ea42feb38f2176 |
python/cpython | python__cpython-125266 | # Make PyInitConfig_Free(NULL) a no-op
# Feature or enhancement
I think that it would simplify the code if make `PyInitConfig_Free(NULL)` a no-op. Currently it requires the argument to be non-NULL. This would simplify the code:
```c
PyInitConfig *config = NULL;
// some code
if (error_occurred) {
goto Error;
}
con... | 546dddca43a2a69dbe33d230e9e540636b403270 | 92af191a6a5f266b71373f5374ca0c9c522d62d9 |
python/cpython | python__cpython-125226 | # Misaligned columns in help('topics') due to the length of "ASSIGNMENTEXPRESSIONS"
# Documentation
### Description
The [`pydoc.Helper.list`](https://github.com/python/cpython/blob/main/Lib/pydoc.py#L2085) function currently uses default values of 80 characters per line and 4 columns. This provides an implicit m... | b22460c44d1bc597c96d4a3d27ad8373d7952820 | ee36db550076e5a9185444ffbc53eaf8157ef04c |
python/cpython | python__cpython-125267 | # test_importlib test_multiprocessing_pool_circular_import() fails randomly on Thread sanitizer (free-threading) on GitHub Actions
Example: https://github.com/python/cpython/actions/runs/11263361511/job/31321078076?pr=125219
```
0:01:54 load avg: 4.86 [ 9/22/1] test_importlib failed (1 failure) (1 min 35 sec) -- ... | b12e99261e656585ffbaa395af7c5dbaee5ad1ad | c1913effeed4e4da4d5310a40ab518945001ffba |
python/cpython | python__cpython-125209 | # Build failure on MSVC 1935 with JIT enabled
# Bug report
### Bug description:
Building on MSVC 1935 currently fails when building with the JIT, because that compiler does not support empty array initializers (`{}`).
```python
PCbuild\build.bat --experimental-jit -c Release
...
C:\actions-runner\_work\benchmarki... | c8fd4b12e3db49d795de55f74d9bac445c059f1b | f8ba9fb2ce6690d2dd05b356583e8e4790badad7 |
python/cpython | python__cpython-125322 | # CTypes test failed, complex double problem
# Bug report
### Bug description:
Python binary has been built in the standard way:
```
./configure --with-pydebug && make -j
```
But test_ctypes fails:
```
-> % ./python -m unittest -v test.test_ctypes.test_libc.LibTest.test_csqrt
test_csqrt (test.test_ctyp... | aac89b54c5ee03c4d64fbdfbb6ea3001e26aa83a | 54c6fcbefd33a8d8bf8c004cf1aad3be3d37b933 |
python/cpython | python__cpython-125199 | # Use the public PyUnicodeWriter API
Replace `PyUnicode_New()`, `PyUnicode_CopyCharacters()`, etc. with `PyUnicodeWriter`. It avoids creating incomplete Unicode strings: see [Avoid creating incomplete/invalid objects](https://github.com/capi-workgroup/api-evolution/issues/36).
<!-- gh-linked-prs -->
### Linked PRs
* ... | 9bda7750c2af779d3431f5ea120db91c6c83ec49 | f978fb4f8d6eac0585057e463bb1701dc04a9900 |
python/cpython | python__cpython-125251 | # "Immortal" objects aren't immortal and that breaks things.
# Bug report
### Bug description:
[Immortal](https://dictionary.cambridge.org/us/dictionary/english/immortal) objects should live forever. By definition, immortality is a permanent property of an object; if it can loose immortality, then it wasn't immo... | c9014374c50d6ef64786d3e7d9c7e99053d5c9e2 | 01fc3b34cc6994bc83b6540da3a8573e79dfbb56 |
python/cpython | python__cpython-125183 | # Spelling Error
# Documentation
In the Doc folder, library subfolder, in the document `__future__.rst` (`Doc/library/__future__.rst`) there is a spelling error in the sentence:
“PEP 649: Deferred evalutation of annotations using descriptors”
Evalutation should be evaluation.
<!-- gh-linked-prs -->
### Lin... | e0835aff2e45629ee85af642190e79e4061312b5 | 6b533a659bc8df04daa194d827604dcae14d5801 |
python/cpython | python__cpython-125303 | # Make `pthread_self()` return a non-zero value in `thread_pthread_stubs.h`
Currently our stub for `pthread_self()` (used by WASI) just returns zero:
https://github.com/python/cpython/blob/37228bd16e3ef97d32da08848552f7ef016d68ab/Python/thread_pthread_stubs.h#L106-L109
I propose we return a non-zero value for be... | 08489325d1cd94eba97c5f5f8cac49521fd0b0d7 | 022c50d190e14affb952a244c4eb6e4a644ad0c9 |
python/cpython | python__cpython-125151 | # test_fma_zero_result fails due to unexpected zero instead of negative zero on NetBSD
# Bug report
### Bug description:
```sh
home$ ./python -m test test_math -m test_fma_zero_result
```
```python
Using random seed: 4191327291
0:00:00 load avg: 0.57 Run 1 test sequentially in a single process
0:00:00 load avg: 0.57... | 92760bd85b8f48b88df5b81100a757048979de83 | e0c87c64b1cb4112ed5cfc1ae84ff8e48b1c0340 |
python/cpython | python__cpython-125143 | # For new REPL the help page should explain keyboard shortcuts
# Feature or enhancement
### Proposal:
It would be nice if the help you see when typing `help` in the new REPL would mention the keyboard shortcuts.
### Has this already been discussed elsewhere?
This is a minor feature, which does not need previous ... | 68a737691b0fd591de00f4811bb23a5c280fe859 | 31a500a92b1baf49a21d15b6b5fc0b6095f1e305 |
python/cpython | python__cpython-125212 | # Python 3.13.0 REPL loads local files unexpectedly, causing conflicts and security issues
# Bug report
### Bug description:
## Description
When starting the Python 3.13.0 REPL in a directory containing a file named `code.py`, the REPL attempts to load this local file instead of the standard library `code` modu... | c7d5d1d93b630e352abd9a0c93ea6d34c443f444 | 1877543d03d323d581b5fc0f19eff501926ba151 |
python/cpython | python__cpython-125144 | # `_thread.RLock.release` is not safe in free-threaded builds
Similar to #117721, `_thread.RLock.release` is not safe in free-threaded builds, it should be changed to use `_PyRecursiveMutex`.
cc @colesbury
<!-- gh-linked-prs -->
### Linked PRs
* gh-125144
<!-- /gh-linked-prs -->
| 67f6e08147bc005e460d82fcce85bf5d56009cf5 | 5217328f93f599755bd70418952392c54f705a71 |
python/cpython | python__cpython-125169 | # struct module has undefined behavior when loading bools
# Bug report
### Bug description:
https://github.com/python/cpython/blob/a5fc50994a3fae46d0c3d496c4e1d5e00548a1b8/Modules/_struct.c#L489-L491
Bool values are required to be either 0 or 1, but this memcpy will copy an arbitrary value to it. This produces UBSA... | 87d7315ac57250046372b0d9ae4619ba619c8c87 | e4cab488d4445e8444932f3bed1c329c0d9e5038 |
python/cpython | python__cpython-125424 | # pdb: can't debug a script with arguments
# Bug report
### Bug description:
_Hello everyone,_
With Python 3.13, `pdb` doesn't pass arguments like `-b` or `--bar` to a script while it works fine with Python 3.12.
<details><summary><b>test.py</b></summary>
<p>
```python
import sys
print(' '.join(sys.argv))
```
<... | 9c2bb7d551a695f35db953a671a2ddca89426bef | 3ea488aac44887a7cdb30be69580c81a0ca6afe2 |
python/cpython | python__cpython-125097 | # The `site` module must not load `_pyrepl` if `PYTHON_BASIC_REPL` env var is set
Even if the new REPL is disabled by setting PYTHON_BASIC_REPL=1 env var, the site module still loads it. I propose to make sure that it's not loaded in this case.
Moreover, PYTHON_BASIC_REPL should be ignored if -E or -I command line ... | 65ce228d63878d8b6d0005f682e89ad9d5289c4b | 5967dd8a4de60a418de84d1d1d9efc063ad12c47 |
python/cpython | python__cpython-125085 | # In "out-of-tree" build `regen-all` generates different paths
# Feature or enhancement
### Proposal:
In a "out-of-tree" build `regen-all` generates different paths
I build CPython with my `build` directory outside of the cpython checkout:
```
dev_dir/
build/
cpython/ <- cpython repo clone
```
and then fro... | 7dca7322cca7ff146444e56f28f21f1090987fff | fca552993da32044165223eec2297b6aaaac60ad |
python/cpython | python__cpython-125074 | # Assignment expressions are missing from auto-generated topics
# Documentation
Assignment expressions are missing from the auto-generated topics file. This can be seen by regenerating the file with `make pydoc-topics`.
<!-- gh-linked-prs -->
### Linked PRs
* gh-125074
* gh-125077
<!-- /gh-linked-prs -->
| 447a15190d6d766004b77619ba43e44256e348e2 | a7f0727ca575fef4d8891b5ebfe71ef2a774868b |
python/cpython | python__cpython-125156 | # Pathlib join pure windows path and pure posix path changes it behaviour on 3.13
# Bug report
### Bug description:
## 3.12.7
```
Python 3.12.7 (main, Oct 8 2024, 00:39:14) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pathlib; pathlib.PureWindowsPath("C:\\A... | cb8e5995d89d9b90e83cf43310ec50e177484e70 | c6d7b644c2425b397cfb641f336bea70eb8a329a |
python/cpython | python__cpython-125064 | # Emit slices as constants in the bytecode compiler
# Feature or enhancement
### Proposal:
Constant slices are currently emitted as multiple bytecodes by the Python bytecode compiler.
For example, `x[:-2, 1:-1]` generates:
```
LOAD_CONST 4 (0)
LOAD_CONST 5 (-... | c6127af8685c2a9b416207e46089cee79d028b85 | 7dca7322cca7ff146444e56f28f21f1090987fff |
python/cpython | python__cpython-125141 | # `_thread` module docs: update yet another bullet point in the *caveats* list
# Documentation
[*Note:* This issue is, in a way, a continuation of gh-125025.]
Near the [end](https://docs.python.org/3.14/library/_thread.html#index-2) of the documentation of the `_thread` module there is a list of caveats. One of ... | 0135848059162ad81478a7776fec622d68a36524 | b12e99261e656585ffbaa395af7c5dbaee5ad1ad |
python/cpython | python__cpython-125042 | # Re-enable skipped test_zlib tests on s390x hardware acceleration
Some variants of the s390x platform have instructions for hardware-accelerated deflate compression. With HW acceleration, compressed byte stream can be different from the software implementation in zlib. (It still decompresses to the original of course... | cc5a225cdc2a5d4e035dd08d59cef39182c10a6c | fcef3fc9a593e2aa868d23cf2d91c57d8bf60ac6 |
python/cpython | python__cpython-125071 | # `this_instr` should be const in generated code. `this_instr` is generated, and should be `const`.
# Bug report
### Bug description:
We currently generate
```C
_Py_CODEUNIT *this_instr =...
```
we should generate
```C
_Py_CODEUNIT* const this_instr =...
```
to prevent it being accidentally changed.
### CPython ve... | 6b533a659bc8df04daa194d827604dcae14d5801 | 3024b16d51bb7f74177c5a5038cc9a56fd2b26bd |
python/cpython | python__cpython-125026 | # `_thread` module docs: remove/update certain bullet points in the *caveats* list
# Documentation
Near the [end ](https://docs.python.org/3.14/library/_thread.html#index-2)of the documentation of the `_thread` module there is a list of *caveats*. It looks like it was written a long time ago and some of its items s... | 1e098dc766ba4f29a63da4f188fb214af7623365 | feca4cf64e9742b9c002d5533ced47e68b34a880 |
python/cpython | python__cpython-125027 | # `importlib` documentation doesn't declare functions properly
https://docs.python.org/3/library/importlib.metadata.html#distribution-versions doesn't actually define a Sphinx function for `version`, so attempted references with `` `:func:`importlib.metadata.version` `` (including via the `intersphinx` extension) fail... | cda3b5a576412a8671bbe4c68bb792ec14f1a4b1 | d8f707420b3b0975567e0d9cab60c978d6cb7111 |
python/cpython | python__cpython-125636 | # Segfault on ``cls.__dict__['__new__'].__annotations__``
# Crash report
### What happened?
The following is a reproducer of (another) segfault discovered when trying to test Python 3.14 in CI for Sphinx:
```python
class Spam:
def __new__(cls, x, y):
pass
if __name__ == '__main__':
as... | c3164ae3cf4e8f9ccc4df8ea5f5664c5927ea839 | d8c864816121547338efa43c56e3f75ead98a924 |
python/cpython | python__cpython-125015 | # Heap-use-after-free READ 8 · dictkeys_decref in fuzz_ast_literal_eval
# Crash report
### What happened?
From: https://oss-fuzz.com/testcase-detail/5876542813569024
Introduced in: https://github.com/python/cpython/compare/29a1a6e3ed6f606939b4aaf8d6955f368c3be3fc...43cd7aa8cd88624f7211e47b98bc1e8e63e7660f
[repro... | a1be83dae311e4a1a6e66ed5e128b1ad8794f72f | 3fc673e97dafb8a73ee99937cf2bf0b849b1f418 |
python/cpython | python__cpython-125013 | # Tokenize does not roundtrip {{ after \n
# Bug report
### Bug description:
```python
import tokenize, io
source_code = r'''
f"""{80 * '*'}\n{{test}}{{details}}{{test2}}\n{80 * '*'}"""
'''
tokens = tokenize.generate_tokens(io.StringIO(source_code).readline)
x = tokenize.untokenize((t,s) for t, s, *_ in tok... | db23b8bb13863fcd88ff91bc22398f8e0312039e | 39c859f6ffd8dee7f48b2181c6cb59cffe8125ff |
python/cpython | python__cpython-125861 | # Documenting that the new (3.14) `pathlib` copy functionality uses Copy-on-Write
# Documentation
(edited)
The PR [119058](https://github.com/python/cpython/pull/119058) and [122369](https://github.com/python/cpython/pull/122369) added `pathlib.Path.copy()`, with Copy-on-Write support. CoW should be documented, be... | ff8349979c2ca4e442afc583e1217519611c6c48 | 8525c9375f25e6ec0c0b5dfcab464703f6e78082 |
python/cpython | python__cpython-124993 | # Segfault on Python 3.13.0rc3 (free-threaded) with `requests`
# Crash report
### What happened?
Reproducer:
```python
import queue
import threading
import requests
class HyperlinkAvailabilityCheckWorker(threading.Thread):
def __init__(self, rqueue, wqueue) -> None:
self.rqueue = rqueue
... | 4c53b2577531c77193430cdcd66ad6385fcda81f | 2a378dba987e125521b678364f0cd44b92dd5d52 |
python/cpython | python__cpython-124974 | # locale.nl_langinfo(locale.ALT_DIGITS) does not work
ALT_DIGITS is a glibc specific item. It is supported by Python (there is an explicit list of supported items), but the result is not correct.
From [The GNU C Library Reference Manual](https://sourceware.org/glibc/manual/latest/html_node/The-Elegant-and-Fast-Way.... | dcc4fb2c9068f60353f0c0978948b7681f7745e6 | 5ca4e34bc1aab8321911aac6d5b2b9e75ff764d8 |
python/cpython | python__cpython-124971 | # Leftover rst markup in the Compiler design internal document
# Documentation
The Compiler design document contains some leftover rst markup, which was probably missed when the document was migrated from the dev guide:
https://github.com/python/cpython/blob/5e9e50612eb27aef8f74a0ccc234e5cfae50c4d7/InternalDocs/co... | 994051e086b9ce624a3b16750d6f692bc4a3b07b | bd393aedb84a7d84d11a996bcbbf57cad90af7db |
python/cpython | python__cpython-124999 | # `barry_as_FLUFL` future flag does not work in new REPL
# Bug report
New REPL:
```python
>>> from __future__ import barry_as_FLUFL
>>> 1 <> 2
File "<python-input-1>", line 1
1 <> 2
^^
SyntaxError: invalid syntax
```
Old REPL:
```python
>>> from __future__ import barry_as_FLUFL
>>> 1 <> 2
True
```
I u... | 6a08a753b702ac63c9b6ac58dd204d1fe9662e9d | 5f4e5b598cab86d5fd5727d423c9728221889ed0 |
python/cpython | python__cpython-124959 | # refcycles in exceptions raised from asyncio.TaskGroup
# Bug report
### Bug description:
asyncio.TaskGroup attempts to avoid refcycles in raised exceptions by deleting `self._errors` but when I reviewed the code it doesn't actually achieve this:
see https://github.com/python/cpython/blob/5e9e50612eb27aef8f74a0ccc2... | e99650b80ace3893c2a80b3f2a4aca99cb305191 | 187580d95c8339a3b6e2b012f98d86101c346cfa |
python/cpython | python__cpython-124957 | # `_csv.c`: many temp macros do not use `#undef`
# Bug report
This does not cause any real problems right now, but it can in some point, out of bad luck.
Consider this as a small refactoring, not a bug.
<!-- gh-linked-prs -->
### Linked PRs
* gh-124957
<!-- /gh-linked-prs -->
| 51d426dc033ef9208c0244a569f3e816e4c328c9 | d1453f60c2d289d74d535874e07741745b023c90 |
python/cpython | python__cpython-124945 | # Add socket.SO_ORIGINAL_DST
# Feature or enhancement
### Proposal:
The `SO_ORIGINAL_DST` should be available through the sockets module.
I realize its not part of the standard BSD interface, but Cpython does include other linux-specific socket options such as `SO_VM_SOCKETS_*`.
Further, it has been a sour... | 1bffd7a2a738506a4ad50c6c3c2c32926cce6d14 | 2a5cdb251674ce8d9a824c102f7cd846d944cfa4 |
python/cpython | python__cpython-124933 | # Cross builds: distinguish between installation prefix and host prefix in configure.ac?
In Emscripten and wasi builds, and presumably for other cross builds, the build file system and the host file system look different. It's natural to want to install into `cross-build/$TARGET/lib` and then mount that as `/lib` in t... | b1f13bce62ff666f59286e8325011d8e9e0ddca7 | 6742f14dfd3fa8ba8a245efa21a4f723160d93d4 |
python/cpython | python__cpython-124929 | # Emscripten node support: Clean up old node <= 16 flags
configure.ac has a bunch of `HOSTRUNNER` configuration that tries to work out what `--experimental` flags to pass to the node runtime. Most of these are only needed for node <= 16. Node 16 has been end of life since October of 2023. We should remove these.
<!--... | dc2552d429c91310b0c410c3e856728d8866b05f | 85799f1ffd5f285ef93a608b0aaf6acbb464ff9d |
python/cpython | python__cpython-125001 | # high CPU usage and freezing in Python REPL with half space character (U+200C)
# Bug report
### Bug description:
When entering comments in Python's REPL that contain a Half Space character (U+200C) the REPL experiences 100% CPU usage and becomes unresponsive (freezes) when using the up arrow to retrieve previous co... | 6ab5c4aa05bf35832a3ccd1e71b28b8475fa30f4 | a931a8b32415f311008dbb3f09079aae1e6d7a3d |
python/cpython | python__cpython-124918 | # `os.path.exists` and `lexists` no longer allow a keyword argument on Windows
# Bug report
### Bug description:
Historically `os.path.exists` and `os.path.lexists` have accepted their argument as a keyword, `path=`. However, in 3.13 on Windows (#118755) these functions were reimplemented in C and the C functions on... | cc2938a18967c9d462ebb18bc09f73e4364aa7d2 | a00221e5a70e54a281ba0e2cff8d85cd37ae305f |
python/cpython | python__cpython-124893 | # Remove redundant artificial rules and functions for them in parser.c file
# Feature or enhancement
### Proposal:
It seems like PEG parser produces more than one artificial rule for the same grammar rule.
For example, on each gather rule (','.NAME+) in Grammar/python.gram a function '_gather_N_rule' will be generat... | 1f9025a4e7819bb4f7799784710f0f3750a9ca31 | e6dd71da3acc21edcc205d024d18004c7a3c7f45 |
python/cpython | python__cpython-130602 | # race condition in threading when interpreter finalized while daemon thread runs (thread sanitizer identified)
# Bug report
### Bug description:
Using the code in #105805 with the newly added `test.test_threading.ThreadTests.test_finalize_daemon_thread_hang` test enabled you can reproduce this thread sanitizer cras... | cc17307faaa248535c65f6a7668e06dc8ef04575 | 038e4d606bdc3e38f74514ae3ddfdc7a48b7b19e |
python/cpython | python__cpython-127101 | # Intermittent timerfd failure on Android
# Bug report
This happens quite often, but usually doesn't cause a buildbot failure because it passes on the second attempt. However, it's now double-failed twice:
* https://buildbot.python.org/#/builders/1594/builds/54
* https://buildbot.python.org/#/builders/1594/builds/14... | 4ca2c82862e3810a7d68799df2bb5198a9afb219 | 3c7a90a83146dc6e55f6f9ecd9af0bf9682f98a6 |
python/cpython | python__cpython-124952 | # remove_unreachable: Assertion `target->b_predecessors == 0 || target == b->b_next' failed
# Crash report
### What happened?
The following code causes an assertion in a cpython debug build
```python
name_3=5
name_2=2
name_1=0
while name_3 <= name_2 > name_1:
try:
raise
except:
pass
fi... | f474391b26aa9208b44ca879f8635409d322f738 | 994051e086b9ce624a3b16750d6f692bc4a3b07b |
python/cpython | python__cpython-124859 | # asyncio.open_connection happy_eyeballs_delay leaves refcycles with exception tracebacks
# Bug report
### Bug description:
```python
import asyncio
import gc
import objgraph
import weakref
async def amain():
exc = None
try:
await asyncio.open_connection(
host="localhost", ... | c066bf553577d1000e208eb078d9e758c3e41186 | 6810928927e4d12d9a5dd90e672afb096882b730 |
python/cpython | python__cpython-124843 | # import_helper.make_legacy_pyc() works incorrectly for source files in a directory
# Bug report
For source file with relative path "path/to/file.py" it creates file with incorrect path "/absolute/path/to/path/to/file.pyc" instead of "path/to/file.pyc".
* it adds the directory path to the source file twice.
* it see... | 60ff67d010078eca15a74b1429caf779ac4f9c74 | da1e5526aee674bb33c17a498aa3781587b9850c |
python/cpython | python__cpython-124587 | # Improve invalid input type handling in `tomllib.loads`
# Feature or enhancement
### Proposal:
`tomllib.loads` only accepts str as input. Given bytes, it throws
```
TypeError: a bytes-like object is required, not 'str'
```
This is a bubbled up exception from the `replace` method on line https://github.com... | 9ce90206b7a4649600218cf0bd4826db79c9a312 | 120729d862f0ef9979508899f7f63a9f3d9623cb |
python/cpython | python__cpython-124834 | # Subsequent datetime.now() calls return the same datetime
# Bug report
### Bug description:
Subsequent `datetime.now()` may return the same moment in time.
```python
from datetime import datetime, UTC
now1 = datetime.now(UTC)
for i in range(10_000):
a = i
now2 = datetime.now(UTC)
assert now1 < now2
```
```
... | 760b1e103a0aa696cdf448e0d500cd1bac2213fa | c6127af8685c2a9b416207e46089cee79d028b85 |
python/cpython | python__cpython-124821 | # Fix compiler warnings on JIT builds where `-mno-outline-atomics` are not supported.
See https://github.com/python/cpython/actions/runs/11115927540/job/30887579831?pr=124813#step:6:1063 as an example.
Related to a change I made in https://github.com/python/cpython/pull/124443/files#diff-700c6057d24addce74e8787edb5... | 6737333ac5777345d058271621ccb3c2d11dc81e | 9b31a2d83fa7cb0fe4d75ce7cf6a2c9ea2ce0728 |
python/cpython | python__cpython-124795 | # TypeAliasType with should also raise an error if non-default type parameter follows default type parameter
# Bug report
### Bug description:
The following statement is invalid:
```python
type X[T_default=int, T] = (T_default, U)
# SyntaxError: non-default type parameter 'T' follows default type parameter
```
Ho... | 2115d76acc14effb3dbb9fedcf21048b2ad62c5e | b3aa1b5fe260382788a2df416599325ad680a5ee |
python/cpython | python__cpython-124769 | # `test_class.TestInlineValues.test_detach_materialized_dict_no_memory` leaks references
# Bug report
### Bug description:
Refleaks tests are failing on main due to a leak from `test_class.TestInlineValues.test_detach_materialized_dict_no_memory`:
```
> ./python -m test -R 3:3 test_class --match test.test_class.Tes... | 6f4d64b048133c60d40705fb5ef776f78c7dd710 | b5774603a0c877f19b33fb922e2fb967b1d50329 |
python/cpython | python__cpython-124721 | # Update "Using Python on macOS" document for free-threading installation
The existing [Using Python on a Mac](https://docs.python.org/3/using/mac.html) section of the `Python Setup and Usage` document needs to document the steps needed to install the optional free-threading interpreter support in Python 3.13. In 3.13... | 60181f4ed0e48ff35dc296da6b51473bfc553d16 | 54e29ea4eb7b54c888fd5764eef2215535e4d862 |
python/cpython | python__cpython-124704 | # Do not raise an Exception when exiting pdb
# Feature or enhancement
### Proposal:
Currently, if you set a `breakpoint()` in your code, and exit with `q` or `ctrl+D`, the output is just ugly:
```
Traceback (most recent call last):
File "/Users/gaotian/programs/cpython/example.py", line 11, in <module>
while ... | 7d275611f62c9008c2d90b08c9f21462f80a8328 | a49225cc66680129f129d1fcf6e20afb37a1a877 |
python/cpython | python__cpython-124548 | # Add concurrent.futures.InterpreterPoolExecutor
# Feature or enhancement
### Proposal:
While we wait on [PEP 734](https://peps.python.org/pep-0734/), there's nothing blocking us from adding a new executor for multiple interpreters. Doing so would allow people to start trying them out. (I wish I had thought of... | a5a7f5e16d8c3938d266703ea8fba8ffee3e3ae5 | a38fef4439139743e3334c1d69f24cafdf4d71da |
python/cpython | python__cpython-124823 | # Support parsing negative scientific notation and complex numbers in argparse
# Bug report
Per https://github.com/python/cpython/issues/123945#issuecomment-2379781453
<!-- gh-linked-prs -->
### Linked PRs
* gh-124823
<!-- /gh-linked-prs -->
| 0c5a48c1c9039eb1ce25a96c43505c4de0a0b9d7 | 52f70da19cf3c7198be37faeac233ef803080f6f |
python/cpython | python__cpython-124691 | # _decimal: Store a module state in objects for faster access
# Feature or enhancement
### Proposal:
It is known to be efficient to get a module state from an object directly rather than from a type. The same can go for the `_decimal`'s context object (i.e. extending the `PyDecContextObject` struct).
Extendi... | dc12237ab092f0eee7ec5882196997804e635075 | c976d789a98047ae7ddec6d13c9ea7086d9fa3f9 |
python/cpython | python__cpython-124683 | # Intermittent test_support.test_fd_count failure on iOS
# Bug report
### Bug description:
An intermittent test failure has been observed on `test_support.test_fd_count`:
https://buildbot.python.org/#/builders/1380/builds/1423
https://buildbot.python.org/#/builders/1380/builds/626
https://buildbot.python.org/#/buil... | 10d504aecc56f9481114fe3d0a8d1721d38db7e3 | e349f73a5ad2856b0a7cbe4aef7cc081c7aed777 |
python/cpython | python__cpython-131427 | # Intermittent buildbot failure and timeout on Android aarch64
# Bug report
Happened twice in the last two days:
* https://buildbot.python.org/#/builders/1594/builds/84
* https://buildbot.python.org/#/builders/1594/builds/110
In both cases, the sequence of events is:
* `TestAndroidOutput.test_bytes` fails... | 01b5abbc53b2a9ee8d85e0518c98efce27dbd061 | c1b42db9e47b76fca3c2993cb172cc4991b04839 |
python/cpython | python__cpython-124677 | # [C API] Add private `_PyCodec_UnregisterError` to un-register custom error handlers
# Feature or enhancement
### Proposal:
In order to test the Codecs C API (#123343), I need to be able to un-register a custom codecs error policy, otherwise running the tests would leak since they won't clean the registry.
... | c00964ecd508ba6ae43498017d5a3873844a058a | 04c837d9d8a474777ef9c1412fbba14f0682366c |
python/cpython | python__cpython-124897 | # Python 3.12+ breaks backwards compatibility for logging QueueHandler with queue.SimpleQueue
# Bug report
### Bug description:
I think this is related to #119819
```python
import logging.config
from queue import SimpleQueue
q = SimpleQueue()
config = {
'version': 1,
'handlers': {
'... | 7ffe94fb242fd51bb07c7f0d31e94efeea3619d4 | 03775472cc69e150ced22dc30334a7a202fc0380 |
python/cpython | python__cpython-124712 | # [CVE-2024-9287] `venv` activation scripts do not quote strings properly
# Bug report
### Bug description:
Crafted paths break the script templates:
```console
envname='";uname -a;"'
mkdir "$envname"
cd "$envname"
python3 -m venv .
. ./bin/activate
```
```
Linux archlinux 6.10.6-arch1-1 #1 SMP PREE... | d48cc82ed25e26b02eb97c6263d95dcaa1e9111b | 44f841f01af0fb038e142a07f15eda1ecdd5b08a |
python/cpython | python__cpython-124643 | # Free-threaded dictionary lookups aren't marking objects as weakref'd
# Bug report
### Bug description:
Dictionaries have a fast path which doesn't lock on lookups and a slow path which does. The intention is that the fast-path will succeed after the first slow-path lookup has been passed. But currently we're not p... | 077e7ef6a0abbf9e04b9aa11b4f621031004c31f | cce1125574f7b74343afda4bd0030706f67e13df |
python/cpython | python__cpython-124700 | # Please restore the loop param to staggered.staggered_race
# Bug report
### Bug description:
The following remove the `loop` param from `staggered.staggered_race` :
https://github.com/python/cpython/pull/124390
https://github.com/python/cpython/pull/124574
https://github.com/python/cpython/pull/124573
... | 133e929a791d209b578b4822a7a07f4570b3803b | 7bdfabe2d1ec353ecdc75a5aec41cce83e572391 |
python/cpython | python__cpython-124629 | # Pyrepl on windows is blocking where it shouldn't
# Bug report
### Bug description:
ReadConsoleInput is documented as always returning at least one input. This breaks things in a couple of spots:
- searching inputs and hitting ctrl-c. This blocks reading, a 2nd ctrl-c is required, and then the interpreter crashes.
... | 83e5dc0f4d0d8d71288f162840b36f210fb03abf | 66cc6d4c502074ddbfeda1be28fae6aa4535e4a8 |
python/cpython | python__cpython-136822 | # Use new REPL for wasm demo
# Feature or enhancement
### Proposal:
The WASM demo in [Tools/wasm](https://github.com/python/cpython/tree/main/Tools/wasm) was very useful for getting a Python REPL setup working in my web app.
It would be wonderful if that demo could be updated to work with the new Python 3.13 REPL (... | 7ae4749d064bd49b0dd96172fee20c1f1678d9e9 | 1ba23244f3306aa8d19eb4b98cfee6ad4cf514c9 |
python/cpython | python__cpython-124792 | # test_perf_profiler fails on Linux (both AArch64 and x86)
# Bug report
### Bug description:
Our CI picked up this failure recently. We are using Ubuntu 24.04 and it is failing both on AArch64 and x86.
```
$ ./python -m test test_perf_profiler -v
== CPython 3.14.0a0 (heads/main-dirty:7a839d6013, Sep 26 2024, 14:53:... | 35541c410d894d4fa18002f7fdbebfe522f8320e | fac5e7aa171f8547fcb56f090e718c15ffd79d0b |
python/cpython | python__cpython-124626 | # Replace container images to packages from cpython-devcontainers
Now we can manage our own package images at https://github.com/python/cpython-devcontainers and publish them through https://github.com/orgs/python/packages, so it's time to use them.
- [x] autoconf
- [x] devcontainer
cc @brettcannon @erlend-aasl... | a4d1fdfb152c46e3e05aa6e91a44a9fd0323b632 | 7d3497f617edf77cb6ead6f5e62bce98d77b9ab8 |
python/cpython | python__cpython-124663 | # _Py_ThreadId() fails when compiled using GCC on Windows
# Bug report
### Bug description:
It should be possible to build a C extension module using GCC on Windows, but when defining Py_GIL_DISABLED any call to _Py_ThreadId fails.
The if/defs in _Py_ThreadId look for _MSC_VER to be defined to determine whether it'... | 0881e2d3b1212d988733f1d3acca4011ce5e6280 | 2e155536caf8a090c06d62dd92647abc62362463 |
python/cpython | python__cpython-124607 | # Reference leak in `test_datetime`
# Bug report
### Bug description:
```python
./python -m test -R 3:3 test_datetime
Using random seed: 2162639794
0:00:00 load avg: 88.54 Run 1 test sequentially in a single process
0:00:00 load avg: 88.54 [1/1] test_datetime
beginning 6 repetitions. Showing number of leaks (. for 0... | 9c98fdab7d1167211c9d162c418e2b443a02867a | 257a20a81764fcc17bcde9c0cec57fbc53a4adc7 |
python/cpython | python__cpython-124595 | # Every input in asyncio REPL (wrongly) runs in a separate PEP 567 context
# Bug report
### Bug description:
The bug is twofold, affects the asyncio REPL, and refers to [PEP 567 contexts](https://peps.python.org/pep-0567/#contextvars-context) and [context variables](https://peps.python.org/pep-0567/#contextvars-... | 67e01a430f4ecfcb540d6a29b347966ff4e53454 | 3e3a4d231518f91ff2f3c5a085b3849e32f1d548 |
python/cpython | python__cpython-124976 | # ctypes.Union & ctypes.Structure: common features should be tested on both types
Currently, `Lib/test/test_ctypes/test_structure.py` is very long, but `Lib/test/test_ctypes/test_union.py` only has recent additions.
A lot of the Structure tests apply to Union as well, and should be run on both. My plan is:
- Move ... | 01fc3b34cc6994bc83b6540da3a8573e79dfbb56 | c914212474792312bb125211bae5719650fe2f58 |
python/cpython | python__cpython-124553 | # Improve the accuracy of possible breakpoint check in bdb
# Feature or enhancement
### Proposal:
Currently in `bdb`, when a new function is entered, `bdb` checks if it's possible that there's a breakpoint in that function and only enable events in that function if there is. It's a good strategy but the existing che... | adfe7657a3f1ce5d8384694ed27a40376a18fa6c | 2d8b6a4e9d9a74e3c5270eec62716710ac197063 |
python/cpython | python__cpython-124627 | # Crash when detaching dict from inline values and no memory is available
# Bug report
### Bug description:
Add to `test_class.py` in `TestInlineValues`:
```python
def test_detach_materialized_dict_no_memory(self):
a = WithAttrs()
d = a.__dict__
_testcapi.set_nomemory(0)
del a
... | 0e21cc6cf820679439d72e3ebd06227ee2a085f9 | 2357d5ba48cd9685cb36bcf92a0eaed86a85f4de |
python/cpython | python__cpython-124559 | # v3.13.0rc2 Segmentation Fault in gc.get_referents. PyCapsule->traverse_func is NULL
# Crash report
### What happened?
Hello! Thank you for all your work on CPython. Hopefully this crash report is helpful.
While working on https://github.com/matplotlib/matplotlib/pull/28861, we noticed that our tests were se... | f923605658a29ff9af5a62edc1fc10191977627b | 0387c34f7c91428681ca8a4ba4e3d22b9acffde4 |
python/cpython | python__cpython-124546 | # Breaking backward compatibility between `ctypes` and metaclasses in Python 3.13.
# Documentation
## Background
I am one of the maintainers of [`comtypes`](https://github.com/enthought/comtypes/). `comtypes` is based on `ctypes` and uses metaclasses to implement [`IUnknown`](https://learn.microsoft.com/en-us/wi... | 3387f76b8f0b9f5ef89f9526c583bcc3dc36f486 | d8cf587dc749cf21eafc1064237970ee7460634f |
python/cpython | python__cpython-124515 | # framelocalsproxy_new() crash if called with no arguments
# Bug report
Example on Python 3.13.0rc2:
```
$ python3.13
>>> import sys
>>> FrameLocalsProxy=type([sys._getframe().f_locals for x in range(1)][0])
...
>>> FrameLocalsProxy()
Erreur de segmentation (core dumped)
```
The bug was discovered by zope.interfac... | d6954b6421aa34afd280df9c44ded21a2348a6ea | 0d9d56c4e4246495f506f7fb319548fb105b535b |
python/cpython | python__cpython-137010 | # Stack-based `ast.literal_eval` Implementation
# Feature or enhancement
### Proposal
I have implemented a stack-based version of `ast.literal_eval` and conducted benchmarks to compare its performance with the existing implementation. The results indicate that the stack-based version may improve performance on n... | b723c8be071afcf3f865c55a5efb6da54f7695a0 | d5191ba99b8f7723cbdb9b7a07ef8a3eef6524c1 |
python/cpython | python__cpython-124504 | # [C API] Add PyUnicode_Equal() function
Python 3.13 moved the private _PyUnicode_EQ() function to internal C API. [mypy](https://github.com/python/cpython/issues/121489) and [Pyodide](https://github.com/capi-workgroup/problems/issues/79) are using it.
I propose to add a public PyUnicode_Equal(a, b) function to the... | a7f0727ca575fef4d8891b5ebfe71ef2a774868b | c5df1cb7bde7e86f046196b0e34a0b90f8fc11de |
python/cpython | python__cpython-124499 | # TypeAliasType is always generic when `type_params=()` is passed.
# Bug report
### Bug description:
I realized that the `type_params` parameter of `TypeAliasType` behaves differently when it is omitted vs passing an empty tuple `()`, in the latter case the resulting instance is always subscriptable. I doubt this is... | abe5f799e6ce1d177f79554f1b84d348b6141045 | cf2418076d7cf69a3bd4bf6be0e0001635a7ad4d |
python/cpython | python__cpython-124672 | # Python-3.13.0rc2 cannot build in windows 11 with visual studio 2022 and windows sdk 10.0.26100
# Bug report
### Bug description:
same as
[Error when building _freeze_module](https://github.com/python/cpython/issues/121629)
in C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\ProcessSnapshot.h#L370
``... | fac5e7aa171f8547fcb56f090e718c15ffd79d0b | 077e7ef6a0abbf9e04b9aa11b4f621031004c31f |
python/cpython | python__cpython-136335 | # AssertionError in test_whichdb_ndbm on NetBSD
# Bug report
### Bug description:
```python
home$ ./python -m test test_dbm -m test_whichdb_ndbm
Using random seed: 1067465967
0:00:00 load avg: 0.00 Run 1 test sequentially in a single process
0:00:00 load avg: 0.00 [1/1] test_dbm
test test_dbm failed -- Traceback (mo... | b7aa2a4b4df697db6ea45a555eeb3fefa5ca5bd4 | 73e1207a4ebdb3b43d597cd6c288dae6d7d1dbdb |
python/cpython | python__cpython-124877 | # Review and simplify argparse docs
The argparse docs have become pretty lengthy. This is in part due to the examples, which are somewhat duplicative of the tutorial. I'd like to go through the docs to see if we can dedupe and pare things down to make them more readable.
<!-- gh-linked-prs -->
### Linked PRs
* gh-124... | 37228bd16e3ef97d32da08848552f7ef016d68ab | eafd14fbe0fd464b9d700f6d00137415193aa143 |
python/cpython | python__cpython-124475 | # Set name for reusable workflow

Visibility does not look good; let's set the name.
cc @hugovk
<!-- gh-linked-prs -->
### Linked PRs
* gh-124475
* gh-125256
* gh-125257
<!-- /gh-linked-prs --... | e4cab488d4445e8444932f3bed1c329c0d9e5038 | f9ae5d1cee2f8927a71cd4f1f66f10050a4f658a |
python/cpython | python__cpython-122489 | # Crash when assigning to instance dictionary from multiple threads while reading
# Bug report
### Bug description:
```python
class C: pass
f = C()
# Reader code:
f.foo
# Writer code:
f.__dict__ = {}
```
When there's a thread reading from an object and another thread replacing the dictionary we can crash. This is... | bf542f8bb9f12f0df9481f2222b21545806dd9e1 | 3926842117feffe5d2c9727e1899bea5ae2adb28 |
python/cpython | python__cpython-124460 | # Drop `coverity`
# Feature or enhancement
### Proposal:
Drop references to `coverity`.
The last time the project was scanned using coverity was 2020. Those listed as admins/experts on coverity hasn't been maintaining it.
We discussed this during Python core sprint on Discord.
A DevGuide PR was opened to also remov... | 6cba6e1df2c20846347b705eff7fb28caeeb17fd | 3387f76b8f0b9f5ef89f9526c583bcc3dc36f486 |
python/cpython | python__cpython-125919 | # Parsing adds whitespace to the front of long headers
# Bug report
### Bug description:
When parsing back a written email, whitespace seems to be prepended to the header if the header was wrapped upon writing.
This is particularly noticeable for message-ids, which end up different - with either a space or a ... | ed81971e6b26c34445f06850192b34458b029337 | 2313f8421080ceb3343c6f5d291279adea85e073 |
python/cpython | python__cpython-124449 | # Update bundled Tcl/Tk to 8.6.15 (Windows, macOS installer)
### Proposal:
8.6.15 was released on Sep 13, 2024
### Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
### Links to previous discussion of this feature:
_No response_
<!-- gh-linked-p... | 9d8f2d8e08336695fdade5846da4bbcc3eb5f152 | 909c6f718913e713c990d69e6d8a74c05f81e2c2 |
python/cpython | python__cpython-124492 | # `__static_attributes__` is not deterministic
# Bug report
### Bug description:
Tested on commit: e9b00cc78853373623031c657193cbe557488c0a <!-- ZW: edited to remove markup for automatic GH link -->
Order of strings in `__static_attributes__` is not deterministic
Running the following a couple of times pr... | 04c837d9d8a474777ef9c1412fbba14f0682366c | 69a4063ca516360b5eb96f5432ad9f9dfc32a72e |
python/cpython | python__cpython-128669 | # `asyncio.Queue.task_done` documentation is ambiguous
# Documentation
When reading https://docs.python.org/3/library/asyncio-queue.html the reader gets no clue to the fact that this object is (primarily) meant to contain tasks. (Because it is, isn't it? The task_done() method seems to indicate that)
<!-- gh-lin... | 4322a318ea98ceeb95d88b7ae6b5cfa3572d2069 | b2adf556747d080f04b53ba4063b627c2dbe41d1 |
python/cpython | python__cpython-124551 | # How to convert annotations to `Format.SOURCE` in `__annotate__`?
# Feature or enhancement
Let's say you have a dict of some custom annotations like I have in https://github.com/python/cpython/pull/122262
How users are expected to convert say an annotation dict of `{'user': CustomUser[AuthToken], 'auth_callback': C... | 4e829c0e6fbd47818451660c234eacc42a0b4a08 | 0268b072d84bc4be890d1b7459815ba1cb9f9945 |
python/cpython | python__cpython-124466 | # Skip additional tests for emulated Linux JIT CI jobs
There have been a number of failed tests on emulated Linux JIT CI runs, related to`test_datetime` lately. We should add them to the list of skipped tests for now.
See https://github.com/python/cpython/actions/runs/10942493409/job/30380093772?pr=124101 as an exa... | b6471f4a391e9d3c8e1b244c56a4cc25974632c9 | 950fab46ad3a1960aa289d2d1de55447b88e25d7 |
python/cpython | python__cpython-124406 | # NameError in `openpty` after #118826
# Bug report
`result` jere is not defined https://github.com/python/cpython/blob/ad7c7785461fffba04f5a36cd6d062e92b0fda16/Lib/pty.py#L36-L43
It should be `slave_fd`.
Caused by #118826
Thanks to @ambv for finding this.
I have a fix ready.
<!-- gh-linked-prs -->
### L... | 17b3bc9cc7608920077f5f08f970c7157a2d2e72 | b4d0d7de0f6d938128bf525e119c18af5632b804 |
python/cpython | python__cpython-124434 | # test_free_threading and test_super take way to long on a Free Threaded build.
# Bug report
Running freshly updated and compiled main on my new machine, `python -m test -j0` (I forgot -ugui) ran all but 2 tests in 2:46. (16 cores defaulted to 2x16 + 2 == 34 processes.) The longest running was test_multiprocessing_s... | 5a605660745d32a9b9f4208666889c702527208c | b169cf394fe70dfbc7bbe22ae703be3b21845add |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.