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-128097 | # NotImplementedError raised by annotationlib (?) when importing classes derived from NamedTuple
# Bug report
### Bug description:
With 3.14.0a3 there is an issue which affects all of the building block packages: setuptools, pip, wheel, causing failure to build of over 2800 packages in Fedora Linux total.
In ... | d50fa0541b6d4f458d7ab16d3a11b1117c607f85 | 879d287f49edcd4fa68324265f8ba63758716540 |
python/cpython | python__cpython-128081 | # It seems that `enum.Enum.__init__` serves no purpose
# Feature or enhancement
### Proposal:
Enum gained an `__init__` method in 3.11 which just passes:
```python
def __init__(self, *args, **kwds):
pass
```
That was added in https://github.com/python/cpython/pull/30582. [One person question... | c14db202750ff9eaf3919298f1172270b7dfd64e | 255762c09fe518757bb3e8ce1bb6e5d8eec9f466 |
python/cpython | python__cpython-128780 | # Async generator/anext with default-tuple-value results in SystemError: <class 'StopIteration'> returned with exception set
# Bug report
### Bug description:
I asked a question on [stackoverflow](https://stackoverflow.com/questions/79289349/why-does-this-async-generator-anext-snippet-result-in-systemerror-class... | 76ffaef729c91bb79da6df2ade48f3ec51118300 | 517dc65ffcea8413e1a60c4cb5d63e5fa39e7f72 |
python/cpython | python__cpython-128537 | # Code generator should reject escaping calls in DEOPT_IF/EXIT_IF
I had a
`EXIT_IF(escaping_call(), OP);`
and it produced:
```
_PyFrame_SetStackPointer(frame, stack_pointer);
DEOPT_IF(escaping_call(), OP);
stack_pointer = _PyFrame_GetStackPointer(frame);
... | b9c693dcca01537eee1ef716ffebc632be37594b | f89e5e20cb8964653ea7d6f53d3e40953b6548ce |
python/cpython | python__cpython-128063 | # Fix the font size and shortcut display of the turtledemo menu
### Bug description:
The font size of turtledemo's menu bar is too large and the shortcut keys are not displayed well enough.
Actually:
<img width="732" alt="2024-12-18-18-07-39" src="https://github.com/user-attachments/assets/496c27e6-00c4-4b85-... | e163e8d4e1a9844b8615ef38b9917b887a377948 | 1b15c89a17ca3de6b05de5379b8717e9738c51ef |
python/cpython | python__cpython-128068 | # [Free Threading] test_builtin.ImmortalTests fail on i686 (32-bit)
# Bug report
### Bug description:
In Fedora Linux, when building 3.14.0a3 on i686 architecture and freethreading-debug build, `test_tuple_respect_immortality`, `test_list_repeat_respect_immortality` and `test_immortals` fail.
This is not happen... | daa260ebb1c1b20321e7f26df7c9dbd35d4edcbf | 39e69a7cd54d44c9061db89bb15c460d30fba7a6 |
python/cpython | python__cpython-128070 | # test_sysconfig.TestSysConfig.test_sysconfigdata_json fails: it expects 'userbase' to be '/root/.local'
# Bug report
### Bug description:
As in the title. We hit this in Fedora, can it be caused by the mismatch of users (one which generated the file, the other which runs tests?)
```python
FAIL: test_sysconfigdata_... | e7980ba233bcbdb811e96bd5003c7d51a4e25155 | 3a8cefba0b60bd25c6b13a32cab4eb8d1dbf94ce |
python/cpython | python__cpython-135908 | # Broken tests with "legacy" sys.float_repr_style
# Bug report
### Bug description:
In #128005 broken (by downstream patch) build reveal some problems in the CPython test suite. Except for few explicitly marked tests, other don't care about different repr() behavior for floats. Many tests fail [when interprete... | f3aec60d7a01c5f085a3ef2d6670d46b42b8ddd3 | e23518fa96583d0190d457adb807b19545df26cf |
python/cpython | python__cpython-128079 | # Return value of <ExceptionGroup class>.split has insufficient checks leading to a type confusion bug
# Crash report
### What happened?
The following code has checks to make sure the return value is a tuple and of size 2, but only in asserts which means that these checks wont happen on a non-debug build.
https://g... | 3879ca0100942ae15a09ac22889cbe3e46d424eb | 5a584c8f54bbeceae7ffa501291e29b7ddc8a0b9 |
python/cpython | python__cpython-128044 | # code objects remove unknown opcodes from the instruction stream when accessing `co_code`
# Bug report
### Bug description:
If you construct a code object with an unknown opcode it'll get removed when the code object goes through the opcodes to de-opt them. We should just ignore unknown opcodes instead.
### CPytho... | cc9add695da42defc72e62c5d5389621dac54b2b | 71ea6a6798c5853ed33188865a73b044ede8aba8 |
python/cpython | python__cpython-128043 | # Add `terminate_workers` to `ProcessPoolExecutor`
# Feature or enhancement
### Proposal:
This is an interpretation of the feature ask in: https://discuss.python.org/t/cancel-running-work-in-processpoolexecutor/58605/1. It would be a way to stop all the workers running in a `ProcessPoolExecutor`
```python
p = Proc... | efadc5874cdecc0420926afd5540b9b25c5e97fe | 63ffb406bb000a42b0dbddcfc01cb98a12f8f76a |
python/cpython | python__cpython-128036 | # Add ssl.HAS_PHA to detect libssl PHA support
# Feature or enhancement
### Proposal:
[TLSv1.3 post-handshake client authentication](https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.6) (PHA), often referred to as "mutual TLS" or "mTLS", allows TLS servers to authenticate client identities using digital cert... | 418114c139666f33abff937e40ccbbbdce15bc39 | 7985d460c731b2c48419a33fc1820f9512bb6f21 |
python/cpython | python__cpython-128054 | # Change PyMutex_LockFast to take mutex as argument
`PyMutex_LockFast` is the only function which takes the bits from mutex directly rather than the mutex. It breaks a good abstraction so I propose to change it to take the mutex as its argument like all other functions.
cc @colesbury
<!-- gh-linked-prs -->
### Lin... | 91c55085a959016250f1877e147ef379bb97dd12 | 8a433b683fecafe1cb04469a301df2b4618167d0 |
python/cpython | python__cpython-128047 | # Regression in 3.13.1 for imports of nonexistant names from CFFI modules
# Bug report
### Bug description:
cffi's `TestNewFFI1.test_import_from_lib` started failing with:
```python
> from _test_import_from_lib.lib import bar
E TypeError: bad argument type for built-in operation
```
This is whe... | 45e6dd63b88a782f2ec96ab1da54eb5a074d8f4c | daa260ebb1c1b20321e7f26df7c9dbd35d4edcbf |
python/cpython | python__cpython-128887 | # The sys.float_repr_style should be read-only
# Bug report
### Bug description:
It's possible to "change" the repr style for floats:
```pycon
Python 3.14.0a2+ (heads/long_export-decimal:4bb9ad04f5, Dec 17 2024, 05:39:57) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>... | 313b96eb8b8d0ad3bac58d633822a0a3705ce60b | d05140f9f77d7dfc753dd1e5ac3a5962aaa03eff |
python/cpython | python__cpython-128020 | # Make `SyntaxWarning` for invalid escape sequences better reflect their intended deprecation
# Feature or enhancement
### Proposal:
I would like to propose that the `SyntaxWarning` that is raised when an invalid escape sequence is used be updated to better reflect the fact that the ability of Python users to em... | 8d8b854824c4723d7c5924f1d5c6a397ea7214a5 | 40a4d88a14c741172a158683c39d232c587c6f11 |
python/cpython | python__cpython-128015 | # `tkinter.Wm.wm_iconbitmap` has no effect when passing an empty string to the parameter `default`
# Bug report
### Bug description:
```python
import tkinter
from tkinter import messagebox
root = tkinter.Tk()
root.update()
root.tk.call("wm", "iconbitmap", root._w, "-default", "")
messagebox.showinfo()
root.mainloop... | 58e9f95c4aa970db32a94b9152b51ede22f823bd | c9d2bc6d7f6d74e0539afb0f7066997ae736dfc8 |
python/cpython | python__cpython-128021 | # Data race in PyUnicode_AsUTF8AndSize under free-threading
# Bug report
### Bug description:
Repro: build this C extension (`race.so`) with free threading enabled, with a CPython built with thread-sanitizer enabled:
```
#define PY_SSIZE_T_CLEAN
#include <Python.h>
static PyObject *ConvertStr(PyObject *self, PyObj... | 3c168f7f79d1da2323d35dcf88c2d3c8730e5df6 | 46dc1ba9c6e8b95635fa27607d01d6108d8f677e |
python/cpython | python__cpython-128009 | # Add `PyWeakref_IsDead()` to test if a weak reference is dead
# Feature or enhancement
```c
// Returns 1 if the pointed to object is dead, 0 if it's alive, and -1 with an error set if `ref` is not a weak reference.
int PyWeakref_IsDead(PyObject *ref);
```
### C API Working Group Issue
* https://github.com/capi-wor... | 7b811d0562a0bf7433165785f1549ac199610f8b | b9b3e4a076caddf7876d1d4d762a117a26faffcf |
python/cpython | python__cpython-128147 | # Audit asyncio thread safety
The following functions needs to be made thread safe and atomic for free-threading for both pure python and C implementation:
- [x] `asyncio._enter_task`
- [x] `asyncio._leave_task`
- [x] `asyncio._register_task`
- [x] `asyncio._unregister_task`
- [x] `asyncio._swap_current_task`... | 513a4efa75bf78c9d629ddabc9516fb058787289 | f1574859d7d6cd259f867194762f04b72ef2c340 |
python/cpython | python__cpython-127990 | # Refer to the GIL as a thread state in the C API
# Documentation
"The GIL" is used all over the place in the C API documentation, but it's not really correct, and is a bit misleading for users. The biggest issue is that for free-threading, there is no GIL, so users erroneously call the C API inside `Py_BEGIN_ALLOW... | 86d5fa95cf9edf6c6fbc2a72080ac1ee87c4e941 | 83d54fa8760f54935086bb40a2e721f927e705b9 |
python/cpython | python__cpython-127980 | # `ast.unparse` is needlessly "hip" for f-string quotes in Python 3.12+
# Feature or enhancement
### Proposal:
Up until Python 3.11, the output of the following `ast.parse`/`unparse` run
```python
import ast
from sys import version_info as vi
print(f"{vi.major}.{vi.minor}.{vi.micro}")
print(ast.unparse(ast.parse("... | 8df5193d37f70a1478642c4b456dcc7d6df6c117 | 95504f429eec04010d0b815345ebcc3af2402af0 |
python/cpython | python__cpython-132574 | # ASan: heap-buffer-overflow in ucs2lib_default_find
# Bug report
### Bug description:
**Environments**:
macOS 15.2
Homebrew 4.4.11
Homebrew clang version 19.1.5
Target: arm64-apple-darwin24.2.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/llvm/19.1.5/bin
Configuration file: /opt/h... | 85ec3b3b503ffd5b7e45f8b3fa2cec0c10e4bef0 | a93d9aaf62bb2565e9eec00a2a8d06a91305127b |
python/cpython | python__cpython-127972 | # Inconsistent platform support for taking the loaded `libpython` path into account in `getpath`
# Bug report
### Bug description:
The current `getpath.py` code tries determining `base_prefix`/`base_exec_prefix` by searching the location of the `libpython` library loaded in the current process, falling back to the l... | 95cd9c669cdc7718198addb1abb49941a2c61fae | eb26e170695f15714b5e2ae0c0b83aa790c97869 |
python/cpython | python__cpython-134275 | # Executing `from . import *` within the REPL will import the `_pyrepl` package, But executing with the `-c` argument will result in an error.
# Bug report
### Bug description:
My working directory is under `MyProject`, which includes an `__init__.py` file and other necessary files to be recognized as a package.
But... | b1b8962443e7d418601658a4b05347a5a9161910 | a66bae8bb52721ea597ade6222f83876f9e939ba |
python/cpython | python__cpython-127986 | # `PyObject_DelItemString` is not documented
# Documentation
`PyObject_DelItemString` is part of the limited C-API and is undocumented. This function was implemented in commit https://github.com/python/cpython/commit/b0d71d0ec6e575b7c379d55cb8366b26509ece53 , but no documentation was added.
<!-- gh-linked-p... | 8ade15343d5daec3bf79ff7c47f03726fb2bcadf | 87ee76062a7eb9c0fa2b94e36cfed21d86ae90ac |
python/cpython | python__cpython-127952 | # Add option to display pystats on windows
# Feature or enhancement
### Proposal:
The internal Python performance statistics gathering option [PyStats](https://docs.python.org/3/using/configure.html#cmdoption-enable-pystats) is not available on Windows.
### Has this already been discussed elsewhere?
This is a mi... | b9b3e4a076caddf7876d1d4d762a117a26faffcf | b5d1e4552f0ba40d8380368e1b099261686a89cf |
python/cpython | python__cpython-128024 | # Deprecate asyncio policy system
#### asyncio's policy system deprecation
asyncio's policy system[^1] has been a source of confusion and problems in asyncio for a very long time. The policies no longer serve a real purpose. Loops are always per thread, there is no need to have a "current loop" when no loop is curr... | 5892853fb71acd6530e1e241a9a4bcf71a61fb21 | 559b0e7013f9cbf42a12fe9c86048d5cbb2f6f22 |
python/cpython | python__cpython-128109 | # Crash when modifying DLL function pointers conconcurrently
It seems that `ctypes` doesn't like having function pointers on a `CDLL` modified concurrently. Here's a reproducer (for Linux):
```py
import ctypes
from threading import Thread
dll = ctypes.CDLL("libc.so.6")
def main():
for _ in range(100):
... | ba45e5cdd41a39ce0b3de08bdcfa9d8e28e0e4f3 | cbfe3023e46b544b80ea1a38a8c900c6fb881554 |
python/cpython | python__cpython-131662 | # `ctypes` thread safety auditing (and fixing)
# Feature or enhancement
This is a tracking issue for all thread safety problems related to ctypes. I'll be working on this, but others can feel free to give me some help.
First of all, we need to find where the thread safety problems are.
```[tasklist]
### Auditing
- ... | 96ef4c511f3ec763dbb06a1f3c23c658a09403a1 | 6fb5f7f4d9d22c49f5c29d2ffcbcc32b6cd7d06a |
python/cpython | python__cpython-127939 | # Remove private _PyLong_FromDigits() function
With [PEP 757](https://peps.python.org/pep-0757/) - one can be replaced by PyLongWriter API.
I was able to find [just one project](https://github.com/xia-mc/PyFastUtil/blob/7183e961c5eb3da879f002e4e81e91cbcc9702e3/pyfastutil/src/utils/PythonUtils.h#L125) on the GH, usi... | 233fd00f0a19d33932e35f2fb6794ecae745b780 | 3d8fc8b9ae5beec852acf1a0e8102da030eeb1aa |
python/cpython | python__cpython-128530 | # Remove private _PyLong_New() function
With [PEP 757](https://peps.python.org/pep-0757/) - one can be replaced by PyLongWriter API.
Despite this is a private function, it's used by some projects (e.g. Sagemath). Maybe we should first deprecate this function.
<!-- gh-linked-prs -->
### Linked PRs
* gh-128530
<!--... | d7d066c3ab6842117f9e0fb1c9dde4bce00fa1e3 | 1d485db953fa839942a609202ace49d03708f797 |
python/cpython | python__cpython-128003 | # Optionally run Python regression tests in parallel
# Feature or enhancement
This proposes adding an option to the [regression test runner](https://docs.python.org/3/library/test.html#module-test.regrtest) to run individual tests multiple times in parallel with the goal of uncovering multithreading bugs, especially ... | e5f10a741408206e61cf793451cbd373bbe61594 | 285c1c4e9543299c8bf69ceb39a424782b8c632e |
python/cpython | python__cpython-127876 | # Crash in `Objects/unicodeobject.c::_copy_characters` when there is nothing to copy (DEBUG build only)
# Crash report
### What happened?
Reproduce on Python 3.12.8+ or 3.13.1+, `main` work fine, but there is a problem there too:
```bash
./configure --with-pydebug
make
./python --version
Python 3.13.1+
./python -c '... | 46cb6340d7bad955edfc0a20f6a52dabc03b0932 | 4c14f03495724f2c52de2d34f1bfa35dd94757c0 |
python/cpython | python__cpython-127932 | # Unable to build a HACL* module on macOS under Catalina
# Bug report
### Bug description:
The recent HACL* change in Python 3.14.0a2 cause local build breakage on macOS below Catalina due to lack of support for `aligned_alloc` (also `memset_s` on older macOS <10.9).
Fixes for the affected dependency have alr... | 329165639f9ac00ba64f6493dbcafcef6955e2cb | 5892853fb71acd6530e1e241a9a4bcf71a61fb21 |
python/cpython | python__cpython-127979 | # `PySequence_In` is not documented
# Documentation
`PySequence_In` is part of the limited C-API, and has no document. PEP 3100 ( https://peps.python.org/pep-3100/ ) says this function is "To be removed," but it has not been removed in the latest version, so documentation seems to be needed.
<!-- gh-linked-prs -->... | 52d552cda7614c7aa9f08b680089c630587e747f | 0d8e7106c260e96c4604f501165bd106bff51f6b |
python/cpython | python__cpython-127880 | # Race in `_PyFreeList_Push`
# Bug report
Seen in https://github.com/python/cpython/actions/runs/12216713951/job/34310688405?pr=126865:
Reported by @markshannon
```
==================
WARNING: ThreadSanitizer: data race (pid=20210)
Write of size 8 at 0x7fbb3e0415f0 by thread T31:
#0 _PyFreeList_Push /home/ru... | f8dcb8200626a1a06c4a26d8129257f42658a9ff | 7146f1894638130940944d4808dae7d144d46227 |
python/cpython | python__cpython-127877 | # `can_colorize()` ignores `FORCE_COLOR`/`NO_COLOR`/`TERM` when `-E` is set
# Bug report
### Bug description:
Using one of the `FORCE_COLOR`, `NO_COLOR` or `TERM=dumb` environment variables is ignored when you use Python with `-E`.
* https://docs.python.org/3/using/cmdline.html#using-on-controlling-color
`... | 05d12eecbde1ace39826320cadf8e673d709b229 | 13475e0a5a317fa61f302f030b0effcb021873d6 |
python/cpython | python__cpython-127872 | # Segfaults in ctypes _as_parameter_ handling when called with `MagicMock`
# Crash report
### What happened?
It's possible to segfault the interpreter by calling any of the 3 functions below with `MagicMock` as argument. It takes a long time to trigger the crash (up to 3 minutes in my slow machine).
```python
from ... | 6ff38fc4e2af8e795dc791be6ea596d2146d4119 | e62e1ca4553dbcf9d7f89be24bebcbd9213f9ae5 |
python/cpython | python__cpython-127866 | # Build failure without thread local support
# Bug report
### Bug description:
When building environments without thread local support, this build failure occurs:
```
~/cpython-3.13.1/Python/import.c:750: error: argument of type "PyMutex" is incompatible with parameter of type "PyThread_type_lock"
PyThread_acq... | f823910bbd4bf01ec3e1ab7b3cb1d77815138296 | f8dcb8200626a1a06c4a26d8129257f42658a9ff |
python/cpython | python__cpython-127878 | # New warning in the main: Python/import.c [-Wstringop-truncation]
# Bug report
### Bug description:
```
$ cc --version|head -1
cc (Debian 12.2.0-14) 12.2.0
$ ./configure -q && make -s
In function ‘hashtable_key_from_2_strings’,
inlined from ‘_extensions_cache_find_unlocked’ at Python/import.c:1266:17:
... | 081673801e3d47d931d2e2b6a4a1515e1207d938 | 52d552cda7614c7aa9f08b680089c630587e747f |
python/cpython | python__cpython-127854 | # It's undocumented, that comma is invalid as separator for "b", "o" and "x" integer types
```pycon
>>> format(12347834, '_x')
'bc_69ba'
>>> format(12347834, ',x')
Traceback (most recent call last):
File "<python-input-1>", line 1, in <module>
format(12347834, ',x')
~~~~~~^^^^^^^^^^^^^^^^
ValueError:... | e2325c9db0650fc06d909eb2b5930c0573f24f71 | 78e766f2e217572eacefba9ec31396b016aa88c2 |
python/cpython | python__cpython-127856 | # Data corruption when reading from two files in parallel in an uncompressed .zip
# Bug report
### Bug description:
I ran into a data corruption bug that seems to be triggered by interleaving reads/seeks from different files inside of an uncompressed zip file. As far as I can tell from the docs, this is allowed by `... | 7ed6c5c6961d0849f163d4d449fb36bae312b6bc | 9fce90682553e2cfe93e98e2ae5948bf9c7c4456 |
python/cpython | python__cpython-127846 | # Enhance the iOS test runner
# Feature or enhancement
### Proposal:
The iOS test runner can now be used to run third-party project test suites; using it in practice has revealed some possible enhancements.
* A `--verbose` option to reduce the amount of output from Xcode builds (which will be mostly boilerplate)
* ... | ba2d2fda93a03a91ac6cdff319fd23ef51848d51 | 0cbc19d59e409854f2b9bdda75e1af2b6cd89ac2 |
python/cpython | python__cpython-127844 | # The JIT's understanding of `**` is wrong
# Crash report
`**` is weird in that the *type* of the result depends on the *values* of the inputs. The logic for `int`/`float` power is:
```py
def type_of_pow(lhs: float, rhs: float) -> type[complex]:
if isinstance(lhs, int) and isinstance(rhs, int) and rhs >= 0:
... | 65ae3d5a73ca3c53a0c6b601dddb8e9b3b6e3f51 | e08b28235a863323ca3a7e444776bb7803e77caf |
python/cpython | python__cpython-127810 | # pathlib ABCs: remove or namespace private attributes
@encukou [pointed out](https://github.com/python/cpython/pull/127725#issuecomment-2528154896):
> I see there's currently no distinction between pathlib-internal attribute names and names that are free for third-party subclasses to use.
> Should there be a stro... | 8d9f52a7be5c09c0fd4423943edadaacf6d7f917 | f5ba74b81979b621e38be70ec3ddad1e7f1365ce |
python/cpython | python__cpython-127850 | # Logger formatter class initialization state clarification
# Documentation
https://docs.python.org/3/library/logging.html#logging.Handler.setFormatter
When providing a logger handler with a formatter class, there is no documentation stating if that formatter class needs to be initialized before passing it as a... | 5d66c55c8ad0a0aeff8d06021ddca1d02c5f4416 | d63af9540f6163104699a6e09267696307f0d002 |
python/cpython | python__cpython-127820 | # email.message.EmailMessage accepts invalid header field names without error, which raise an error when parsed
# Bug report
### Bug description:
`email.message.EmailMessage` accepts invalid header field names without error, which raise an error when parsed, regardless of policy and causes corrupt emails.
Cas... | c432d0147bdf1a66604e7a3d6a71660ae79b5f45 | 55150a79cacbce44f50cea128c511782df0ab277 |
python/cpython | python__cpython-127793 | # `PyUnstable_AtExit` isn't well tested and undocumented
# Bug report
### Bug description:
While working on #126908, @vstinner noted that this part of `PyUnstable_AtExit` looks wrong: https://github.com/python/cpython/blob/cef0a90d8f3a94aa534593f39b4abf98165675b9/Modules/atexitmodule.c#L45-L47
This will result in l... | d5d84c3f13fe7fe591b375c41979d362bc11957a | 2cdeb61b57e638ae46a04386330a12abe9cddf2c |
python/cpython | python__cpython-127789 | # Refactor `PyUnicodeError` internal C helpers
# Feature or enhancement
### Proposal:
Some helpers make the realization of https://github.com/python/cpython/issues/126004 a bit harder as we end up with many duplicated code. In order to make the related PRs and https://github.com/python/cpython/pull/127694 smooth... | fa985bee6189aabac1c329f2de32aa9a4e88e550 | 8abd6cef68a0582a4d912be76caddd9da5d55ccd |
python/cpython | python__cpython-130596 | # Verify permissions in `require-pr-label.yml` workflow
# Bug report
### Bug description:
This came up in https://github.com/python/cpython/pull/127749#discussion_r1876778887
The writing permissions for the `require-pr-label.yml` workflow might not be needed. We should double-check that and remove them if they aren... | 5ba69e747fa9da984a307b2cbc9f82bac1e0db04 | daeb0efaf445be5634d73e13d39a2641851b0bb4 |
python/cpython | python__cpython-127849 | # Unhandled `BytesWarning` when `test.support.strace_helper.strace_python` fails
```text
======================================================================
FAIL: test_all (test.test___all__.AllTest.test_all)
----------------------------------------------------------------------
Traceback (most recent call last... | c0264fc57c51e68015bef95a2208711356b57c1f | 2de048ce79e621f5ae0574095b9600fe8595f607 |
python/cpython | python__cpython-127756 | # The error message for odd-length input to `bytes.fromhex` is cryptic
# Bug report
### Bug description:
```pytb
Python 3.14.0a2+ (main, Dec 8 2024, 10:50:32) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> bytes.fromhex('deadbee')
Traceback (most recent call... | c33b6fbf358c1bc14b20e14a1fffff62c6826ecd | 41f29e5d16c314790559e563ce5ca0334fcd54df |
python/cpython | python__cpython-127735 | # Improving signature of `urllib.request.HTTPPasswordMgrWithPriorAuth.__init__`
# Feature or enhancement
### Proposal:
`urllib.request.HTTPPasswordMgrWithPriorAuth.__init__` ([link](https://github.com/python/cpython/blob/79b7cab50a3292a1c01466cf0e69fb7b4e56cfb1/Lib/urllib/request.py#L879)) has `(self, *args, **k... | a03efb533a58fd13fb0cc7f4a5c02c8406a407bd | 7f8ec523021427a5c1ab3ce0cdd6e4bb909f1dc5 |
python/cpython | python__cpython-127733 | # Fix detection of Windows Server 2025 by `platform.py`
# Feature or enhancement
### Proposal:
Windows Server 2025 was officially released a month ago and is now detected as Server 2022 instead of Server 2025
Microsoft Lifecycle:
https://learn.microsoft.com/en-us/lifecycle/products/windows-server-2025
https://www.m... | 5eb7fd4d0fc37b91058086181afebec41e66e5ad | 2041a95e68ebf6d13f867e214ada28affa830669 |
python/cpython | python__cpython-127731 | # `venv.EnvBuilder.ensure_directories` returns incorrect `inc_path` value
# Bug report
### Bug description:
```python
$ ./python
Python 3.14.0a2+ experimental free-threading build (heads/main:79b7cab50a3, Dec 7 2024, 19:01:51) [GCC 14.2.1 20240910] on linux
Type "help", "copyright", "credits" or "license" for more ... | 8ac307f0d6834148471d2e12a45bf022e659164c | a8ffe661548e16ad02dbe6cb8a89513d7ed2a42c |
python/cpython | python__cpython-127719 | # Add colour to `test.regrtest` output
# Feature or enhancement
In Python 3.13 we added colour output to the new REPL, tracebacks and doctest, and in 3.14 to unittest, that can also be controlled with the `PYTHON_COLORS`, `NO_COLOR` and `FORCE_COLOR` environment variables:
* https://docs.python.org/3.14/whatsnew... | 212448b1623b45f19c5529595e081da72a6521a0 | 2233c303e476496fc4c85a29a1429a7e4b1f707b |
python/cpython | python__cpython-127726 | # logging.handlers.SMTPHandler: secure argument is broken in Python 3.12+
# Bug report
### Bug description:
The [documentation](https://docs.python.org/3/library/logging.handlers.html#smtphandler) for `logging.handlers.SMTPHandler` describes the `secure` argument as follows:
> To specify the use of a secure protocol... | d7672e5d5a7b9580a72dbe75d3a9e8840bcc604c | 94cd2e0ddeff83dee3254ca356d9e4396927d075 |
python/cpython | python__cpython-127875 | # Use tagged pointers on the stack in the default build.
Currently all references to objects in frameobjects use `_PyStackRef` instead of `PyObject *`.
This is necessary for the free-threaded build to support deferred references.
For the default build `_PyStackRef` is just an alias for `PyObject *`.
We should cha... | 2bef8ea8ea045d20394f0daec7a5c5b1046a4e22 | 7cc99a54b755cc7cc0b3680fde7834cf612d4fbc |
python/cpython | python__cpython-127694 | # Check for type consistency for `PyUnicodeError` API
# Feature or enhancement
### Proposal:
This is a follow-up to https://github.com/python/cpython/pull/123380#discussion_r1865910020.
The idea is to add assertion type-checks when calling helper functions on unicode objects:
```C
assert(PyObject_TypeCheck(exc... | 8bc18182a7c28f86265c9d82bd0338137480921c | 6446408d426814bf2bc9d3911a91741f04d4bc4e |
python/cpython | python__cpython-127689 | # Add `SCHED_DEADLINE` and `SCHED_NORMAL` constants to `os` module
# Feature or enhancement
### Proposal:
This issue suggests adding new os constants.
`os.SCHED_DEADLINE`
```
# deadline scheduling
# Set the current schedule to real-time schedule, To be precise, it
# is not real-time scheduling, but it is ... | ea578fc6d310c85538aefbb900a326c5c3424dd5 | 19c5134d57764d3db7b1cacec4f090c74849a5c1 |
python/cpython | python__cpython-132351 | # Regression of 3.13.1 with iterator creation being duplicated
# Bug report
### Bug description:
For my Python compiler Nuitka, I use CPython as the oracle of what the correct behaviour is. I am running some tests that I used to clarify the behavior from decades ago, in this case I wanted to know when exactly the i... | d87e7f35297d34755026173d84a38eedfbed78de | bc0b94b30c9d65ba550daee2c2ef20035defd980 |
python/cpython | python__cpython-127668 | # Improve error-branches of `hashlib`
# Bug report
### Bug description:
While reading the hashlib code, I found some issues in the error branches where the `EVP_MD_ctx` is not freed upon failure or when we call `py_digest_name` with a NULL `EVP_MD *`.
@gpshead Should I consider this as a security issue? (some place... | 097846502b7f33cb327d512e2a396acf4f4de46e | 7e3b788e8f3dc986bcccb047ddc3f0a7a99bb08c |
python/cpython | python__cpython-127656 | # `_SelectorSocketTransport.writelines` is missing a flow control check allowing writes to fill memory until exhausted
# Bug report
### Bug description:
This is the public issue for GHSA-fw89-6wjj-8j95
### CPython versions tested on:
3.12
### Operating systems tested on:
Linux, macOS
<!-- gh-linked-prs -->
##... | e991ac8f2037d78140e417cc9a9486223eb3e786 | 25eee578c8e369b027da6d9d2725f29df6ef1cbd |
python/cpython | python__cpython-127704 | # Drop `--wasi preview2` from `wasi.py`
# Bug report
### Bug description:
Need to remove
https://github.com/python/cpython/blob/23f2e8f13c4e4a34106cf96fad9329cbfbf8844d/Tools/wasm/wasi.py#L300-L301
as we only officially support preview1.
### CPython versions tested on:
CPython main branch
### Operating systems ... | 0fc4063747c96223575f6f5a0562eddf2ed0ed62 | 5b6635f772d187d6049a56bfea76855644cd4ca1 |
python/cpython | python__cpython-127660 | # Regression of 3.13.1 for module paths in from import
# Bug report
### Bug description:
```python
import os
print("FILE", os.__file__, os.__spec__)
def localImportFailure():
try:
from os import listdir, listdir2, path
except Exception as e:
print("gives", type(e), repr(e))
print("From imp... | 45e6dd63b88a782f2ec96ab1da54eb5a074d8f4c | daa260ebb1c1b20321e7f26df7c9dbd35d4edcbf |
python/cpython | python__cpython-127648 | # Add simple `Reader` and `Writer` protocols
# Feature or enhancement
### Proposal:
See the [discourse thread](https://discuss.python.org/t/simple-reader-and-writer-protocols/61510) for the rationale.
### Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
### Li... | c6dd2348ca61436fc1444ecc0343cb24932f6fa7 | 9c691500f9412ecd8f6221c20984dc7a55a8a9e8 |
python/cpython | python__cpython-127759 | # Add tests for `dis` command-line interface
The `dis` CLI (added in 3.10 or so) is lacking tests. I'll be writing them tomorrow or tonight, depending on when I'm done with my IRL tasks.
I think we can backport tests for all command-line options that were introduced in previous versions (up to 3.12) and only write ... | e85f2f1703e0f79cfd0d0e3010190b71c0eb18da | 5eb7fd4d0fc37b91058086181afebec41e66e5ad |
python/cpython | python__cpython-127683 | # Emscripten: Add ctypes to the Emscripten build
<!-- gh-linked-prs -->
### Linked PRs
* gh-127683
<!-- /gh-linked-prs -->
| 3b18af964da9814474a5db9e502962c7e0593e8d | 5c89adf385aaaca97c2ee9074f8b1fda0f57ad26 |
python/cpython | python__cpython-127628 | # Emscripten: Add function to add JS breakpoint
For debugging the Python test suite on the Emscripten platform, it's quite useful to be able to inject a breakpoint for the JavaScript debugger in Python code. This is particularly helpful when debugging problems with the file system -- the code paths I want to inspect a... | 25eee578c8e369b027da6d9d2725f29df6ef1cbd | 8b3cccf3f9508572d85b0044519f2bd5715dacad |
python/cpython | python__cpython-128503 | # configure is checking for `ttyname` but code is using `ttyname_r`
# Bug report
### Bug description:
PR https://github.com/python/cpython/pull/14868 by @chibby0ne changed the code to use `ttyname_r` but the `configure` script is checking for `ttyname`.
There are some old systems, such as OSX Tiger, that don'... | e08b28235a863323ca3a7e444776bb7803e77caf | 07e6aa2efc5b2c7ecbbdb41636013c64e335a2ba |
python/cpython | python__cpython-127657 | # No validation on erroneous creation of 2 or more parameter variables (VAR_KEYWORD and VAR_POSITIONAL) in inspect.Signature
# Bug report
### Bug description:
We can create `inspect.Signature` with two or more variable parameters, but this will be syntactically incorrect when defining the function manually:
```... | 1503fc8f88d4903e61f76a78a30bcd581b0ee0cd | 70154855cf698560dd9a5e484a649839cd68dc7c |
python/cpython | python__cpython-128159 | # Add a way of printing a C backtrace to `faulthandler`
# Feature or enhancement
### Proposal:
The `faulthandler` module allows registering a `SIGSEGV` handler to print a Python stacktrace if the program encounters a segfault. However, if developing C/C++ extension modules that may not be particularly useful on its ... | 8dfa840773d1d6bae1bf6e0dfa07618ea10c9d71 | ea8ec95cfadbf58a11ef8e41341254d982a1a479 |
python/cpython | python__cpython-127717 | # `_Py_RefcntAdd` doesn't increment ref count stats
# Bug report
### Bug description:
Hi,
I am unsure if this intentional or not so apologies if this turns out not to be a bug.
The code for `_Py_RefcntAdd` does not include `_Py_INCREF_STAT_INC`. This appears to mean the statistics do not track these addit... | ab05beb8cea62636bd86f6f7cf1a82d7efca7162 | 7900a85019457c14e8c6abac532846bc9f26760d |
python/cpython | python__cpython-127587 | # `multiprocessing.Pool` does not properly restore blocked signals
# Bug report
### Bug description:
When instantiating a `multiprocessing.Pool`, for start methods "spawn" and "forkserver", the resource tracker must register a signal mask in the parent process to block some signals prior to creating the spawned chil... | 1d276ec6f8403590a6a1a18c560ce75b9221572b | e4981e33b82ac14cca0f2d9b95257301fa201810 |
python/cpython | python__cpython-127612 | # Non-thread-safe use of `Py_SET_REFCNT` in destructors
# Bug report
When calling finalizers from dealloc, we temporarily increase the refcount with `Py_SET_REFCNT` and then decrease it again (also with `Py_SET_REFCNT`). This isn't thread-safe in the free threading build because some other thread may concurrently try... | f4f530804b9d8f089eba0f157ec2144c03b13651 | 657d0e99aa8754372786120d6ec00c9d9970e775 |
python/cpython | python__cpython-127568 | # UBSan: misaligned memory loads in `Objects/dictobject.c`
# Bug report
`clang` 18+'s [undefined behavior sanitizer](https://devguide.python.org/development-tools/clang/) reports two cases of misaligned load:
```
Objects/unicodeobject.c:5088:24: runtime error: load of misaligned address 0x0000008b74be for type 'const... | 9af96f440618304e7cc609c246e1f8c8b2d7a119 | cef0a90d8f3a94aa534593f39b4abf98165675b9 |
python/cpython | python__cpython-127564 | # Remove `TODO` comment in `_pydatetime._isoweek1monday`
# Feature or enhancement
### Proposal:
According to the existing note `# XXX This could be done more efficiently`, the `_isoweek1monday` function can be improved.
### Current Implementation:
```python
def _isoweek1monday(year):
# Helper to calculate the ... | e8b6b39ff707378da654e15ccddde9c28cefdd30 | 8ade15343d5daec3bf79ff7c47f03726fb2bcadf |
python/cpython | python__cpython-127590 | # Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns
found a comment in _strptime.py that I believe is unnecessary and potentially outdated:
https://github.com/python/cpython/blob/8c3fd1f245fbdc747966daedfd22ed48491309dc/Lib/_strptime.py#L304
The comment reads:
`# XXX: Does 'Y' n... | 51cfa569e379f84b3418db0971a71b1ef575a42b | 6bc3e830a518112a4e242217807681e3908602f4 |
python/cpython | python__cpython-127765 | # Update os.walk example to avoid .git subdirs instead of CVS subdirs
# Documentation
While historically humorous or painful (depending on your experience), the os.walk example shows how to avoid CVS directories. someone could update this to be more practically modern and avoid .git subdirectories. https://docs.p... | a5949986d631391d37b1b329ad8badcf2000f9a9 | 9c1e85fd64cf6a85f7c96390d7b2dfad03a76944 |
python/cpython | python__cpython-127580 | # Free threading locking issues in `listobject.c`
# Bug report
In https://github.com/python/cpython/pull/127524, @mpage suggested adding an assert to check that the list object is locked when calling `ensure_shared_on_resize`. This uncovers a few more locking issues.
Additionally, we may return out of the critical s... | e51da64ac3bc6cd45339864db32d05115af39ead | 51cfa569e379f84b3418db0971a71b1ef575a42b |
python/cpython | python__cpython-127532 | # asyncio's `BaseSelectorEventLoop._accept_connection` `return`s when it should `continue` on `ConnectionAbortedError`
# Bug report
### Bug description:
PR incoming! It's a 10 second fix.
## TLDR
`BaseSelectorEventLoop._accept_connection` incorrectly `return`s early from its `for _ in range(backlog)` loop when `ac... | 830e10651b1f45cd0af36ff611397b9f53171220 | bb2dfadb9221fa3035fda42a2c153c831013e3d3 |
python/cpython | python__cpython-127525 | # Document `start_response` parameters in `wsgiref` functions
# Bug report
### Bug description:
The [example WSGI server in the documentation](https://docs.python.org/3/library/wsgiref.html#examples) sets the headers as a list in the simple_app function.
```python
from wsgiref.simple_server import make_server
def... | 39ba4b6619026bbe65c5844702a8a0bb6e75c4f7 | f8eefc2f35c002b6702990add7f33d445977de8d |
python/cpython | python__cpython-127524 | # [Free Threading] test_opcache: test_binary_subscr_list_int(): list_get_item_ref: Assertion `cap != -1 && cap >= size' failed
test_binary_subscr_list_int() does crash randomly with an assertion error if Python is built with ``--disable-gil``:
```
$ ./python -m test test_opcache -v -m test_binary_subscr_list_int -... | c7dec02de2ed4baf3cd22ad094350265b52c18af | c4303763dac4494300e299e54c079a4a11931a55 |
python/cpython | python__cpython-127526 | # `--enable-pystats` build fails on main
# Bug report
### Bug description:
```
Python/specialize.c: In function ‘store_subscr_fail_kind’:
Python/specialize.c:1821:50: error: ‘PyObject’ {aka ‘struct _object’} has no member named ‘tp_as_mapping’
1821 | PyMappingMethods *as_mapping = container_type->tp_as_mapping;... | edefb8678a11a20bdcdcbb8bb6a62ae22101bb51 | c7dec02de2ed4baf3cd22ad094350265b52c18af |
python/cpython | python__cpython-127506 | # Emscripten: Make python.sh function as proper Python CLI
There are several problems with `python.sh` right now:
1. It doesn't work correctly on macs with bsd coreutils
2. It doesn't mount the native file system into the Emscripten file system, so `python.sh /some/file.py` will fail to find the file
3. It doesn't ... | 87faf0a9c4aa7f8eb5b6b6c8f6e8f5f99b1e3d9b | 43634fc1fcc88b35171aa79258f767ba6477f764 |
python/cpython | python__cpython-135294 | # Reconsider XML Security warnings / obsolete vulnerabilities
# Documentation
The documentation for the xml.etree.ElementTree API contains the following stark warning:
*Warning: The [xml.etree.ElementTree](https://docs.python.org/3/library/xml.etree.elementtree.html#module-xml.etree.ElementTree) module is not secu... | cb99d992774b67761441e122965ed056bac09241 | d05423a90ce0ee9ad5207dce3dd06ab2397f3d6e |
python/cpython | python__cpython-132294 | # Preserve command-line history after interpreter crash
When the CPython interpreter crashes - recent history entries are lost. An easy reproducer (on any Linux):
```
$ ulimit -v $((1024*256))
$ pip install -q gmpy2
$ python # started with empty history
Python 3.14.0a2+ (heads/main:e2713409cf, Dec 2 2024, 07:50:36)... | 276252565ccfcbc6408abcbcbe6af7c56eea1e10 | 614d79231d1e60d31b9452ea2afbc2a7d2f0034b |
python/cpython | python__cpython-127482 | # Add `EPOLLWAKEUP` to the select module
# Feature or enhancement
### Proposal:
This issue suggests adding new select constants.
for example
```
fd = /* a socket object */
p = /* a epoll object */
/* It will prevent the system from hanging (e.g. low-power or standby) */
p.register(fd, EPOLLWAKEUP)
```
... | 6bc3e830a518112a4e242217807681e3908602f4 | bc0f2e945993747c8b1a6dd66cbe902fddd5758b |
python/cpython | python__cpython-127494 | # pathlib ABCs: add protocols for supporting types
# Feature or enhancement
For typing and documentation purposes, it would be useful to define three protocols in pathlib:
- `Parser`: like `os.path`, but including only pure functionality that's essential for `PurePathBase`
- This [already exists](https://gith... | 5c89adf385aaaca97c2ee9074f8b1fda0f57ad26 | e85f2f1703e0f79cfd0d0e3010190b71c0eb18da |
python/cpython | python__cpython-127575 | # iOS `clang` aliases crash with "invalid directory name" error if called with arguments having spaces
# Bug report
### Bug description:
While doing cross-compilation of Python packages for iOS calling [`arm64-apple-ios-clang`](https://github.com/python/cpython/blob/main/iOS/Resources/bin/arm64-apple-ios-clang) scri... | 6cf77949fba7b44f6885794b2028f091f42f5d6c | 87faf0a9c4aa7f8eb5b6b6c8f6e8f5f99b1e3d9b |
python/cpython | python__cpython-127430 | # sysconfig data is generated with the host Python's Makefile when cross-compiling
# Bug report
### Bug description:
Currently, the POSIX sysconfig data is generated with the `Makefile` from the host interpreter, instead of the target. This results in incorrect data, as demonstrated by https://github.com/python/cpyt... | 2950bc50af8fc2539e64731359bfb39b335a614d | e2713409cff5b71b1176b0e3fa63dae447548672 |
python/cpython | python__cpython-127549 | # `test_start_new_thread_failed` flaky: failed on macOS (free threading)
# Bug report
Seen in https://github.com/python/cpython/actions/runs/12082953758/job/33695120037?pr=127399
```
======================================================================
FAIL: test_start_new_thread_failed (test.test_threading.ThreadT... | 13b68e1a61e92a032d255aff5d5af435bbb63e8b | 0cb52220790d8bc70ec325fd89d52b5f3b7ad29c |
python/cpython | python__cpython-127433 | # AIX build broken with Illegal instruction
# Bug report
### Bug description:
AIX build is broken with Illegal instruction after this merge https://github.com/python/cpython/pull/126025
./_bootstrap_python ./Programs/_freeze_module.py abc ./Lib/abc.py Python/frozen_modules/abc.h
./_bootstrap_python ./Programs/_fre... | 7043bbd1ca6f0d84ad2211dd60114535ba3d51fc | 49f15d8667e4755876698a8daa13bab6acee5fa1 |
python/cpython | python__cpython-127414 | # Allow to show specialized bytecode via `dis` CLI
# Feature or enhancement
### Proposal:
It's already possible to show specialized bytecode using `dis.dis(code, adaptive=True)` but it's not possible to do it from the CLI. I think we can add a flag `-S` that does it (most of the other flags are exposed to the CLI).
... | 67b9a5331ae45aa126877d7f96a1e235600f9c4b | fcbe6ecdb6ed4dd93b2ee144f89a73af755e2634 |
python/cpython | python__cpython-127466 | # invalid conversion from ‘void*’ to ‘_PyCodeArray*’ found in internal headers when compiling with Python 3.14t
# Bug report
### Bug description:
Cross-reporting from ~~scipy/scipy#21968~~ scipy/scipy#21970
Installing scipy from git with the free-threaded interpreter yielded the following errors:
```
[65/... | c4303763dac4494300e299e54c079a4a11931a55 | c46acd3588864e97d0e0fe37a41aa5e94ac7af51 |
python/cpython | python__cpython-127386 | # Add `F_DUPFD_QUERY` to `fcntl`
# Feature or enhancement
### Proposal:
It's used to query and copy a target file descriptor. for example:
```
import fcntl
f = /* open a file */;
/* 'ret' must be greater equal than 5 */
ret = fcntl.fcntl(fd, F_DUPFD_QUERY, 5);
```
### Has this already been discussed... | 8e18a9dce2af361d9974812e6ffa22bf3970d057 | eef49c359505eaf109d519d39e53dfd3c78d066a |
python/cpython | python__cpython-127382 | # pathlib ABCs: prune PathBase interface
It's time to make some difficult decisions about which methods deserve to stay in the `pathlib._abc.PathBase` interface, and which ought to be made `pathlib.Path`-only. Guidelines:
- Compare to `zipfile.Path` and `os.DirEntry`; don't evict shared methods.
- Include abstract... | 38264a060a8178d58046e90e9beb8220e3c22046 | 15d6506d175780bb29e5fcde654e3860408aa93e |
python/cpython | python__cpython-127372 | # Unbounded growth in `SpooledTemporaryFile.writelines()`
# Bug report
### Bug description:
`SpooledTemporaryFile` provides a temporary file backed by a buffer in memory that spills over to disk when it gets too large. However, the `writelines()` method only checks whether it should roll over after the entire lines ... | cb67b44ca92f9930b3aa2aba8420c89d12a25303 | 691354ccb04f0e8f4faa864ee5003fc5efe8377e |
python/cpython | python__cpython-127365 | # macOS CI is failing for 3.13 due to Tcl/Tk 9 on Homebrew
# Bug report
### Bug description:
The recent builds on the 3.13 and 3.12 branches are failing for macos-13 (and 3.11 and earlier likely will as well):
* https://github.com/python/cpython/actions/workflows/build.yml?query=branch%3A3.13
* https://github.com/p... | b83be9c9718aac42d0d8fc689a829d6594192afa | 20657fbdb14d50ca4ec115da0cbef155871d8d33 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.