cpython
cpython copied to clipboard
The Python programming language
# Bug report ### Bug description: Description: When using pdb through pytest (or any tool that passes stdin explicitly), arrow key history doesn't work even when stdin is a real...
- Update SimpleQueue.__sizeof__() to include the memory used by its internal buffer. - add a unit test. Please let me know if my approach or fix needs any improvements ....
PyObject_GetBuffer() can execute user code (e.g. via __buffer__), which may close or otherwise mutate a BytesIO object while write() or writelines() is in progress. This could invalidate the internal buffer...
### What happened? `_io.BytesIO.writelines` pulls buffers from each iterable element inside `write_bytes_lock_held`, but a crafted object can close the target in `__buffer__`, freeing `self->buf` while the write path still runs,...
Document the following items listed in `__all__` but missing from documentation: - `distributions()`: mentioned in doc strings as well - `DistributionFinder`: mentioned but didn't have it's own :class: entry -...
(cherry picked from commit 9609574e7fd36edfaa8b575558a82cc14e65bfbc) Co-authored-by: Bénédikt Tran * Issue: gh-143309
### What happened? `BufferedWriter.seek` asks the offset object for `__index__` before it flushes pending bytes, so a crafted type can close the writer during that conversion, leaving the buffered write...
### What happened? `cursor.execute` treats non-dict parameters as sequences and calls `PySequence_Size`, so a crafted object can close the connection inside `__len__` and clear `self->connection->db`. The cursor continues using that...
# Bug report ### Bug description: ## Python 3.14.2 ```pycon >>> from importlib import metadata >>> d = metadata.PathDistribution.at('/tmp') >>> d.requires >>> d.requires is None True ``` ## Python 3.15.0a3...
### What happened? `Struct.pack()` iterates over `soself->s_codes`. For `'?'`, `np_bool` calls `PyObject_IsTrue(arg)`, which can run user `__bool__`. A re-entrant `__bool__` that calls `Struct.__init__()` rebuilds the format and frees the old...