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-129899 | # Store and use the current task of asyncio on thread state for all threads
`asyncio` currently stores the current task in a global dict `_current_tasks` and on thread state. Storing it on dict in free-threading will cause significant contention under many threads and such I propose to remove it and always rely on the... | 660f126f870535b6fa607e6d9cdd3cdbd9ed2cb1 | fb17f41522718013036ce44cbe83a72f5d9a2104 |
python/cpython | python__cpython-129896 | # Documentation: Remove incorrect role directive in `graphlib.py`
# Documentation
Remove :exec: role directive from ValueError in TopologicalSorter.done() docstring since docstrings are not processed as reST contents.
<!-- gh-linked-prs -->
### Linked PRs
* gh-129896
* gh-129904
* gh-129905
<!-- /gh-linked-prs -->
| c53730171f18b90202aa0918b3c05412222bb1ec | f7c7decc4c7c10084ab3c1473e1a590666d3ea17 |
python/cpython | python__cpython-129888 | # Support context manager protocol by contextvars.Token
# Feature or enhancement
### Proposal:
Sometimes, mostly in tests, I write something like
```python
from contextvars import ContextVar
var = ContextVar('var')
def test_a():
token = var.set('new val')
do_stuff()
var.reset(token)
```
It looks a li... | 469d2e416c453b19d7a75fe31ceec732445e9ef2 | e1b38ea82ee20ad8b10578e7244e292b3fac9ae8 |
python/cpython | python__cpython-129875 | # avoid mixing pure python and C implementation of asyncio
Currently writing tests in asyncio is difficult because we have two separate implementations. The C implementation overrides the pure Python implementation at runtime as such testing python implementation is tricky. I propose that the pure python implementatio... | d5796e64e061a5366186561d1a003c1436ad3492 | 6fbf15f98e04f582aeccf5334a94840149ff7cd5 |
python/cpython | python__cpython-129859 | # IDLE: Only copy the text section of idle.html to idlelib/help.html
Parsing help.html to display the IDLE doc requires ignoring unneeded material both before and after the text section. It makes more sense to never copy this material into the file.
1. In help.copystrip(), copy and strip only the IDLE text section... | 6fbf15f98e04f582aeccf5334a94840149ff7cd5 | 0d9c4e260d4ea8fd8bc61c58bdf7db4c670470ee |
python/cpython | python__cpython-129913 | # Test_sqlite3 failing with SQLite 3.49.0
# Bug report
### Bug description:
test_sqlite3/test_dump.py relies on fts4 for `test_dump_virtual_tables`. However, SQLite 3.49.0 apparently no longer builds with`ENABLE_FTS4` by default, presumably because it was superseded by FTS5. This causes this unit test to fail.
#... | cda83cade0b684bcb1221a30bfe0b6861abd3b3f | 91d954411272a07a5431326711a8a5bdf4e2c323 |
python/cpython | python__cpython-129902 | # Special syntax error for `elif` after `else`
# Feature or enhancement
### Proposal:
I've implemented a special syntax error in the case that an `elif` follows an `else`. See [here](https://github.com/swfarnsworth/cpython/commit/883ada95e129bec660f55da7b1422deec3871979).
```python
if i % 3 == 0:
print("divisib... | 99b71efe8e9d59ce04b6d59ed166b57dff3e84d8 | c3a71180656a906d243e4cc0ab974387753b2fe1 |
python/cpython | python__cpython-129848 | # pure-Python warn_explicit() passes wrong arg to WarningMessage
The pure-Python implementation of the `warnings.warn_explicit()` function does this:
```python
msg = WarningMessage(message, category, filename, lineno, source)
```
But the 5th argument of `WarningMessage` is `file` (the file the message is supposed to b... | 80e00ecc399db8aeaa9f3a1c87a2cfb34517d7be | ac50ece6cea8745834e4ec0a9617809a51245bfc |
python/cpython | python__cpython-129845 | # warnings.catch_warnings docstring: obsolete compat note
The docstring for `warnings.catch_warnings.__init__` reads:
```
For compatibility with Python 3.0, please consider all arguments to be
keyword-only.
```
This makes little sense these days.
<!-- gh-linked-prs -->
### Linked PRs
* gh-129845
<!-- /gh-linked-prs... | 0f128b9435fccb296714f3ea2466c3fdda77d91d | 80b9e79d84e835ecdb5a15c9ba73e44803ca9d32 |
python/cpython | python__cpython-129839 | # _Py_NO_SANITIZE_UNDEFINED is defined twice when compiling with recent GCC
# Bug report
### Bug description:
When compiling with a recent version of GCC and enabling undefined sanitizer, I see the following warning:
```
./Modules/faulthandler.c:49:11: warning: "_Py_NO_SANITIZE_UNDEFINED" redefined
49 | # define... | 568db400ff07240a5ed6f263af281405ccaec716 | 0f5b82169e12321fd2294bf534496ad42a682ac4 |
python/cpython | python__cpython-129836 | # pathlib ABCs: `ReadablePath.glob('')` doesn't add trailing slash
# Bug report
Minor issue in some still-private code.
In the pathlib ABCs, `ReadablePath.glob('')` should work a bit like `JoinablePath.joinpath('')`, i.e. it should yield the path *with a trailing slash* if it's an existing directory. This isn't pres... | 707d066193c26ab66c8e5e45e72c3a37f48daf45 | 6c67904e793828d84716a8c83436c9495235f3a1 |
python/cpython | python__cpython-129806 | # `Tools/jit` has several `bytes` and `bytearray` mixups
# Bug report
`Stensil` defines `body` as `bytearray` https://github.com/python/cpython/blob/175844713af383c9e4dd60166d1d7407c80a1949/Tools/jit/_stencils.py#L189-L197
But, it is passed to functions that expect `bytes`, this now works for historic reasons. But, ... | 422f8e9e02e68d45aee3846751a003a70fca13b6 | cfe41037eb5293a051846ddc0b4afdb7a5f60540 |
python/cpython | python__cpython-129771 | # Fatal Python error from `warnings._release_lock()`
# Crash report
### What happened?
Exposing the mutex used by the `_warnings` module in https://github.com/python/cpython/pull/128386 has made it possible to abort the interpreter by calling `warnings._release_lock()`:
```python
import warnings
warnings._release_... | ae132edc296d27c6ed04fe4d400c67e3cfb622e8 | e2064d67504bc360c20e03eeea8b360d605cb439 |
python/cpython | python__cpython-129764 | # Clean up "lltrace"
We should get rid of the `LLTRACE` macro, and just use `Py_DEBUG` instead (they're both used interchangeably anyways).
Also, we can check `PYTHON_LLTRACE` once at startup, instead of doing it constantly all over the place.
<!-- gh-linked-prs -->
### Linked PRs
* gh-129764
<!-- /gh-linked-prs -->... | fbaa6c8ff06cf885d9b8c8ea6cf25bab3781a2bd | f52a3a51eb711e16445307ff1ce28e94ff4b1535 |
python/cpython | python__cpython-134238 | # Data race on `block->next` in `mi_block_set_nextx`
# Bug report
I've seen this in *non-debug* TSan builds. The TSAN report looks like:
```
Write of size 8 at 0x7fffc4043690 by thread T2692:
#0 mi_block_set_nextx /raid/sgross/cpython/./Include/internal/mimalloc/mimalloc/internal.h:652:15 (python+0x2ce71e) (Bu... | 317c49622397222b7c7fb49837e6b1fd7e82a80d | dd7f1130570d50461b2a0f81ab01c55b9ce93700 |
python/cpython | python__cpython-129754 | # `configure` help for tail call interpreter is wrong
# Bug report
```
--tail-call-interp enable tail-calling interpreter in evaluation loop
and rest of CPython
```
But the flag is `--with-tail-call-interp`
cc @Fidget-Spinner
<!-- gh-linked-prs -->
### Linked PRs
* gh-129754
<!-- ... | 43e024021392c8c70e5a56cdf7428ced45d73688 | e1e85204edbf8c0c9ba1e50c74ac8708553585d8 |
python/cpython | python__cpython-129738 | # Race between grow_thread_array and _Py_qsbr_reserve under free threading
# Bug report
### Bug description:
I don't have a succinct reproducer for this bug yet, but I saw the following race in JAX CI:
https://github.com/jax-ml/jax/issues/26359
```
WARNING: ThreadSanitizer: data race (pid=208275)
Write of size 8... | b4ff8b22b3066b814c3758f87eaddfa923e657ed | 78377c788e02e91bf43d290d69317198a2e563fd |
python/cpython | python__cpython-130055 | # gzip raising exception when closing with buffer backed by BytesIO
# Bug report
### Bug description:
Hello,
the following snippet raises an exception in Python 3.13.2 while it's fine with Python 3.12.
```python
import io
import gzip
def foo():
buffer = gzip.GzipFile(fileobj=io.BytesIO(), mode="w")
foo()
```... | 7f39137662f637518a74228286e7ec675fa4e27d | e41981704f0a6adb58c3e258b4226619521ce03c |
python/cpython | python__cpython-129721 | # socket.CAN_RAW_ERR_FILTER is not defined in Python 3.11 and later
# Bug report
### Bug description:
When trying to use `socket.CAN_RAW_ERR_FILTER` on a Debian bookworm system, running Python 3.11, an `AttributeError` is raised. This is because the value is no longer defined in `socket.py`/`_socket`.
I have also t... | ce31ae5209c976d28d1c21fcbb06c0ae5e50a896 | 741c6386b8615fbfb4f2e6027556751039119950 |
python/cpython | python__cpython-130389 | # macOS combined architecture platform tags are undocumented, and inconsistent
# Bug report
### Bug description:
While formalising the definition of platform tags for iOS and Android in packaging.python.org/pull/1804, I notice that macOS combined architecture tags (e.g., `universal2`) aren't documented.
The canonic... | 474c388740ca5f8060c074f517dd14c54409126f | 30e892473e0dfe5c3fecabcaac420cefe45e2ed4 |
python/cpython | python__cpython-129708 | # New `compute-changes.py` should be checked with mypy
# Feature or enhancement
Right now we have a special `mypy.ini` in `Tools/build`: https://github.com/python/cpython/blob/cdcacec79f7a216c3c988baa4dc31ce4e76c97ac/Tools/build/mypy.ini#L2
But, it only checks one file. Since newly added https://github.com/python/cp... | 8b2fb629334613fa34a79f0a53d297f77121ed58 | cb640b659e14cb0a05767054f95a9d25787b472d |
python/cpython | python__cpython-130089 | # Data race in `intern_common` when interning str objects in the free threading build
# Bug report
When running `./python -m test test_exceptions --parallel-threads=10` in a TSAN build:
```
WARNING: ThreadSanitizer: data race (pid=763025)
Atomic read of size 4 at 0x7fffbe0718cc by thread T190:
#0 _Py_atomic_lo... | b9d2ee687cfca6365e26e156b1e22824b16dabb8 | fc8c99a8ce483db23fa624592457e350e99193f6 |
python/cpython | python__cpython-129727 | # Add information about IDLE to online contents
Clicking [Complete table of contents](https://docs.python.org/3/contents.html) on docs.python.org shows, in part,

A short line like:
> Python's Integrated Development Environment... | 33a7094aa680bca66582fec4dcda7d150eb90cd8 | 1bccd6c34f82f8373c320792323bfd7f7a328bc7 |
python/cpython | python__cpython-129830 | # test_fstring.py:1655: SyntaxWarning: invalid escape sequence
# Bug report
### Bug description:
This is a failure during the set of tests performed during build of 3.13.2:
```
default: 0:00:22 load avg: 1.70 [18/44] test_fstring
default: /root/Python-3.13.2/Lib/test/test_fstring.py:1655: SyntaxWarning: inv... | 2dd018848ca254047835850b8b95d805cbf7efaf | e09442089eb86d88d4b5a96e56f713cb31173ae9 |
python/cpython | python__cpython-129679 | # ConfigParser: writing a config with an empty unnamed section adds an extra newline to the beginning of the file
# Bug report
### Bug description:
If you read a config with an empty unnamed section using ConfigParser with allow_unnamed_section set to True and write it back, the resulting file will contain an extra ... | ef8eeca9d8d464cff0e7bc5c428e9b8ba4936962 | b9d2ee687cfca6365e26e156b1e22824b16dabb8 |
python/cpython | python__cpython-129704 | # MemoryError freelist is not thread-safe in free threaded build
# Bug report
The `MemoryError` freelist isn't thread-safe if the GIL is disabled:
https://github.com/python/cpython/blob/285c1c4e9543299c8bf69ceb39a424782b8c632e/Objects/exceptions.c#L3850-L3860
Most of the freelists were made thread-safe by making th... | 51b4edb1a4092f60d84f7d14eb41c12085e39c31 | 4d56c40440c9fd4499d61d24977336d8cd8d8d83 |
python/cpython | python__cpython-130686 | # Document that public headers target C11 and C++11
Our public documentation should say that you need C11 or C++11 to `#include <Python.h>`.
Internally, we need to be more lenient & careful (though we won’t promise upfront how much). It's not OK to just break C99 support or slightly out-of-spec compilers.
We should t... | ab11c097052757b79060c75dd4835c2431e752b7 | 003e6d2b9776c07147a9c628eb028fd2ac3f0008 |
python/cpython | python__cpython-129661 | # Drop test_embed from PGO training
# Feature or enhancement
### Proposal:
The number of unit tests for PGO profile build was reduced in gh-80225 (bpo-36044). Additionally, recent versions of CPython could skip `test_embed`, which is considered to have become bigger for its contribution.
The git-main has already d... | 285c1c4e9543299c8bf69ceb39a424782b8c632e | f61afca262d3a0aa6a8a501db0b1936c60858e35 |
python/cpython | python__cpython-129647 | # Update the locale alias mapping
`locale_alias` mapping in the `locale` module is manually generated from the `locale.aliases` file from X.org distribution and the supported locales list from glibc. As these files are changed, we need to update `locale_alias` from time to time. Last time it was updated in 3.8. There ... | f61afca262d3a0aa6a8a501db0b1936c60858e35 | 14489c1bb44dc2f4179278463fedd9a940b63f41 |
python/cpython | python__cpython-129644 | # `PyList_SetItem` missing atomic store
# Bug report
`PyList_SetItem` currently uses `Py_XSETREF` to set the item and decref the old one, however the store is not atomic as such it can race with a concurrent read. The fix is to use a atomic store with release order to correctly set the new item and then decref the ol... | fb5d1c923677e7982360bad934d70cf9ad3366ca | e41ec8e18b078024b02a742272e675ae39778536 |
python/cpython | python__cpython-129604 | # Segfault if `pysqlite_Row->description == PyNone`
# Crash report
### What happened?
Most of the code in `Modules/_sqlite/row.c` assumes `->description` is a tuple. However, it may be `None`. Since it is possible to craft a `sqlite3.Row` object "by hand", it is easy to provoke segfauls for paths that involve the `P... | 7e6ee50b6b8c760bcefb92ab4ddbc3d85d37a834 | d05053a203d922c8056f12ef3c9338229fdce043 |
python/cpython | python__cpython-129620 | # `ast.parse(..., mode='single')` parses of multiple statements which are then not unparsed
# Bug report
### Bug description:
```python
$ ./python
Python 3.14.0a4+ (heads/test:d906bde250, Feb 2 2025, 11:08:38) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import as... | a8cb5e4a43a0f4699590a746ca02cd688480ba15 | 20c5f969dd12a0b3d5ea7c03fedf3e2ac202c2c0 |
python/cpython | python__cpython-129909 | # Update bundled pip to 25.0.1
# Feature
### Description:
A new version of pip was recently released, but `ensurepip` still [uses](https://github.com/python/cpython/blob/3.13/Lib/ensurepip/__init__.py#L13C1-L13C24) an older version. As a result, when creating a new virtual environment, `ensurepip` installs an outdat... | b8f7bddd6c6b5d2d13c97882042ce808aceca5a8 | a1a6df282d732b54ba99de93416f8f9d85b3de2f |
python/cpython | python__cpython-129570 | # The function unicodedata.normalize() should always return an instance of the built-in str type.
# Bug report
### Bug description:
The current implementation of unicodedata.normalize() returns a new reference to the input string when the data is already normalized. It is fine for instances of the built-in str type.... | c359fcd2f50d02e4709e9ca3175c1ba1ea6dc7ef | 9bf73c032fbf0ea27ebf6e53223c3bc69ee0dbc5 |
python/cpython | python__cpython-130233 | # Inconsistent name mangling in `TypedDict` in function and class forms
# Bug report
Let's say that you have a dict like `{"__key": 1}` and you want to type it.
You can write:
```python
>>> import typing
>>> class A(typing.TypedDict):
... __key: int
>>> A.__mutable_keys__
frozenset({'_A__key'})
```
and:
```p... | 63ffb406bb000a42b0dbddcfc01cb98a12f8f76a | f67ff9e82071b21c1960401aed4844b00b5bfb53 |
python/cpython | python__cpython-129560 | # Add `bytearray.resize()` method
# Feature or enhancement
### Proposal:
Add `bytearray.resize()` which wraps [`PyByteArray_Resize`](https://docs.python.org/3/c-api/bytearray.html#c.PyByteArray_Resize)
`PyByteArray_Resize` is part of the C Stable API and allows efficiently expanding a bytearray object's buffer in ... | 5fb019fc29a90e722aff20a9522bf588351358cd | 7d9a22f50923309955a2caf7d57013f224071e6e |
python/cpython | python__cpython-129563 | # Race on GC enabled state under free threading
# Bug report
### Bug description:
The following code, when run under Python 3.13 commit 0468ea12305ef5a0a3d1dc4af8a82fb94d202cd6 built with TSAN, produces a data race error:
```python
import concurrent.futures
import functools
import gc
import threading
num_threads =... | b184abf074c0e1f379a238f07da5616460f36b93 | 4e3330f054b91049c7260eb02b1e2c3808958e11 |
python/cpython | python__cpython-129880 | # Syntax error on '{z} if z is not None else pass'
# Bug report
### Bug description:
```python
My question is in the title.
In the tutorial, I read: Use 'pass' in places, where code is required syntactically, but none is needed.
In order to save indentations, I used the conditional assignement in some segment of co... | bcc9a5dddb777c8195b56645a15298cc0949ed9b | 51d4bf1e0e5349090da72721c865b6c2b28277f3 |
python/cpython | python__cpython-129504 | # Handling errors in ctypes callbacks
If an error happens in the callback or in converting result of the callback, it is handled by calling `PyErr_FormatUnraisable()`. If an error happens in preparing arguments for the callback, it is handled in different way -- some message is printed to stderr and then `PyErr_Print(... | 9d63ae5fe52d95059ab1bcd4cbb1f9e17033c897 | 3447f4a56a71a4017e55d8f46160a63f111ec373 |
python/cpython | python__cpython-116346 | # New warning on `main`: `writing 1 byte into a region of size 0 [-Wstringop-overflow=]`
# Bug report
### Bug description:
This happens in Modules/_decimal/libmpdec/io.c
Here: https://github.com/python/cpython/blob/a4722449caccc42ad644611d02fbdb5005f601eb/Modules/_decimal/libmpdec/io.c#L348-L349
<img width="635" a... | 6c63afc3be9dd612f587fe7869c1f317d5ea37cc | 652f66ac386dad5992c6f7c494871907272503f8 |
python/cpython | python__cpython-129465 | # ForwardRef: remove `__hash__` and `__eq__`
# Feature or enhancement
Currently, `annotationlib.ForwardRef` has a `__hash__` and `__eq__` method, which look at a few attributes: https://github.com/python/cpython/blob/8b4a0d641cde667f94ce49f5e64da6bd9d6fbd9c/Lib/typing.py#L1096 (3.13). These look unsound already; it's... | ac14d4a23f58c1f3e1909753aa17c1c302ea771d | 231a50fa9a5444836c94cda50a56ecf080c7d3b0 |
python/cpython | python__cpython-129450 | # Python 3.13.1-jit : issue when compiling from source
Hi all,
I am trying to build python 3.13.1 from source (grabed here https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tgz) on Ubuntu 22.04 instance with configuration so that I disable GIL + get JIT :
`./configure --disable-gil --enable-experimental-jit --e... | 652f66ac386dad5992c6f7c494871907272503f8 | 9bc8c5fc0c8557b831bf47e6fe6ff85678cc8c0c |
python/cpython | python__cpython-129413 | # CSV write has SEGV when trying to write data 2GB or larger
# Crash report
### What happened?
```python
import csv
bad_size = 2 * 1024 * 1024 * 1024 + 1
val = 'x' * bad_size
print("Total size of data {}".format(len(val)))
for size in [2147483647, 2147483648, 2147483649]:
data = val[0:size]
print("Trying... | 97b0ef05d987ebef354512b516a246feb411e815 | 4815131910cec72805ad2966e7af1e2eba49fe51 |
python/cpython | python__cpython-129411 | # `Lib/http/__init__.py` mentions RFF instead of RFC
# Documentation
Just a typo in 3.13, where http mentions `RFF` instead of `RFC`
<!-- gh-linked-prs -->
### Linked PRs
* gh-129411
* gh-129414
<!-- /gh-linked-prs -->
| 7dd0a7e52ee832559b89d5ccba732c8e91260df8 | 180ee43bde99b8ce4c4f1d5237ab191e26118061 |
python/cpython | python__cpython-129410 | # The `SystemError` description is misleading
# Documentation
The docs for [SystemError](https://docs.python.org/3/library/exceptions.html#SystemError) currently say:
> Raised when the interpreter finds an internal error, but the situation does not look so serious to cause it to abandon all hope. The associated valu... | 39b754a35976924f6df46cd475e889bcf8598ca1 | 632ca568219f86679661bc288f46fa5838102ede |
python/cpython | python__cpython-129406 | # Documented `Py_mod_multiple_interpreters` default is incorrect
Docs added in #107306 say the default for `Py_mod_multiple_interpreters` is `Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED`, but the actual default is `Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED` (preserving pre-3.12 behaviour):
https://github.com/python/cpyth... | fc8d2cba541f378df0a439412665f3dbe0b9ae3c | 805839021ba7074423811ba07995ae57984a46d3 |
python/cpython | python__cpython-129419 | # Incorrect exception message in `Barrier.__init__`
# Bug report
### Bug description:
```python
# Add a code block here, if required
>>>import threading
>>>x=threading.Barrier(parties=0.5)
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
x=Barrier(parties=0.5)
ValueError: parties must... | bcb25d60b1baf9348e73cbd2359342cea6009c36 | a4722449caccc42ad644611d02fbdb5005f601eb |
python/cpython | python__cpython-129959 | # `test_repr_rlock` failing randomly on main branch CI
```console
test_repr_rlock (test.test_multiprocessing_spawn.test_processes.WithProcessesTestLock.test_repr_rlock) ... FAIL
======================================================================
FAIL: test_repr_rlock (test.test_multiprocessing_spawn.test_process... | a98a6bd1128663fbe58c0c73d468710245a57ad6 | 5326c27fc674713879747e61a8deca7a66e69754 |
python/cpython | python__cpython-129394 | # Make 'sys.platform' return "freebsd" only on FreeBSD without major version
# Feature or enhancement
### Proposal:
When using using `sys.platform` and especially `requirements.txt `/`pyproject.toml` one cannot constrain dependencies to FreeBSD as whole, but need to deal with the suffixed major version. A change sho... | e3eba8ce266f90d9f8faeb5b2b4b64e56110bd2a | 8df5193d37f70a1478642c4b456dcc7d6df6c117 |
python/cpython | python__cpython-129844 | # bytes.fromhex() should parse a bytes
# Feature or enhancement
### Proposal:
`bytes.fromhex()` should accept a `bytes`:
```python
>>> bytes.fromhex(b'8a3218def90a84cb4373beed87d9ba1ccc7d90d1')
b'\x8a2\x18\xde\xf9\n\x84\xcbCs\xbe\xed\x87\xd9\xba\x1c\xcc}\x90\xd1'
```
### Background:
`bytes.fromhex()` accepts a `s... | e0637cebe5bf863897f2e89dfcb76be0015c1877 | 405a2d74cbdef5a899c900b6897ec85fe465abd2 |
python/cpython | python__cpython-129347 | # No NULL check in sqlite `connection.c`
# Bug report
### Bug description:
https://github.com/python/cpython/blob/7ec17429d462aee071c067e3b84c8a7e4fcf7263/Modules/_sqlite/connection.c#L960
In this case we don'y check it against NULL, and can dereference in next line:
https://github.com/python/cpython/blob/7ec17429... | 379ab856f59423c570333403a7d5d72f3ea82d52 | a6a8c6f86e811f9fcdb577bc1d9b85fbf86c8267 |
python/cpython | python__cpython-129348 | # syslogmodule.c lack of NULL check
### Bug description:
https://github.com/python/cpython/blob/7ec17429d462aee071c067e3b84c8a7e4fcf7263/Modules/syslogmodule.c#L178
After in if body we use Py_DECREF(indent), which can cause null pointer dereference
### CPython versions tested on:
CPython main branch
### Operating... | 25cf79a0829422bd8479ca0c13c72b769422077b | c67afb581eccb3ce20a4965c8f407fd2662b6bdf |
python/cpython | python__cpython-129361 | # docs of deprecated C function should propose replacement in C, not in Python
# Documentation
In the 3.13 Python/C API Reference Manual, page "Initialization, Finalization, and Threads", `Py_GetProgramName()` and several other C functions are declared deprecated. To replace them, it is suggested "Get sys.executable ... | 632ca568219f86679661bc288f46fa5838102ede | a33dcb9e431c463c20ecdc02a206ddf0b7388687 |
python/cpython | python__cpython-129320 | # pyatomic include statement shouldn't use "cpython/*" but just "*"
# Bug report
### Bug description:
I'm looking at (and using) a build generated from:
```sh
git clone --depth 1 https://github.com/python/cpython.git --branch v3.13.1
pushd cpython
./configure --enable-optimizations --prefix=$(pwd)/install... | 3a974e39d54902699f360bc4db2fd351a6baf3ef | 25cf79a0829422bd8479ca0c13c72b769422077b |
python/cpython | python__cpython-129293 | # Support for Bluetooth LE L2CAP Connection-oriented channels through AF_BLUETOOTH/BTPROTO_L2CAP socket
# Feature or enhancement
### Proposal:
As has been discussed previously (69242, 70145), "new" fields have been added in `sockaddr_l2`, but are still not supported in CPython's `socket` implementation.
* The lack ... | 45a24f54af4a65c14cc15fc13d3258726e2fe73b | a083633fa046386b8cdaae0c87fef25289dde9a1 |
python/cpython | python__cpython-129272 | # Refleaks in multiple buildbots for test_capi, test_embed, test_import, test_interpreters, test_json and more
# Bug report
### Bug description:
See for example:
https://buildbot.python.org/all/#/builders/259/builds/2043
```
10 slowest tests:
- test.test_multiprocessing_spawn.test_processes: 5 min 50 sec
- test.t... | 7a54a653b718a70c96755f6fc39f01f5c582558a | e119526edface001ad7d7f70249a123c8a122d71 |
python/cpython | python__cpython-130133 | # `test_coverage_ignore` in `test_trace` fails if setuptools is installed
# Bug report
### Bug description:
The `test_coverage_ignore` test fails if setuptools is installed:
```pytb
======================================================================
FAIL: test_coverage_ignore (test.test_trace.TestCoverage.test_c... | 35925e952911aba97bfdaee85b09d734ceac4fea | 8cbcf51d614815df3ab7ea557f04e6b4b386968e |
python/cpython | python__cpython-129252 | # iOS buildbot failure comments don't contain failure details anymore
Specificially, they don't contain:
* The names of the failed tests
* The tracebacks
It looks like this changed in December 2024, probably because the test script was updated to add a prefix to every log line. The relevant regexes are [here](https:/... | a58083811a51764c47fbb7cbd67e87e1124d53e8 | d40692db06cdae89447c26b6c1b5d2a682c0974f |
python/cpython | python__cpython-129263 | # Remove #pragma that disables optimization on _PyEval_EvalFrameDefault on MSVC
# Feature or enhancement
### Proposal:
The bug that caused a compiler crash has now been fixed upstream. We should remove our workaround to disable optimization on PGO builds on MSVC (and presumably get a modest speedup).
### Has this... | 9e52e553f4a906c120f807e940891f7325011b67 | 9682a88683367f79c5b626b2ad809d569e37f602 |
python/cpython | python__cpython-129240 | # Use `_PyInterpreterFrame.stackpointer` in free threaded GC when traversing threads' stacks
# Feature or enhancement
The free threading GC traverses the active frames of threads in two places:
* When `GC_MARK_ALIVE_STACKS` during the marking phase (see https://github.com/python/cpython/issues/128807)
* During `dedu... | 5ff2fbc026b14eadd41b8c14d83bb1eb832292dd | a29221675e7367608961c3484701ab2671ec6f3c |
python/cpython | python__cpython-129232 | # JIT: lay out memory to group executable code together
When allocating memory to host JIT traces, we have the following layout:
* code
* data
* trampolines
* padding
We should group executable code together to improve icache locality. The new layout should be
* code
* trampolines
* data
* padding
<!-- gh-linked-pr... | a29a9c0f3890fec843b7151f6a1defa25f570504 | 567394517a10c9a9f3af25a31009589ae2c50f1b |
python/cpython | python__cpython-129225 | # The compiler may optimise away globals with debug offsets
# Bug report
### Bug description:
When compiling with LTO and other aggressive optimization levels, is possible that the compiler will optimise away globals containing debug offsets. This is currently happening in https://buildbot.python.org/#/builders/125/... | 3a3a6b86f4069a5a3561c65692937eb798053ae5 | e635bf2e49797ecb976ce45a67fce2201a25ca68 |
python/cpython | python__cpython-129211 | # Add os.readinto API for reading data into a caller provided buffer
# Feature or enhancement
### Proposal:
Code reading data in pure python tends to make a buffer variable, call `os.read()` which returns a separate newly allocated buffer of data, then copy/append that data onto the pre-allocated buffer[0]. That cr... | 1ed44879686c4b893d92a89d9259da3cbed6e166 | 0ef8d470b79889de065e94cecd0ee01e45037d3a |
python/cpython | python__cpython-132184 | # Doc: mention a minimal version of QEMU user emulation necessary for 3.13+?
# Documentation
I ran into an issue with running Python 3.13 under QEMU on Ubuntu 22.04.
```
>>> subprocess.run([sys.executable], check=True)
Traceback (most recent call last):
File "<python-input-10>", line 1, in <module>
subprocess.... | 4c5dcc6d8292d5142aff8401cb9b9d18b49c6c89 | 6eaa4aeef25f77a31768d8ba5a03f614766aba95 |
python/cpython | python__cpython-129203 | # Use "prefetch" CPU instructions during the marking phase of the GC
# Feature or enhancement
### Proposal:
This change is partially inspired by a similar change made to the [OCaml GC](https://github.com/ocaml/ocaml/pull/10195). Sam wrote a [prototype implementation](https://github.com/colesbury/cpython/commits/gc-... | cdcacec79f7a216c3c988baa4dc31ce4e76c97ac | 5fb019fc29a90e722aff20a9522bf588351358cd |
python/cpython | python__cpython-130564 | # iOS testbed runner prone to failure when two instances start near the same time
# Bug report
### Bug description:
The iOS testbed runner starts an iOS simulator; however, the mechanism that starts the simulator doesn't return the ID of the simulator that was started. The runner needs to know the ID of the simulato... | 9211b3dabeacb92713ac3f5f0fa43bc7cf69afd8 | 6140b0896e95ca96aa15472e14d0502966391485 |
python/cpython | python__cpython-129253 | # asyncio staggered race missing calls to asyncio.future_add_to_awaited_by() and asyncio.future_discard_from_awaited_by()
# Bug report
### Bug description:
asyncio staggered race missing calls to asyncio.future_add_to_awaited_by() and asyncio.future_discard_from_awaited_by()
A possible oversight in https://github.c... | fccbfc40b546630fa7ee404c0949d52ab2921a90 | a156b1942476809d9aca9899ee6465f10671c5c6 |
python/cpython | python__cpython-129193 | # `test_zipfile` fails (env changed)
# Bug report
### Bug description:
```python
eclips4@nixos ~/p/p/cpython (main)> ./python -m test -q test_zipfile
Using random seed: 315532800
0:00:00 load avg: 2.32 Run 1 test sequentially in a single process
test_zipfile failed (env changed)
== Tests result: SUCCESS ==
1 test ... | fc6d4b71eb6bb4dcef3def286302e6bec37aec9f | 67d804b494d5f9f13fff088b50ff488b3701979d |
python/cpython | python__cpython-129174 | # Refactor codecs error handlers to use `_PyUnicodeError_GetParams` and extract complex logic into separate functions
# Feature or enhancement
### Proposal:
I want to refactor the different codecs handlers in `Python/codecs.c` to use `_PyUnicodeError_GetParams`. Some codecs handlers will be refactored as part of #12... | 36bb22993307b25593237a1022790d329b7c75e0 | 732670d93b9b0c0ff8adde07418fd6f8397893ef |
python/cpython | python__cpython-129160 | # test_asyncio leaks references after commit 9d2e1ea3862e5950d48b45ac57995a206e33f38b
# Bug report
### Bug description:
Executing
```
./python -m test test_asyncio.test_subprocess test_asyncio.test_waitfor -R 3:
```
leaks references on `main`. Bisecting points to
```
9d2e1ea3862e5950d48b45ac57995a206e33f38b is th... | a9f5edbf5fb141ad172978b25483342125184ed2 | 9012fa741d55419dc77c5c191794eb93e71ae9a4 |
python/cpython | python__cpython-129321 | # ./android.py configure-host HOST fails because export CXXFLAGS is unquoted
I encountered an issue during ./android.py configure-host in a Docker container that failed the build:
**error**:
```
/bin/sh: 90: export: -I/cpython/cross-build/aarch64-linux-android/prefix/include: bad variable name
```
**workaround**: pat... | a49225cc66680129f129d1fcf6e20afb37a1a877 | a8dc6d6d44a141a8f839deb248a02148dcfb509e |
python/cpython | python__cpython-129168 | # Missing fast path in PyLong_From*() functions for compact integers
# Feature or enhancement
### Proposal:
See e.g. [the fast path using_PyLong_FromMedium()](https://github.com/python/cpython/blob/5aaf41685834901e4ed0a40f4c055b92991a0bb5/Objects/longobject.c#L329-L331) in `PyLong_FromLong()`. `PyLong_FromLongLong(... | ab353b31bb300d55e845476a8e265366455d93fc | 75f59bb62938fc9acac7a4ede19404e889417c6b |
python/cpython | python__cpython-129950 | # Logging Handler.close does not remove instance from shutdown list.
# Bug report
### Bug description:
The close method on my custom handler was being called during shutdown despite me having closed it myself already. The close method (according to the documentation) is supposed to remove itself from the list to be ... | 7c156a63d3d5aadff0d40af73c0f622f7a0fcea5 | b8f7bddd6c6b5d2d13c97882042ce808aceca5a8 |
python/cpython | python__cpython-129142 | # Build fails with gcc 9.4.0 after d3b1bb2
# Bug report
### Bug description:
gcc-9.4.0 (from Ubuntu 20.04) fails to build latest CPython main:
```
In file included from ./Modules/_ctypes/callproc.c:87:
./Modules/_ctypes/ctypes.h:12:72: error: missing binary operator before token "(" ... | 3d7c0e5366c941f29350897ee97469f3aa9d6eab | 05d12eecbde1ace39826320cadf8e673d709b229 |
python/cpython | python__cpython-129108 | # bytearray is not free-thread safe
# Crash report
### What happened?
The `bytearray` object is not free-thread safe. Below is a script which will elicit free-thread associated errors (segfault and incorrect values) from the various `bytearray` methods:
```python
import threading
def clear(b, a, *args): # MODIFIE... | a05433f24a6e1c6d2fbcc82b7a372c376a230897 | d2e60d8e598b622573b68b80b4fbf98c021dd087 |
python/cpython | python__cpython-129159 | # f-string evaluation of conditional expressions with != operator seems to fail
# Bug report
### Bug description:
Hi,
I really feel puzzled by this behaviour:
```
>>> print(f'{True == True=}')
True == True=True
>>> print(f'{True != True=}')
True False
```
I expected that the output of `print(f'{True != True=}')... | 767cf708449fbf13826d379ecef64af97d779510 | 01bcf13a1c5bfca5124cf2e0679c9d1b25b04708 |
python/cpython | python__cpython-129082 | # Deprecate `sysconfig.expand_makefile_vars`
# Feature or enhancement
### Proposal:
Per https://github.com/python/cpython/issues/128978, the function was not working (since 3.13 after 4a53a397c311567f05553bc25a28aebaba4f6f65) because of a `NameError`. There are very few occurrences of that function: https://github.c... | 0a6412f9cc9e694e76299cfbd73ec969b7d47af6 | 38a99568763604ccec5d5027f0658100ad76876f |
python/cpython | python__cpython-129140 | # Empty values of FORCE_COLOR and NO_COLOR are not ignored
# Bug report
### Bug description:
https://no-color.org/
> Command-line software which adds ANSI color to its output by default should check for a NO_COLOR environment variable that, when present **and not an empty string** (regardless of its value), prevent... | 9546fe2ef2db921709f3cb355b33bba977658672 | d6f010dead1a0d4b8a9e51f0187617b0394c9c2a |
python/cpython | python__cpython-129073 | # Glossary entry for "loader" references a long-deprecated method to explain it
# Documentation
The glossary entry for [loader](https://docs.python.org/3.14/glossary.html#term-loader) explains it as
> An object that loads a module. It must define a method named `load_module()`.
However, the [Loader API](https://doc... | e1fa2fcc7c1bf5291a7f71300b7828b49be9ab72 | 8ceb6cb117c8eda8c6913547f3a7de032ed25880 |
python/cpython | python__cpython-129034 | # Remove _Py_InitializeMain() private function
[PEP 587](https://peps.python.org/pep-0587/) "Python Initialization Configuration" added a "Multi-Phase Initialization Private Provisional API":
* `PyConfig._init_main`
* [_Py_InitializeMain()](https://docs.python.org/dev/c-api/init_config.html#c._Py_InitializeMain)
The... | 07c3518ffb27875b14a0f1637aa85f773ff2f9ff | c463270c73a61ef8106ee7bd0571c7c6143e2c20 |
python/cpython | python__cpython-129043 | # Raise `DeprecationWarning` for `sys._clear_type_cache`
# Feature or enhancement
### Proposal:
`sys._clear_type_cache` was [deprecated in 3.13](https://docs.python.org/3.14/library/sys.html#sys._clear_type_cache) in favour of `sys._clear_internal_caches`, however there is no runtime `DeprecationWarning` raised. Sho... | 8783cec9b67b3860bda9496611044b6f310c6761 | b402a4889b690876c488a1d1ccc6d33add3f69c6 |
python/cpython | python__cpython-129021 | # Confusing return type in `tokenize.untokenize` docs
# Documentation
The docs for [tokenize.untokenize](https://docs.python.org/3.14/library/tokenize.html#tokenize.untokenize) are somewhat confusing
regarding the return type of the function. The second paragraphs says:
> The reconstructed script is returned as a si... | bca35f0e782848ae2acdcfbfb000cd4a2af49fbd | 3b6a27c5607d2b199f127c2a5ef5316bbc30ae42 |
python/cpython | python__cpython-129562 | # Notes comparing `NotImplementedError` and `NotImplemented` have inconsistent linking
# Documentation
The link to the `OtherItem` is in different locations in the otherwise similar notes. One with the *See `OtherItem`*, the other in the sentence calling out they are different. They should probably be consistent.
... | a85eeb97710617404ba7a0fac3b264f586caf70c | 097846502b7f33cb327d512e2a396acf4f4de46e |
python/cpython | python__cpython-128999 | # Problematic numbered list in Programming FAQ
# Documentation
Problematic numbered list from Programming FAQ breaking translated Python documentation, showing in English and emits Sphinx warning even without any translation:
```
faq/programming.rst:1912:<translated>:3: WARNING: Literal block expected; none found. [... | e8092e5cdcd6707ac0b16d8fb37fa080a88bcc97 | fba475ae6f932d0aaee6832b4102b2d4c50df70f |
python/cpython | python__cpython-128992 | # bdb holds the reference to the enter frame unnecessarily long
# Feature or enhancement
### Proposal:
bdb records the frame that enters the debugger as a utility. However, that could potentially cause a temporary refleak. It will probably clean up eventually, but a temp leak on a frame object is expensive - it link... | 61b35f74aa4a6ac606635e245147ff3658628d99 | e8092e5cdcd6707ac0b16d8fb37fa080a88bcc97 |
python/cpython | python__cpython-128979 | # Leftover code in `sysconfig.expand_makefile_vars`
# Bug report
### Bug description:
I think there is some leftover code in `sysconfig.expand_makefile_vars` (4a53a397c311567f05553bc25a28aebaba4f6f65):
https://github.com/python/cpython/blob/4dade055f4e18a7e91bc70293abb4db745ad16ca/Lib/sysconfig/__init__.py#L727-L73... | df66ff14b49f4388625212f6bc86b754cb51d4eb | 59fcae793f94be977c56c1f3c2988bd93d6b1564 |
python/cpython | python__cpython-128975 | # Crash in `UnicodeError.__str__` with attributes have custom `__str__`
# Crash report
### What happened?
```py
class Evil(str):
def __str__(self):
del exc.object
return 'evil'
exc = UnicodeEncodeError(Evil(), "object", 0, 0, Evil())
str(exc)
```
results in `Segmentation fault (core dumped)`. A... | ddc27f9c385f57db1c227b655ec84dcf097a8976 | 75f38af7810af1c3ca567d6224a975f85aef970f |
python/cpython | python__cpython-133085 | # Incompatible change in internal string representation (encountered with Rust bindings) (?)
Not sure if it's the right place to ask, but here it is.
I'm attempting to introduce 3.14 support in `pyo3` (PyO3/pyo3#4811). I've encountered test failures involving UCS and refcounts targeting Windows and Linux. Invoking `c... | 987e45e6326c6174fb7a300f44b9d8e4e26370c9 | d78768e3d69fec730760f6e59c91fd12f2a00d11 |
python/cpython | python__cpython-128962 | # array iterator segfault on __setstate__() when exhausted
# Crash report
### What happened?
```python
>>> import array
... a = array.array('i')
... it = iter(a)
... list(it)
... it.__setstate__(0)
...
Segmentation fault (core dumped)
```
This goes back at least to py 3.8 (checked on that one), PR fix incoming.
##... | 4dade055f4e18a7e91bc70293abb4db745ad16ca | 9ed7bf2cd783b78b28f18abc090f43467a28f4aa |
python/cpython | python__cpython-128957 | # Uninitialized variable `next_instr` in error code path
# Bug report
https://github.com/python/cpython/blob/d95ba9fa1110534b7247fa2ff12b90e930c93256/Python/ceval.c#L843-L855
Clang warns:
```
Python/ceval.c:848:17: warning: variable 'next_instr' is used uninitialized whenever 'if' condition is true [-Wsometimes-uni... | 13c4def692228f09df0b30c5f93bc515e89fc77f | d95ba9fa1110534b7247fa2ff12b90e930c93256 |
python/cpython | python__cpython-128925 | # Reference counting bug with manually allocated heap types
# Bug report
Found by @vfdev-5.
This is specific to the free threading build and 3.14.
XLA/Jax uses the following code to create a heap type:
```c++
// We need to use heap-allocated type objects because we want to add
// additional methods dynamically... | d66c08aa757f221c0e8893300edac105dfcde7e8 | 767c89ba7c5a70626df6e75eb56b546bf911b997 |
python/cpython | python__cpython-128933 | # `socketserver.Unix*Server` may attempt to set `SO_REUSEPORT` on Unix sockets, causing `EOPNOTSUPP`, e.g. in `test_asyncio`
# Bug report
### Bug description:
When `socketserver.Unix*Server.server_bind()` is called with `allow_reuse_port` attribute set to `True`, it attempts to call `self.socket.setsockopt(socket.SO... | 3829104ab412a47bf3f36b8c133c886d2cc9a6d4 | 8174770d311ba09c07a47cc3ae90a1db2e7d7708 |
python/cpython | python__cpython-128918 | # Get rid of conditional inputs and outputs for instructions in bytecodes.c
We should remove the conditional stack effects in instruction definitions in bytecodes.c
Conditional stack effects already complicate code generation and that is only going to get worse with top-of-stack caching and other interpreter/JIT opti... | a10f99375e7912df863cf101a38e9703cfcd72f1 | d7d066c3ab6842117f9e0fb1c9dde4bce00fa1e3 |
python/cpython | python__cpython-128912 | # [C API] Add PyImport_ImportModuleAttr(mod_name, attr_name) helper function
# Feature or enhancement
### Proposal:
Python has an internal `_PyImport_GetModuleAttrString(mod_name, attr_name)` helper function to import a module and get a module attribute. I propose to make this function public to be able to use it ou... | 3bebe46d3413195ee18c5c9ada83a35d4fd1d0e7 | f927204f64b3f8dbecec784e05bc8e25d2a78b2e |
python/cpython | python__cpython-128919 | # `_PyTrash_begin` and `_PyTrash_end` do not have implementation
We only have this left for `_PyTrash_begin` and `_PyTrash_end`:
```
~/Desktop/cpython2 main ✗
» ag _PyTrash_begin .
Misc/NEWS.d/3.9.0a5.rst
1217:PyThreadState attributes, but call new priv... | f48702dade921beed3e227d2a5ac82a9ae2533d0 | 3893a92d956363fa2443bc5e47d4bae3deddacef |
python/cpython | python__cpython-128903 | # GCC style fallthrough attribute is used with clang versions that don't support it
# Bug report
### Bug description:
`Include/pyport.h` currently only guards use of `__attribute__((fallthrough))` with `_Py__has_attribute(fallthrough)`. Clang versions prior to 10 do not support this syntax, but do claim to support t... | edf803345a5c57c38fca3850386530e30b397eca | 86c1a60d5a28cfb51f8843b307f8969c40e3bbec |
python/cpython | python__cpython-128946 | # `raise SyntaxError('hello', 'abcdef')` crashes the new Python 3.13 REPL
# Bug report
### Bug description:
In we enter this in the new interactive interpreter in Python 3.13
```python
raise SyntaxError('hello', 'abcdef')
```
the interpreter window closes without any error message.
This happens because the second a... | a16ded10ad3952406280be5ab9ff86a476867b08 | a9f5edbf5fb141ad172978b25483342125184ed2 |
python/cpython | python__cpython-128892 | # opcode.opname does not contain specialised bytecodes
```
>>> import opcode
>>> opcode._specialized_opmap['BINARY_OP_ADD_INT']
151
>>> opcode.opname[151]
'<151>'
>>>
```
Expected:
```
>>> opcode.opname[151]
'BINARY_OP_ADD_INT'
```
<!-- gh-linked-prs -->
### Linked PRs
* gh-128892
<!-- /gh-linked-prs -->
| 5eee2fe2b05c1a2836184e047fbd4176945cbf10 | 256d6d2131541b3ff8f06f42c8157f808fde464c |
python/cpython | python__cpython-128944 | # test_ctypes.test_generated_structs.GeneratedTest.test_generated_data 'ManyTypesU' fails on Python 3.14 built with gcc 15
# Bug report
### Bug description:
When running test suite on Python 3.14.0a4 built with gcc 15.0.3 on Fedora Linux 42 (Rawhide), test_generated_data fails for many of its types.
I suspect this i... | 13475e0a5a317fa61f302f030b0effcb021873d6 | 4b37a6bda236121c130b4a60e573f123cb5e4c58 |
python/cpython | python__cpython-128875 | # Building the documentation fails with newly released blurb 2.0
# Bug report
### Bug description:
Example of failure: https://github.com/python/cpython/actions/runs/12789465122/job/35652975974?pr=128868
```
blurb.blurb.BlurbError: Error in Misc/NEWS.d/3.11.0b1.rst:581:
'gh-issue:' or 'bpo:' must be specified in th... | 40a4d88a14c741172a158683c39d232c587c6f11 | 599be687ec7327c30c6469cf743aa4ee9e82232d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.