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-114686 | # `_imp.get_frozen_object` possible incorrect use of `PyBUF_READ`
# Bug report
It is documented that `PyBUF_READ` should be used with `memoryview` objects. But, it is used in `PyObject_GetBuffer`:
https://github.com/python/cpython/blob/5ecfd750b4f511f270c38f0d748da9cffa279295/Python/import.c#L3547
Other similar pla... | 1ac1b2f9536a581f1656f0ac9330a7382420cda1 | 2124a3ddcc0e274521f74d239f0e94060e17dd7f |
python/cpython | python__cpython-114683 | # Incorrect deprecation warning for 'N' specifier
# Bug report
### Bug description:
In the main branch, the following warning is issued whenever a fill character (possibly utf-8) either is 'N' or contains 'N':
```
>>> from _decimal import *
>>> Decimal("0").__format__("N<g")
<stdin>-2:1: DeprecationWarning: Format ... | aa3402ad451777d8dd3ec560e14cb16dc8540c0e | 0cd9bacb8ad41fe86f95b326e9199caa749539eb |
python/cpython | python__cpython-114672 | # `_testbuffer.c`'s initialization does not handle errors
# Bug report
I found three problematic places:
https://github.com/python/cpython/blob/a768e12f094a9b14a9a1680fb50330e1050716c4/Modules/_testbuffer.c#L2841-L2844
Here the first `AttributeError` can be swallowed by the second one.
https://github.com/p... | 3a5b38e3b465e00f133ff8074a2d4afb1392dfb5 | 33f56b743285f8419e92cfabe673fa165165a580 |
python/cpython | python__cpython-114681 | # Add IndexError to tutorial datastructures list.pop doc
Documentation
In the [Datastructures](https://github.com/python/cpython/blob/main/Doc/tutorial/datastructures.rst?plain=1#L47-L54) tutorial, the `remove` and `index` methods mention that an `IndexError` may be raised.
The tutorial is not intended to be an ... | 57c3e775df5a5ca0982adf15010ed80a158b1b80 | 586057e9f80d57f16334c0eee8431931e4aa8cff |
python/cpython | python__cpython-115005 | # Display cvs.Error without TypeError context
# Bug report
### Bug description:
Working my way through some documentation nits for the `csv` module, I noticed this method definition:
```
def _validate(self):
try:
_Dialect(self)
except TypeError as e:
# We do this for comp... | e207cc181fbb0ceb30542fd0d68140c916305f57 | 391659b3da570bfa28fed5fbdb6f2d9c26ab3dd0 |
python/cpython | python__cpython-114627 | # Expose unprefixed variants of `_PyCFunctionFast` and `_PyCFunctionFastWithKeywords`
`METH_FASTCALL` is documented as part of the stable API since Python 3.10.
The accompanying function pointer typedefs `_PyCFunctionFast` and `_PyCFunctionFastWithKeywords` have leading underscore names, which I understand to hint ... | 9e3729bbd77fb9dcaea6a06ac760160136d80b79 | 32f8ab1ab65c13ed70f047ffd780ec1fe303ff1e |
python/cpython | python__cpython-120033 | # 3.13 dis: the show_caches argument is deprecated but the documentation is incomplete
# Documentation
show_caches was deprecated in 3.13 for dis.get_instructions.
The documentation misses the following things:
## get_instructions:
The documentation says:
> The show_caches parameter is deprecated and has no... | 770f3c1eadd3392c72fd55be47770234dd143a14 | 69b3e8ea569faabccd74036e3d0e5ec7c0c62a20 |
python/cpython | python__cpython-114612 | # `pathlib.PurePath.with_stem('')` promotes file extension to stem
# Bug report
```python
>>> pathlib.PurePath('foo.jpg').with_stem('').stem
'.jpg'
```
The `with_stem()` call should raise `ValueError`, as it's impossible for a filename to have an empty stem and a non-empty suffix.
<!-- gh-linked-prs -->
### Linked ... | e3dedeae7abbeda0cb3f1d872ebbb914635d64f2 | 53c5c17e0a97ee06e511c89f1ca6ceb38fd06246 |
python/cpython | python__cpython-116513 | # Rename `pathlib.PurePath.pathmod`
# Feature or enhancement
In #100502 we added a `pathmod` attribute that points to either `posixpath` or `ntpath`, and supplies low-level lexical manipulation functions used by `PurePath`.
The name "pathmod" implies the value is a module, and while that's true in `PurePath` and... | 752e18389ed03087b51b38eac9769ef8dfd167b7 | bfc57d43d8766120ba0c8f3f6d7b2ac681a81d8a |
python/cpython | python__cpython-114573 | # ssl: Fix locking in cert_store_stats and get_ca_certs
# Bug report
### Bug description:
Filing this to attach a PR to.
cert_store_stats and get_ca_certs query the SSLContext's X509_STORE with X509_STORE_get0_objects, but reading the result requires a lock. See https://github.com/openssl/openssl/pull/23224 for det... | bce693111bff906ccf9281c22371331aaff766ab | 58cb634632cd4d27e1348320665bcfa010e9cbb2 |
python/cpython | python__cpython-114574 | # Do not allocate non-PyObjects with PyObject_Malloc()
# Feature or enhancement
The free-threaded build requires that Python objects -- and only Python objects -- be allocated through the Python object allocation APIs (like `PyObject_Malloc()` or `PyType_GenericNew()`) [^1].
There are a few places internally [^2] t... | dcd28b5c35dda8e2cb7c5f66450f2aff0948c001 | d0f7f5c41d71758c59f9372a192e927d73cf7c27 |
python/cpython | python__cpython-114879 | # Possible memory leak in _cdecimal.c with 'z' format
# Bug report
### Bug description:
See https://mail.python.org/archives/list/python-announce-list@python.org/thread/DHZROL7YYJZTPWJQ3WME4HI3Z65K2H4F/
This feature was originally implemented in https://github.com/python/cpython/pull/30049
I have not verified the ... | 72340d15cdfdfa4796fdd7c702094c852c2b32d2 | 235cacff81931a68e8c400bb3919ae6e55462fb5 |
python/cpython | python__cpython-114565 | # ``test_winconsoleio`` prints unnecessary information
# Bug report
### Bug description:
```python
./python -m test -v test_winconsoleio
Running Debug|x64 interpreter...
== CPython 3.13.0a3+ (heads/main:07ef63fb6a, Jan 25 20... | 33ae9895d4ac0d88447e529038bc4725ddd8c291 | d96358ff9de646dbf64dfdfed46d510da7ec4803 |
python/cpython | python__cpython-114662 | # Must `object.__dir__` return a sequence of `str`, or is any iterable OK?
According to the documentation [`__dir__` must return a `Sequence`](https://docs.python.org/3/reference/datamodel.html#object.__dir__), but e.g. typeshed's annotations currently imply that any iterable will do:
```py
class object:
def ... | e19103a346f0277c44a43dfaebad9a5aa468bf1e | b2d9d134dcb5633deebebf2b0118cd4f7ca598a2 |
python/cpython | python__cpython-117996 | # [doc] subprocess security considerations needs a Windows-specific exception
The documentation at https://docs.python.org/3/library/subprocess.html#security-considerations says that "this implementation will never implicitly call a system shell".
While this is technically true, on Windows the underlying CreateProc... | a4b44d39cd6941cc03590fee7538776728bdfd0a | 353ea0b273b389e075b2ac9687d3e27467b893cd |
python/cpython | python__cpython-114513 | # test_embed failures after switching configure options due to missing Makefile dependencies
# Bug report
### Bug description:
`test_embed` started failing for me recently on free threaded builds on both M1 Mac and Ubuntu (Intel). `git bisect` narrowed it down to a suspect commit. @colesbury this is probably for you... | 2afc7182e66635b3ec7efb59d2a6c18a7ad1f215 | 60375a38092b4d4dec9a826818a20adc5d4ff2f7 |
python/cpython | python__cpython-114495 | # New test_termios fails on Alpinelinux
# Bug report
### Bug description:
As reported https://github.com/python/cpython/issues/81002#issuecomment-1904867665 where the test was added
I'm upgrading Python in Alpinelinux to 3.11.7 and testing upgrade to 3.12.1 (both fails the same test)
```
Re-running test_termios in... | d22c066b802592932f9eb18434782299e80ca42e | ce01ab536f22a3cf095d621f3b3579c1e3567859 |
python/cpython | python__cpython-114491 | # Add support for Mach-O linkage detection in Lib/platform.py
# Feature or enhancement
### Proposal:
Proposed behaviour on MacOS.
```python
>>> import platform
>>> platform.architecture()
('64bit', 'Mach-O')
```
Current behaviour as tested with Python 3.11.7 on `24.05.20240115.e062961+darwin4.44a6ec1`.
```python
... | b5c7c84673b96bfdd7c877521a970f7a4beafece | 07236f5b39a2e534cf190cd4f7c73300d209520b |
python/cpython | python__cpython-114558 | # logging docstrings should use bool instead of int for exc_info
The documentation passes an integer as the `exc_info` parameter:
https://github.com/python/cpython/blob/8edc8029def8040ebe1caf75d815439156dd2124/Lib/logging/__init__.py#L1496
But the annotation doesn't allow that.
https://github.com/python/types... | 07236f5b39a2e534cf190cd4f7c73300d209520b | df17b5264378f38f49b16343b5016a8882212a8a |
python/cpython | python__cpython-117778 | # Misleading comment "heap.sort() maintains the heap invariant"
# Documentation
In the fourth paragraph of the documentation says:
"""
These two make it possible to view the heap as a regular Python list without surprises: heap[0] is the smallest item, and heap.sort() maintains the heap invariant!
"""
This seem... | 37a4cbd8727fe392dd5c78aea60a7c37fdbad89a | c2a551a30b520e520b084eec251f168549e1a3f0 |
python/cpython | python__cpython-114457 | # Lower the recursion limit under pydebug WASI
# Bug report
Setting it to 150 allows hitting `RecursionError` instead of having the WASI host like wasmtime trigger its stack depth protections.
<!-- gh-linked-prs -->
### Linked PRs
* gh-114457
<!-- /gh-linked-prs -->
| f59f90b5bccb9e7ac522bc779ab1f6bf11bb4aa3 | afe8f376c096d5d6e8b12fbc691ca9b35381470b |
python/cpython | python__cpython-114449 | # [dev convenience] Compared histograms in summarize_stats.py output should not be sorted
# Bug report
### Bug description:
When comparing two pystats results, currently the tables that compare two histograms are sorted by the amount of change in each row. This is confusing, because the histogram buckets get out of... | e45bae7a45e5696c3ebdf477ecc948374cf8ebff | 5cd9c6b1fca549741828288febf9d5c13293847d |
python/cpython | python__cpython-114571 | # Windows: test_os.test_stat_inaccessible_file() fails if run as an administrator
When test_os is run as an administrator, like running tests in a SSH shell for example, the test fails:
```
FAIL: test_stat_inaccessible_file (test.test_os.Win32NtTests.test_stat_inaccessible_file)
----------------------------------... | d91ddff5de61447844f1dac575d2e670c8d7e26b | 102569d150b690efe94c13921e93da66081ba1cf |
python/cpython | python__cpython-114424 | # Remove DummyThread from threading._active when thread dies
# Feature or enhancement
### Proposal:
This has bothered me quite a bit already: If some code calls threading.current_thread() in a thread that’s not created from the threading module it lingers at threading._active forever (or until another thread wit... | 5a1ecc8cc7d3dfedd14adea1c3cdc3cfeb79f0e1 | 7d21cae964fc47afda400fc1fbbcf7984fcfe819 |
python/cpython | python__cpython-114415 | # `_threadmodule` does not check for `NULL` after `PyType_GetModuleByDef` calls
# Bug report
`PyType_GetModuleByDef` can return `NULL`: https://github.com/python/cpython/blob/fd49e226700e2483a452c3c92da6f15d822ae054/Objects/typeobject.c#L4640-L4645
I think that right now this is a hypothetical issue, because in prac... | d1b031cc58516e1aba823fd613528417a996f50d | 650f9e4c94711ff49ea4e13bf800945a6147b7e0 |
python/cpython | python__cpython-114393 | # Improve test_capi.test_structmembers
`test_capi.test_structmembers` tests writing and reading attributes that represent C struct members (defined via `PyMemberDef`). But for most types it only tests 1 or 2 valid values, and maybe yet 1 or 2 values that trigger a RuntimeWarning, for some types. It does not test integ... | 15f6f048a6ecdf0f6f4fc076d013be3d110f8ed6 | 929d44e15a5667151beadb2d3a2528cd641639d6 |
python/cpython | python__cpython-114391 | # Incorrect warning when assign an unsigned integer member
Assigning a negative value to an unsigned integer member can emit a RuntimeWarning.
```pycon
$ ./python -Wa
>>> import _testcapi
>>> ts = _testcapi._test_structmembersType_NewAPI()
>>> ts.T_UBYTE = -42
<stdin>:1: RuntimeWarning: Truncation of value to un... | d466052ad48091a00a50c5298f33238aff591028 | 7e42fddf608337e83b30401910d76fd75d5cf20a |
python/cpython | python__cpython-114385 | # `sys.set_asyncgen_hooks` docs are not correct about its signature
# Bug report
Refs https://github.com/python/cpython/pull/103132#discussion_r1448716543
The signature is `set_asyncgen_hooks(firstiter=<unrepresentable>, finalizer=<unrepresentable>)`.
Docs say that it is: `set_asyncgen_hooks(firstiter, finalizer)`
D... | 38768e4cdd1c4b6e03702da8a94e1c22479d6ed3 | 96c15b1c8d03db5b7b5b719214d9d156b317ba9d |
python/cpython | python__cpython-114374 | # Awkward wording in GH-111835 whatsnew entry
# Documentation
"it requires" is a little unclear
```diff
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index 40f0cd37fe..eb00e4ad74 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -259,8 +259,8 @@ mmap
----
* The :class:`mma... | 5ce193e65a7e6f239337a8c5305895cf8a4d2726 | 57c3e775df5a5ca0982adf15010ed80a158b1b80 |
python/cpython | python__cpython-114334 | # Reference to flag variables broken in re.compile() documentation
# Documentation
The #93000 change set inadvertently caused a sentence in re.compile() documentation to no longer make sense. It says "Values can be any of the following variables..." (https://github.com/python/cpython/blob/681e9e85a2c1f72576ddfbd766... | 567a85e9c15a3f7848330ae7bef3de2f70fc9f97 | 1e610fb05fa4ba61a759b68461f1a9aed07622fc |
python/cpython | python__cpython-117326 | # mimalloc should fail to allocate 784 271 641 GiB: test_decimal killed by the Linux kernel with OOM on a Free Threading build
# Bug report
### Bug description:
Hello. When we were updating Python 3.13 from a2 to a3 in Fedora, I wanted to enable the freethreding on s390x and ppc64le, as it was previously disable... | 6702d2bf6edcd5b5415e17837383623b9d76a5b8 | c1712ef066321c01bf09cba3f22fc474b5b8dfa7 |
python/cpython | python__cpython-114504 | # Add `PyList_GetItemRef`, a variant of `PyList_GetItem` that returns a strong reference
# Feature or enhancement
The free-threaded builds need a variant of `PyList_GetItem` that returns a strong reference instead of a borrowed reference for thread-safety reasons. PEP 703 proposed [`PyList_FetchItem`](https://peps.... | d0f1307580a69372611d27b04bbf2551dc85a1ef | 0e71a295e9530c939a5efcb45db23cf31e0303b4 |
python/cpython | python__cpython-114335 | # read1 in cbreak mode returns 0x0D (instead of 0x0A) when <enter> is entered.
# Bug report
### Bug description:
A <i>read1</i> of 'stdin' in cbreak mode returns 0x0D (instead of 0x0A) when \<enter\> is entered.
That is for Python version 3.12.1, version 3.11.6 returns 0x0A.
The following code demonstrates this. Wh... | fd49e226700e2483a452c3c92da6f15d822ae054 | db1c18eb6220653290a3ba9ebbe1df44394a3f19 |
python/cpython | python__cpython-114322 | # Expose more constants in the fcntl module
# Feature or enhancement
See also:
* https://github.com/python/cpython/issues/90179
* https://github.com/python/cpython/issues/99987
* https://github.com/python/cpython/issues/113092
* https://github.com/python/cpython/issues/114061
<!-- gh-linked-prs -->
### Linked PRs
... | 1b719b39b9cd125258739699ac5168d139901b48 | 6d30cbee013b4182937ffa11a7c87d2a7b6b7b41 |
python/cpython | python__cpython-114479 | # TypeError for threading.Lock | None
# Bug report
### Bug description:
I tried to search for a related ticket by various queries but did not find any, hopefully I haven't overlooked it.
While rewriting a codebase from `Optional[foo]` to the newer `foo | None` style, I encountered that `threading.Lock` does n... | d96358ff9de646dbf64dfdfed46d510da7ec4803 | b52fc70d1ab3be7866ab71065bae61a03a28bfae |
python/cpython | python__cpython-114493 | # Add stats for "unlikely events" that will impact optimization.
Events such as using changing the `__code__` attribute of a function, or the `__bases__` of a class, are rare.
At least we presume that they are rare.
We want to optimize code with the assumption that they are rare (see See https://github.com/faster-cp... | ea3cd0498c443e93be441736c804258e93d21edd | c63c6142f9146e1e977f4c824c56e8979e6aca87 |
python/cpython | python__cpython-114287 | # Warning: `Modules/_io/fileio.c:175:9: warning: ‘exc’ may be used uninitialized [-Wmaybe-uninitialized]`
# Bug report
This code produces a warning:
https://github.com/python/cpython/blob/a34e4db28a98904f6c9976675ed7121ed61edabe/Modules/_io/fileio.c#L160-L176
Link: https://buildbot.python.org/all/#/builders/1061/b... | 05e47202a34e6ae05e699af1083455f5b8b59496 | a34e4db28a98904f6c9976675ed7121ed61edabe |
python/cpython | python__cpython-114282 | # `asyncio.staggered` has incorrect type hints
# Bug report
Correct ones: https://github.com/python/typeshed/blob/8885cc870cc1089cba30a6ac6d4ea1e32c83cedb/stdlib/asyncio/staggered.pyi
There are several major problems:
1. `loop: events.AbstractEventLoop = None`, relies on very old mypy behaviour
2. `coro_fns: typing.... | 0554a9594e07f46836a58795c9d9af2a97acec66 | 1d6d5e854c375821a64fa9c2fbb04a36fb3b9aaa |
python/cpython | python__cpython-114451 | # Test failures on Windows ARM64 install
Ran the test suite on an installed ARM64 machine and saw the errors below.
This is mostly a note-to-self to come back to this, but if anyone else wants to jump in and fix a test or two (I think they're mostly obvious what's gone wrong), feel free. I'm including the skipped t... | c63c6142f9146e1e977f4c824c56e8979e6aca87 | d5c21c12c17b6e4db2378755af8e3699516da187 |
python/cpython | python__cpython-114839 | # Make `_threadmodule.c` thread-safe in `--disable-gil` builds
# Feature or enhancement
### Proposal:
Make the functionality in `_threadmodule.c` thread-safe in free-threaded builds.
Commits from nogil-3.12: https://github.com/colesbury/nogil-3.12/commits/nogil-3.12/Modules/_threadmodule.c
Context from @colesbury:... | 33da0e844c922b3dcded75fbb9b7be67cb013a17 | 86bc40dd414bceb3f93382cc9f670936de9d68be |
python/cpython | python__cpython-114267 | # The compiler's line number propagation algorithm is not quite correct
# Bug report
The compiler's algorithm for line propagation has some heuristics which are not quite correct (particularly the `guarantee_lineno_for_exits`, which tidies up loose ends by assigning a possible incorrect line number). Also, line numbe... | 7e49f27b41d5728cde1f8790586d113ddc25f18d | efb81a60f5ce7e192095230a0f7ff9684d6f835a |
python/cpython | python__cpython-114266 | # Optimize performance of copy.deepcopy by adding a fast path for atomic types
# Feature or enhancement
### Proposal:
The performance of `copy.deepcopy` can be improved by adding a fast path for the atomic types. This will reduce the overhead of checking the `memo` and the overhead of calling the dispatch method fro... | 9d6604222e9ef4e136ee9ccfa2d4d5ff9feee976 | 225aab7f70d804174cc3a75bc04a5bb1545e5adb |
python/cpython | python__cpython-114394 | # [`ctypes`][`linux`] `ctypes.util.find_library()` crash instead of return None
# Bug report
### Bug description:
# The problem:
`ctypes.util.find_library()` raises an exception on certain inputs when it cannot find it.
# Expected behavior:
No exception, return `None` as [advertised](https://docs.python... | 7fc51c3f6b7b13f88480557ff14bdb1c049f9a37 | ed30a3c337f30abd2ea5357565a956ed3dc0719c |
python/cpython | python__cpython-114450 | # Enumerate pip's vendored dependencies in SBOM
# Bug report
### Bug description:
Part of https://github.com/python/cpython/issues/112302
Currently pip's package entry in the SBOM is quite simple, including only itself but not all the vendored projects and their licenses/IDs. See comment from @hroncok on DPO ... | 582d95e8bb0b78bf1b6b9a12371108b9993d3b84 | 456e274578dc9863f42ab24d62adc0d8c511b50f |
python/cpython | python__cpython-114242 | # ftplib CLI fails to retrieve files
# Bug report
The `ftplib` module has undocumented feature -- a CLI that implements a simple FTP client. It allows listing directories and retrieving files. But retrieving files does not work in Python 3, because it writes binary data to sys.stdout.
It's help is also incomplete an... | 42d72b23dd1ee0e100ee47aca64fc1e1bbe576c9 | 336030161a6cb8aa5b4f42a08510f4383984703f |
python/cpython | python__cpython-114232 | # Fix indentation in enum.rst
# Documentation
There is an indentation error in enum.rst (the second line of the description for "SECOND").
```rst
* ``FIRST = auto()`` will work (auto() is replaced with ``1``);
* ``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` is
used to ... | ba683c22ecd035a1090f9fc7aba48d54854d23bd | 6f4b242a03e521a55f0b9e440703b424ed18ce2f |
python/cpython | python__cpython-114224 | # Deprecated statements in email.message.rst
# Documentation
In https://docs.python.org/3/library/email.message.html
I see:
> Unlike a real dict, there is an ordering to the keys
> in dictionaries there is no guaranteed order to the keys returned by [keys()](https://docs.python.org/3/library/email.message.... | 8cda72037b262772399b2b7fc36dee9340d74fd6 | c1db9606081bdbe0207f83a861a3c70c356d3704 |
python/cpython | python__cpython-114251 | # Rename dataclass's __replace__ argument from "obj" to "self"?
# Bug report
### Bug description:
The first argument of the new `__replace__` method on dataclasses is conspicuously named `obj` rather than `self`. While that's not a bug, it would be kinder on introspection tools to use `self`, since it is otherwise a... | 339fc3c22446a148d27d9ec061594ac8d0abd33d | 9c93350f582fe6f5fed2cd873869dfe4fbf2dfe8 |
python/cpython | python__cpython-114179 | # Tools/build/generate_sbom.py fails in out-of-tree builds
# Bug report
```console
$ pwd
/Users/erlend.aasland/src/python/build-main
$ make regen-all
[...]
python3.13 /Users/erlend.aasland/src/python/main/Tools/build/generate_sbom.py
fatal: not a git repository (or any of the parent directories): .git
Traceback (most... | 7a0ac89b292324b629114a4c49b95fc5a78df7ca | 8cf37f244fa88b4e860e853ecb59b75f3f218191 |
python/cpython | python__cpython-134508 | # `BaseSubprocessTransport.__del__` fails if the event loop is already closed, which can leak an orphan process
# Bug report
### Bug description:
there is a race where it's possible for `BaseSubprocessTransport.__del__` to try to close the transport *after* the event loop has been closed. this results in an unraisab... | 5804ee7b467d86131be3ff7d569443efb0d0f9fd | 8dbc11971974a725dc8a11c0dc65d8f6fcb4d902 |
python/cpython | python__cpython-114160 | # Using NamedTuple with custom Enum
# Documentation
This issue is related to https://github.com/python/cpython/issues/114071 and @ethanfurman suggested creating an isolated issue:
The handling of NamedTuple with a custom Enum is unexpected. Here are two examples that seek to achieve the same thing, but one will ... | 4c7e09d0129dafddba58979ced9580f856f65efa | 945540306c12116154d2e4cc6c17a8efd2290537 |
python/cpython | python__cpython-114124 | # csv module docstring imported from _csv module
# Documentation
While messing around trying to find undocumented module attributes, I noticed that `csv.__all__` contains both `__doc__` and `__version__`. Those inclusions are themselves weird, but I further noticed this:
```
from _csv import Error, __version__,... | 72abb8c5d487ead9eb115fec8132ccef5ba189e5 | 68a7b78cd5185cbd9456f42c15ecf872a7c16f44 |
python/cpython | python__cpython-114117 | # Update documentation of array.array
It still refers to bytes objects as strings in some cases and contains other outdated information.
<!-- gh-linked-prs -->
### Linked PRs
* gh-114117
* gh-114417
* gh-114418
<!-- /gh-linked-prs -->
| 650f9e4c94711ff49ea4e13bf800945a6147b7e0 | fd49e226700e2483a452c3c92da6f15d822ae054 |
python/cpython | python__cpython-114108 | # importlib.metadata test fails on Windows if symlinks aren't allowed
From the AMD64 Windows11 Refleaks 3.x buildbot:
```pytb
test_packages_distributions_symlinked_top_level (test.test_importlib.test_main.PackagesDistributionsTest.test_packages_distributions_symlinked_top_level)
Distribution is resolvable from a si... | c361a1f395de9e508b6e1b0a4c5e69204905a7b7 | ac44ec6206a1e5479effd91e02e2946b94e98ede |
python/cpython | python__cpython-121175 | # Not all generators containing `await` are compiled to async generators
# Documentation
A generator of the form `f(x) for x in await a` first awaits `a` and then creates a regular sync `generator`, as can be seen in the following minimal reproducer:
```py
import asyncio
async def foo():
print("Entered fo... | 91313afdb392d0d6105e9aaa57b5a50112b613e7 | d44c550f7ebee7d33785142e6031a4621cf21573 |
python/cpython | python__cpython-114102 | # Some `PyErr_Format` in `_testcapi` module have invalid argument
# Bug report
### Bug description:
See the upcoming PR for detail.
### CPython versions tested on:
CPython main branch
### Operating systems tested on:
macOS
<!-- gh-linked-prs -->
### Linked PRs
* gh-114102
<!-- /gh-linked-prs -->
| 6c502ba809ff662a5eebf8c6778dec6bd28918fb | 8fd287b18f20f0a310203f574adec196530627c7 |
python/cpython | python__cpython-114889 | # Add support for iOS as a target platform
# Feature or enhancement
### Proposal:
As proposed by [PEP 730](https://peps.python.org/pep-0730/), it should be possible to compile and run CPython on iOS.
This is a meta-issue for the various PRs implementing this support to reference.
For historical reference: this was... | 391659b3da570bfa28fed5fbdb6f2d9c26ab3dd0 | 15f6f048a6ecdf0f6f4fc076d013be3d110f8ed6 |
python/cpython | python__cpython-114089 | # `_winapi.CreateJunction` does not restore privilege levels
Creating a junction requires enabling the `SE_RESTORE_NAME` privilege, which may cause changes in behaviour elsewhere in the process. We should restore it after creating the junction.
<!-- gh-linked-prs -->
### Linked PRs
* gh-114089
* gh-114134
* gh-114135... | de4ced54eb08e8630e3b6c13436d4ecc3fb14708 | 31a2543c80e1e38c97e50533249d9aa00e2f6cae |
python/cpython | python__cpython-114090 | # Reword error message for unawaitable types
# Feature or enhancement
### Proposal:
Currently, attempting to await something that cannot be awaited results in this error message:
```py
import asyncio
async def main():
await 1
asyncio.run(main())
# TypeError: object int can't be used in 'await' expression
```... | 2c7209a3bdf81a289ccd6b80a77497cfcd5732de | a26d27e7ee512cd822b7a7ba075171152779ffdd |
python/cpython | python__cpython-114088 | # Speed up dataclasses._asdict_inner
# Feature or enhancement
### Proposal:
There are several opportunities for speeding up `dataclasses._asdict_inner` (and therefore `asdict`) while maintaining the same underlying logic (including function signature and return values). My in-progress branch has ~18% speedup. Wi... | 2d3f6b56c5846df60b0b305e51a1d293ba0b2aae | 339fc3c22446a148d27d9ec061594ac8d0abd33d |
python/cpython | python__cpython-114408 | # Python/flowgraph.c:497: _Bool no_redundant_jumps(cfg_builder *): Assertion `0' failed.
# Bug report
### Bug description:
Another crash in the compiler found by the fuzzer:
```
~/p/cpython ❯❯❯ ./python.exe -c 'compile("if 9<9<9and 9or 9or 9:9", "", "exec")'
:1: SyntaxWarning: invalid decimal literal
:1: SyntaxWarn... | ed30a3c337f30abd2ea5357565a956ed3dc0719c | a53e56e7d88b4f2a2943c9f191024198009fcf9e |
python/cpython | python__cpython-114079 | # socket.sendfile(): os.sendfile() can fail with OverflowError on 32-bit system
# Bug report
bpo-38319/gh-16491 (PR #82500) tried to fix the use of `os.sendfile()` for larger than 2 GiB files on 32-bit FreeBSD. But it only fixed `socket.sendfile()` for the case when `count` is false. If `count` is not false, `blocksi... | d4dfad2aa9e76038302b0c5a29ebacc2723ed50d | c85c0026a64c2a902138feeb73a9c66af1af31e0 |
python/cpython | python__cpython-114076 | # ``test_compileall`` prints uneccessary information
# Bug report
### Bug description:
Full trace:
```python
./python.exe -m test -R 3:3 test_compileall
Using random seed: 181893785
0:00:00 load avg: 2.79 Run 1 test sequentially
0:00:00 load avg: 2.79 [1/1] test_compileall
beginning 6 repetitions
123456
The stripdi... | 892155d7365c9c4a6c2dd6850b4527222ba5c217 | f8a79109d0c4f408d34d51861cc0a7c447f46d70 |
python/cpython | python__cpython-114871 | # Document tuples and __new__
In this StackOverflow [answer](https://stackoverflow.com/a/77817668/6890912), Ethan Furman, the author of the `enum` module, demonstrated how a tuple value is [special-cased](https://github.com/python/cpython/blob/1709020e8ebaf9bf1bc9ee14d56173c860613931/Lib/enum.py#L256) so that it can b... | ff7588b729a2a414ea189a2012904da3fbd1401c | ec69e1d0ddc9906e0fb755a5234aeabdc96450ab |
python/cpython | python__cpython-114080 | # Floating point syntax specification is incorrect
# Documentation
The floating point syntax spec is incorrect, and can be found in [/Doc/library/functions.rst](https://github.com/python/cpython/blob/main/Doc/library/functions.rst):
The syntax [rendered currently](https://docs.python.org/3/library/functions.html... | 4f24b92aa0677ed5310dd2d1572b55f4e30c88ef | d457345bbc6414db0443819290b04a9a4333313d |
python/cpython | python__cpython-114127 | # Suggested wording change in Class Method Objects Tutorial
# Documentation
This is not a bug but a suggestion to improve the wording of a paragraph.
While reading [section 9.3.4](https://docs.python.org/3/tutorial/classes.html#method-objects) of the python tutorial on the official website, I came across this sent... | 31a2543c80e1e38c97e50533249d9aa00e2f6cae | e454f9383c5ea629a917dfea791da0bb92b90d8e |
python/cpython | python__cpython-118009 | # typing.get_type_hints fails when passed a class with PEP 695 type parameters and PEP 563 is enabled
# Bug report
### Bug description:
```python
from __future__ import annotations
import typing
class Test[M]:
attr: M
print(typing.get_type_hints(Test))
```
This fails with a NameError:
```
... | 1e3e7ce11e3b0fc76e981db85d27019d6d210bbc | 15b3555e4a47ec925c965778a415dc11f0f981fd |
python/cpython | python__cpython-114067 | # crash in long_vectorcall in longobject.c
# Crash report
### What happened?
PyErr_Format function has wrong a format string `%s`.
So, the format string must be removed.
A python executable with building attached patch file do work well.
1. trigger code
```python
class evil(1):
pass
```
2. Root cause s... | a571a2fd3fdaeafdfd71f3d80ed5a3b22b63d0f7 | 311d1e2701037952eaf75f993be76f3092c1f01c |
python/cpython | python__cpython-114015 | # Inconsistency in `fractions.Fraction()` initialization error with invalid string
### Bug description:
The `fractions.Fraction()` error message differs when, for example, `123.dd` is done instead of `123.aa`; they should be equal.
```pycon
>>> from fractions import Fraction
>>> Fraction("123.dd")
Traceback (mo... | dd56b5748317c3d504d6a9660d9207620c547f5c | c7d59bd8cfa053e77ae3446c82afff1fd38a4886 |
python/cpython | python__cpython-114097 | # `make test` doesn't work w/ a WASI cross-build via (at least) `Tools/wasm/wasi.py`
# Bug report
### Bug description:
For some reason, `make test` is appending `python.wasm` to the command to run even though `python.wasm` was specified as part of the host runner.
<details>
<summary>`make test` output</summary>
`... | 03f78397039760085b8ec07969835c89610bbc6d | 3d5df54cdc1e946bd953bc9906da5abf78a48357 |
python/cpython | python__cpython-120520 | # Interned strings are immortal, despite what the documentation says
# Bug report
### Bug description:
The [`sys.intern` documentation](https://docs.python.org/3.13/library/sys.html#sys.intern) explicitly says:
> Interned strings are not [immortal](https://docs.python.org/3.13/glossary.html#term-immortal); yo... | 6f1d448bc110633eda110310fd833bd46e7b30f2 | 7595e6743ac78ac0dd19418176f66d251668fafc |
python/cpython | python__cpython-113979 | # Deprecation warning during text completion in REPL
# Bug report
### Bug description:
Define function inside REPL session:
```pycon
>>> def f():pass
```
then try to hit TAB to get suggestions for `f.__code__.` and you will be left with this ugly output without suggestions:
```pycon
>>> f.__code__./r... | e03dde5a24d3953e0b16f7cdefdc8b00aa9d9e11 | 9db2fd7edaa9d03e8c649c3bb0e8d963233cde22 |
python/cpython | python__cpython-122101 | # Unbounded reads by `zipfile` may cause a `MemoryError`.
# Bug report
### Bug description:
```python
def _EndRecData(fpin):
"""Return data from the "End of Central Directory" record, or None.
The data is a list of the nine items in the ZIP "End of central dir"
record followed by a tenth item, ... | 556dc9b8a78bad296513221f3f414a3f8fd0ae70 | 8161afe51c65afbf0332da58837d94975cec9f65 |
python/cpython | python__cpython-113969 | # `zipfile.ZipInfo._compresslevel` should be public.
# Feature or enhancement
### Proposal:
Today people pass `ZipInfo` instances into APIs that accept them such as `ZipFile.writestr()` in order to control how individual items are put into a zip archive as such:
```python
zip_info = zipfile.ZipInfo(filename=fil... | b44b9d99004f096619c962a8b42a19322f6a441b | ac92527c08d917dffdb9c0a218d06f21114614a2 |
python/cpython | python__cpython-113955 | # Tkinter: widget.tag_unbind(tag, sequence, funcid) unbind all bindings
# Bug report
This issue is similar to #75666. When *funcid* is passed to `tag_unbind()` methods of `Text` or `Canvas`, they remove all bindings and delete only *funcid* Tcl command. According to the docstrings, they only should remove binding spe... | 7e42fddf608337e83b30401910d76fd75d5cf20a | 3ddc5152550ea62280124c37d0b4339030ff7df4 |
python/cpython | python__cpython-115306 | # pydoc does not show unbound methods of builtin classes as module members
If you set an unbound method of builtin class as a module global, `pydoc` will not show it in the module output. It shows builtin functions and static methods, class methods and bound instance methods of builtin classes.
```py
list_count = ... | 72cff8d8e5a476d3406efb0491452bf9d6b02feb | 68c79d21fa791d7418a858b7aa4604880e988a02 |
python/cpython | python__cpython-113940 | # `traceback.clear_frames` does not clear locals when there have been previous access to `f_locals`
# Bug report
### Bug description:
```python
import traceback
import gc
class Obj:
def __init__(self, name: str):
self.name = name
def __repr__(self):
return f"Obj({self.name!r}... | 78c254582b1757c15098ae65e97a2589ae663cd7 | b905fad83819ec9102ecfb97e3d8ab0aaddd9784 |
python/cpython | python__cpython-113953 | # ``test_type_cache`` fails with ``--forever`` argument
# Bug report
### Bug description:
Trace:
```python
./python.exe -m test -q test_type_cache --forever
Using random seed: 2064316463
0:00:00 load avg: 2.54 Run tests sequentially
test test_type_cache failed -- Traceback (most recent call last):
File "/Users/ad... | e58334e4c9ccbebce6858da1985c1f75a6063d05 | c4992f4106aa509375f5beca8dc044a7f6c36a72 |
python/cpython | python__cpython-113933 | # ``test_compile`` raises a ``SyntaxWarning``
# Bug report
### Bug description:
Trace:
```python
test_condition_expression_with_redundant_comparisons_compiles (test.test_compile.TestSpecifics.test_condition_expression_with_redundant_comparisons_compiles) ... <eval>:1: SyntaxWarning: invalid decimal literal
<eval>:1:... | 9f088336b268dfe9011a7cb550f4e488ccd7e8f5 | ec23e90082ffdedc7f0bdd2dfadfc4983ddc0712 |
python/cpython | python__cpython-113973 | # test_idle fails on Devuan 5 Linux
# Bug report
### Bug description:
On Devuan 5, with this command in a build script:
```
./python -m test -uall -j0 > $test_file 2>&1
```
the following is logged:
```
0:10:21 load avg: 3.54 [229/469/2] test_idle failed (1 error)
test test_idle failed -- Traceback (most recent ca... | c4992f4106aa509375f5beca8dc044a7f6c36a72 | efa738e862da26f870ca659b01ff732649f400a7 |
python/cpython | python__cpython-113897 | # ``test_builtin`` raises ``DeprecationWarning``
# Bug report
### Bug description:
Trace:
<details>
```python
./python.exe -m test -v test_builtin
== CPython 3.13.0a2+ (heads/main:4826d52338, Jan 10 2024, 10:05:57) [Clang 15.0.0 (clang-1500.1.0.2.5)]
== macOS-14.2.1-arm64-arm-64bit little-endian
== Python build: d... | 9d33c23857cfd952bf3e1e7f34c77b7c9a5accc3 | fafb3275f25e116e51ff0b867aec597cb3de840f |
python/cpython | python__cpython-119519 | # `asyncio` `ProactorEventLoop` didn't check if the `socket` is blocking
# Bug report
### Bug description:
```python
import asyncio
import socket
s = socket.socket()
await asyncio.get_running_loop().sock_connect(s,('127.0.0.1',80))
```
according to https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.lo... | cf3bba3f0671d2c9fee099e3ab0f78b98b176131 | ce2ea7d629788fd051cbec099b5947ecbe50e819 |
python/cpython | python__cpython-114161 | # Make queue.SimpleQueue thread-safe in `--disable-gil` builds
# Feature or enhancement
### Proposal:
Instances of `queue.SimpleQueue` have mutable state that is not safe to mutate without the GIL. The previous implementation (in 3.12) was https://github.com/colesbury/nogil-3.12/commit/7e60a01aee.
@colesbury... | 925907ea362c4c014086be48625ac7dd67645cfc | 441affc9e7f419ef0b68f734505fa2f79fe653c7 |
python/cpython | python__cpython-113881 | # ``test_asyncio.test_server`` raises a ``ResourceWarning``
# Bug report
### Bug description:
```python
./python -m test -v test_asyncio.test_server
== CPython 3.13.0a2+ (heads/main:a9df076d7d, Jan 8 2024, 21:28:03) [GCC 9.4.0]
== Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.31 little-endian
== Python ... | ab0ad62038317a3d15099c23d2b0f03bee9f8fa7 | 1b7e0024a16c1820f61c04a8a100498568410afd |
python/cpython | python__cpython-114051 | # Support field docstrings for dataclasses that use __slots__
# Feature or enhancement
### Proposal:
A really nice `__slots__` feature is the ability to provide a data dictionary in the form of docstrings. That is also available for `property` objects. Consider this example:
```
class Rocket:
__slots... | 9c7657f09914254724683d91177aed7947637be5 | 0a3577bdfcb7132c92a3f7fb2ac231bc346383c0 |
python/cpython | python__cpython-113900 | # winfo_pathname gives an exception on 64-bit Python on Microsoft Windows
# Bug report
### Bug description:
```python
import sys
import tkinter
print(sys.version)
button = tkinter.Button()
print(button)
i = button.winfo_id()
print(i)
p = button.winfo_pathname(i)
print(p)
```
Code above copy-typed from attachment. ... | 1b7e0024a16c1820f61c04a8a100498568410afd | 5d384b0468b35b393f8ae2d3149d13ff607c9501 |
python/cpython | python__cpython-113869 | # Some `MAP_` constants defined on macOS but not in `mmap`
# Feature or enhancement
### Proposal:
The following `MAP_*` flags are defined on macOS, but are not exposed in the module `mmap`:
- MAP_NORESERVE
- MAP_NOEXTEND
- MAP_HASSEMAPHORE
- MAP_NOCACHE
- MAP_JIT
- MAP_RESILIENT_CODESIGN
- MAP_RESILIENT_MEDI... | 79970792fd2c70f77c38e08c7b3a9daf6a11bde1 | 8aa0088ea2422ed6b95076fe48a13df7562a4355 |
python/cpython | python__cpython-113864 | # Make all executors execute tier 2 instructions (micro-ops)
[Our plan](https://github.com/faster-cpython/ideas/blob/main/3.13/engine.md) proposes that we either execute all tier 2 code in the tier 2 interpreter or by [jitting the code](https://github.com/python/cpython/pull/113465)
However, our current executor in... | a0c9cf9456c2ee7a89d9bd859c07afac8cf5e893 | 93930eaf0acd64dc0d08d58321d2682cb019bc1a |
python/cpython | python__cpython-113854 | # Guarantee progress in executors
Reasoning about and implementing trace stitching is made much easier if we guarantee that individual executors make progress.
We need to guarantee that tier 2 execution as a whole makes progress, otherwise we might get stuck.
Implementing this guarantee is blocking progress on htt... | 55824d01f866d1fa0f21996d897fba0e07d09ac8 | 0d8fec79ca30e67870752c6ad4e299f591271e69 |
python/cpython | python__cpython-113849 | # About checking for CancelledError and its subclasses
For long time I wanted to replace the use of `PyObject_IsInstance()` with `CancelledError` in `_asynciomodule.c`. Even if the C code is correct and is closest to the corresponding Python code, it looked unnecessary complicated and bugprone. Also, `PyErr_GivenExcep... | 5273655bea050432756098641b9fda72361bf983 | 9100fc407e8c7038e7214b600b4ae568ae5510e3 |
python/cpython | python__cpython-113949 | # New warning: `‘_Py_stdlib_module_names’ defined but not used` in `Python/stdlib_module_names.h`
# Bug report
<img width="635" alt="Снимок экрана 2024-01-09 в 11 21 27" src="https://github.com/python/cpython/assets/4660275/3079a778-973e-457c-a910-3db41a688b45">
This happens in all recent PRs, examples:
- https://gi... | 8717f7b495c8c33fd37017f4e7684609c304c556 | 55824d01f866d1fa0f21996d897fba0e07d09ac8 |
python/cpython | python__cpython-113843 | # Missing error check in `update_symbols`
# Bug report
### Bug description:
There is error check missing right after a loop in https://github.com/python/cpython/blob/f3d5d4aa8f0388217aeff69e28d078bdda464b38/Python/symtable.c#L935-L982
Loop breaks when `PyIter_Next` returns `NULL` indicating that it is exhausted, but... | fda901a1ff94ea6cc338b74928acdbc5ee165ed7 | 2e17cad2b8899126eb2024bf75db331b871bd5bc |
python/cpython | python__cpython-127211 | # Possible undefined behavior division by zero in complex's `_Py_c_pow()`
# Bug report
### Bug description:
https://github.com/python/cpython/blob/main/Objects/complexobject.c#L150 `_Py_c_pow()` contains:
```c
at = atan2(a.imag, a.real);
phase = at*b.real;
if (b.imag != 0.0) {
len... | f7bb658124aba74be4c13f498bf46cfded710ef9 | a4d4c1ede21f9fa72280f4fc0f50212eecfac9ae |
python/cpython | python__cpython-115926 | # pathlib: clarify difference between pathlib and os.path
# Documentation
Currently, in [pathlib's doc page](https://docs.python.org/3/library/pathlib.html) the reason to use `os.path` instead is only stated as below:
> For low-level path manipulation on strings, you can also use the [os.path](https://docs.python.... | 1904f0a2245f500aa85fba347b260620350efc78 | be1c808fcad201adc4d5d6cca52ddb24aeb5e367 |
python/cpython | python__cpython-113828 | # Windows PGInstrument build fails to find frozen modules
After #113303 we now write frozen modules to a configuration-specific directory. Unfortunately, the change doesn't take into account PGO builds, which use a mix of configurations.
We should just be able to omit the configuration from the path. Debug builds o... | 92f96240d713a5a36c54515e44445b3cd0947163 | 52161781a6134a4b846500ad68004fe9027a233c |
python/cpython | python__cpython-115199 | # asyncio DatagramTransport.sendto does not send empty UDP packets
# Bug report
### Bug description:
Trying to send multicast UDP packets with DatagramTransport.sendto, I notice no error on the python program but no packet is sent (I've checked with tcpdump). Modifying the call to use the underlying socket fixes the... | 73e8637002639e565938d3f205bf46e7f1dbd6a8 | 8db8d7118e1ef22bc7cdc3d8b657bc10c22c2fd6 |
python/cpython | python__cpython-113837 | # inaccurate documentation for `shutil.move` when dst is an existing directory
# Documentation
(A clear and concise description of the issue.)
In the [doc of shutil](https://github.com/python/cpython/blob/3.12/Doc/library/shutil.rst?plain=1#L360) it says:
```rst
If the destination is an existing directory, t... | da8f9fb2ea65cc2784c2400fc39ad8c800a67a42 | d466052ad48091a00a50c5298f33238aff591028 |
python/cpython | python__cpython-113797 | # Additional validation of CSV Dialect parameters
# Feature or enhancement
CSV writer and reader allow to configure parameters of the CSV dialect. They check for some incompatible combination, for example quotechar must be set if quoting enabled. But it is still possible to specify values that produce ambiguous outpu... | c8351a617b8970dbe0d3af721c6aea873019c466 | 2f2ddabd1a02e3095b751100b94b529e4e0bcd20 |
python/cpython | python__cpython-113792 | # Missing clock definitions on macOS (time module)
# Feature or enhancement
### Proposal:
`time` exports a number of `CLOCK_*` values. MacOS has two constants that aren't exposed here:
- `CLOCK_MONOTONIC_RAW_APPROX`
- `CLOCK_UPTIME_RAW_APPROX`
Their definitions are the same as the same clocks without `_APPROX` at... | c6ca562138a0916192f9c3100cae678c616aed29 | b3dba18eab96dc95653031863bb2a222af912f2b |
python/cpython | python__cpython-113816 | # `test_capi` has refleaks
# Bug report
### Bug description:
```python
./python -m test -R 3:3 test_capi
Using random seed: 969223870
0:00:00 load avg: 10.38 Run 1 test sequentially
0:00:00 load avg: 10.38 [1/1] test_capi
beginning 6 repetitions
123456
......
test_capi leaked [90, 90, 91] references, sum=271
test_ca... | ace4d7ff9a247cbe7350719b996a1c7d88a57813 | 61dd77b04ea205f492498d30637f2d516d8e2a8b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.