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-117681
# Need a detailed explanation of the below added line into documentation consider this line "A class in an [except] clause is compatible with an exception if it is the same class or a base class thereof (but not the other way around — an except clause listing a derived class is not compatible with a base class)" which...
a05068db0cb43337d20a936d919b9d88c35d9818
ca7591577926d13083291c3caef408116429f539
python/cpython
python__cpython-117595
# Define test_search_anchor_at_beginning as CPU-heavy tests. Currently test_search_anchor_at_beginning requires to be completed in an absolute time. This can be flaky at low CPU environment or slow alternative implementation like RustPython. I would like to suggest adding `@support.requires_resource('cpu')` to the...
784623c63c45a4d13dfb04318c39fdb1ab790218
fd3679025d9d0da7eb11f2810ed270c214926992
python/cpython
python__cpython-117589
# Speed up `pathlib.Path.glob()` by working with strings internally `pathlib.Path.glob()` currently generates `Path` objects for intermediate paths that might never be yielded to the user, which is slow and unnecessary. For example, a pattern like `**/*.mp3` is evaluated by creating a `Path` object for every directory...
0cc71bde001950d3634c235e2b0d24cda6ce7dce
6258844c27e3b5a43816e7c559089a5fe0a47123
python/cpython
python__cpython-117585
# Raise TypeError for non-paths in `posixpath.relpath()` # Bug report ### Bug description: ```python >>> import posixpath >>> posixpath.relpath(None) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<frozen posixpath>", line 509, in relpath ValueError: no path specified ``` Expected:...
733e56ef9656dd79055acc2a3cecaf6054a45b6c
62aeb0ee69b06091396398de56dcb755ca3b9dc9
python/cpython
python__cpython-117661
# PyType_GetModuleByDef family for binary functions performance # Feature or enhancement ### Proposal: When implementing an extension module with a module state enabled, binary tp slot functions (e.g. `nb_add`) need two `PyType_GetModuleByDef()` to be used like the following to compare the given types with a he...
2c451489122d539080c8d674b391dedc1dedcb53
f180b31e7629d36265fa36f1560365358b4fd47c
python/cpython
python__cpython-117567
# ipaddress.IPv6Address.is_loopback broken for IPv4-mapped addresses # Bug report ### Bug description: While properties like `is_private` account for IPv4-mapped IPv6 addresses, such as for example: ```python >>> ipaddress.ip_address("192.168.0.1").is_private True >>> ipaddress.ip_address("::ffff:192.168.0.1").is_p...
fb7f79b4da35b75cdc82ff3cf20816d2bf93d416
eb20a7d12c4b2ab7931074843f8602a48b5b07bd
python/cpython
python__cpython-117553
# Avoid indefinite hang in `test.test_logging.HTTPHandlerTest.test_output` if request fails This unit test logs to an HTTP backend. If for some reason the request fails, then the `self.handled.wait()` will bock indefinitely. In practice that means until the test runner times out, which can be after over an hour. We...
59864edd572b5c0cc3be58087a9ea3a700226146
ca62ffd1a5ef41401abceddfd171c76c68825a35
python/cpython
python__cpython-117551
# New tier 2 counters break some C extensions due to order of field mismatch # Bug report ### Bug description: @tacaswell reported [here](https://github.com/python/cpython/pull/117144#issuecomment-2037824706): #177144 appears to have broken building scipy ``` FAILED: scipy/special/_specfun.cpython-313-x86_64-linux...
b5e60918afa53dfd59ad26a9f4b5207a9b304bc1
63998a1347f3970ea4c69c881db69fc72b16a54c
python/cpython
python__cpython-117548
# mimalloc compile error on OpenBSD # Bug report ``` In file included from Objects/mimalloc/prim/prim.c:22, from Objects/mimalloc/static.c:37, from Objects/obmalloc.c:22: Objects/mimalloc/prim/unix/prim.c: In function 'mi_prim_open': Objects/mimalloc/prim/unix/prim.c:67:10: error: im...
2067da25796ea3254d0edf61a39bcc0326c4f71d
df7317904849a41d51db39d92c5d431a18e22637
python/cpython
python__cpython-117568
# `os.path.realpath('loop/../link')` does not resolve link If `os.path.realpath()` encounters a symlink loop on posix, it prematurely stops querying paths and resolving symlink targets. This differs from coreutils `realpath`: ```shell $ cd /tmp $ ln -s loop loop $ ln -s target link $ realpath -m loop/../link /...
630df37116b1c5b381984c547ef9d23792ceb464
6bc0b33a91713ee62fd1860d28b19cb620c45971
python/cpython
python__cpython-117543
# ./Modules/_datetimemodule.c:290: days_before_year: Assertion `year >= 1' failed. # Crash report ### What happened? Python terminates with core dumped on the following test: ```python import datetime y = datetime.datetime.fromisoformat('0000W25') print(y) ``` The test result: ``` python: ./Modules/_da...
d5f1139c79525b4e7e4e8ad8c3e5fb831bbc3f28
a25c02eaf01abc7ca79efdbcda986b9cc2787b6c
python/cpython
python__cpython-117532
# Queue non-immediate shutdown doesn't unblock getters # Bug report ### Bug description: Caused by #104750 ```python import queue import threading q = queue.Queue() t = threading.Thread(target=q.get) t.start() q.shutdown() t.join(timeout=10.0) assert not t.is_alive() # raises AssertionError ``` ...
6bc0b33a91713ee62fd1860d28b19cb620c45971
dfcae4379f2cc4d352a180f9fef2381570aa9bcb
python/cpython
python__cpython-117522
# Improve typing.TypeGuard docstring The [current docstring](https://github.com/python/cpython/blob/1c434688866db79082def4f9ef572b85d85908c8/Lib/typing.py#L844) for `typing.TypeGuard` includes a single example, but that example does not use `TypeGuard`, and in fact demonstrates behavior that differs from that of `Type...
b32789ccb91bbe43e88193f68b1364a8da6d9866
3f5bcc86d0764b691087e8412941e947554c93fd
python/cpython
python__cpython-117517
# Implement PEP-742 # Feature or enhancement ### Proposal: PEP-742 was just accepted. Let's implement it. ### Has this already been discussed elsewhere? I have already discussed this feature proposal on Discourse ### Links to previous discussion of this feature: PEP-742 <!-- gh-linked-prs --> ### Linked PRs * g...
f2132fcd2a6da7b2b86e80189fa009ce1d2c753b
57183241af76bf33e44d886a733f799d20fc680c
python/cpython
python__cpython-118514
# Add `sys._is_gil_enabled()` # Feature or enhancement I propose adding a new function to the `sys` module to check if the GIL is current enabled: ``` sys._is_gil_enabled() -> bool Return True if the GIL is currently enabled and False if the GIL is currently disabled. ``` The function would always return...
2dae505e87e3815f087d4b07a71bb2c5cce22304
24e643d4ef024a3561c927dc07c59c435bb27bcc
python/cpython
python__cpython-117527
# JIT compiler doesn't support 64-bit operands on 32-bit sytems # Bug report ### Bug description: Tracking issue for @brandtbucher , and for me to write TODOs in code. ### CPython versions tested on: CPython main branch ### Operating systems tested on: _No response_ <!-- gh-linked-prs --> ### Linked PRs * gh-11...
62aeb0ee69b06091396398de56dcb755ca3b9dc9
df4d84c3cdca572f1be8f5dc5ef8ead5351b51fb
python/cpython
python__cpython-117731
# Make some `PyMutex` functions public # Feature or enhancement ### Overview The `PyMutex` APIs are currently internal-only in `pycore_lock.h`. This proposes making the type and two functions public in as part of the general, non-limited API in `Include/cpython/lock.h`. The APIs to be included in the public h...
3af7263037de1d0ef63b070fc7bfc2cf042eaebe
e8e151d4715839f785ff853c77594d7302b40266
python/cpython
python__cpython-118257
# [BUG] Newest 3.12 install on windows misses pip # Bug report ### Bug description: I recently did a fresh python installation, from python.org (https://www.python.org/ftp/python/3.12.2/python-3.12.2-amd64.exe) I did installed it on an "uncommon" directory (`D:\EDM115\Programmes\Python312\`), but this had nev...
c9073eb1a99606df1efeb8959e9f11a8ebc23ae2
baf347d91643a83483bae110092750d39471e0c2
python/cpython
python__cpython-117504
# Support non-ASCII user name in posixpath.expanduser() # Bug report Currently `posixpath.expanduser()` only supports ASCII user names in bytes paths. It supports non-ASCII user names in string paths. `ntpath.expanduser()` also "supports" non-ASCII user names (although this support is only a guess, but non-ASCII user...
51132da0c4dac13500d9bb86b2fdad42091d3fd9
44890b209ebe2efaf4f57eed04967948547cfa3b
python/cpython
python__cpython-117496
# Extract the instruction sequence data structure into its own file and add a Python interface The Instruction Sequence data structure used by the compiler/assembler should be extracted into its own file, so that it can be properly abstracted. It should get a convenient Python interface so that it can be directly ac...
04697bcfaf5dd34c9312f4f405083b6d33b3511f
060a96f1a9a901b01ed304aa82b886d248ca1cb6
python/cpython
python__cpython-117678
# typing.NoReturn and typing.Never are somewhat unclear # Documentation In [the typing docs](https://docs.python.org/3/library/typing.html), [typing.Never](https://docs.python.org/3/library/typing.html#typing.Never) and [typing.NoReturn](https://docs.python.org/3/library/typing.html#typing.NoReturn) are somewhat un...
852263e1086748492602a90347ecc0a3925e1dda
f201628073f22a785a096eccb010e2f78601b60f
python/cpython
python__cpython-118212
# ast: Improve behavior for user-defined classes From @encukou: Thanks for the fix. Since it's a blocker I merged it, even though I'd have one more review comment: It would be good to add this to the new test, and improve the behaviour (the error is quite opaque): ```python class MoreFiel...
e0422198fb4de0a5d81edd3de0d0ed32c119e9bb
040571f258d13a807f5c8e4ce0a182d5f9a2e81b
python/cpython
python__cpython-117484
# `test_ssl.test_wrong_cert_tls13` should accept "Broken pipe" as valid error The `test_wrong_cert_tls13` unit tests checks the behavior when the server rejects the client's ceritficate. On macOS, this can sometimes lead to a "Broken pipe" on the client instead of a "Connection reset by peer" when the connection is cl...
a214f55b274df9782e78e99516a372e0b800162a
33ee5cb3e92ea8798e7f1a2f3a13b92b39cee6d6
python/cpython
python__cpython-117479
# Add `@support.requires_gil_enabled` decorator to mark tests that require the GIL # Feature or enhancement @Eclips4 [points out](https://github.com/python/cpython/pull/117475#discussion_r1548349232) that it might be time to add a dedicated decorator for marking tests that require the GIL: He writes: > I think this...
42205143f8b3211d1392f1d9f2cf6717bdaa5b47
de5ca0bf71760aad8f2b8449c89242498bff64c8
python/cpython
python__cpython-117475
# Skip `test_gdb.test_backtrace.test_threads` in free-threaded build # Feature or enhancement The `test_threads` test checks that `py-bt` reports when a thread is waiting on the GIL. In the free-threaded build, the GIL will typically be disabled. I think we should just skip the test in that case. https://github.com/...
63998a1347f3970ea4c69c881db69fc72b16a54c
434bc593df4c0274b8afd3c1dcdc9234f469d9bf
python/cpython
python__cpython-117510
# mailbox.mbox.flush() loses mailbox owner In the `flush()` method for mbox mailboxes, after writing the new file, it correctly copies the file modes from the old file to the new one: https://github.com/python/cpython/blob/027fa2eccf39ddccdf7b416d16601277a7112054/Lib/mailbox.py#L753-L755 However, it doesn't copy t...
3f5bcc86d0764b691087e8412941e947554c93fd
dc5471404489da53e6d591b52ba8886897ed3743
python/cpython
python__cpython-117460
# asyncio.run_coroutine_threadsafe drops specified exceptions' traceback # Bug report ### Bug description: ```python import asyncio import threading import traceback async def raiseme(): raise ValueError(42) async def raiseme2(): raise asyncio.TimeoutError() loop = asyncio.new_event_loop() asyncio.set_even...
85843348c5f0b8c2f973e8bc586475e69af19cd2
b4fe02f595fcb9f78261920a268ef614821ec195
python/cpython
python__cpython-117477
# pystats: Uop "miss" counts are incorrect # Bug report ### Bug description: After the trace stitching, all uop miss counts are attributed to either `_DEOPT` or `_SIDE_EXIT`. These should instead by counted for the uop immediately prior. ### CPython versions tested on: CPython main branch ### Operating systems ...
757b62493b47c6d2f07fc8ecaa2278a7c8a3bea6
9c1dfe21fdaf2d93c3e1d1bba1cbe240e35ff35d
python/cpython
python__cpython-118482
# A loop split between two hot executors never calls CHECK_EVAL_BREAKER() When a tight for loop without calls is turned into two traces that transfer directly to each other, it seems that `CHECK_EVAL_BREAKER()` is never called, and the loop won't be interruptible. See https://github.com/faster-cpython/ideas/issues/...
67bba9dd0f5b9c2d24c2bc6d239c4502040484af
f8e088df2a87f613ee23ea4f6787f87d9196b9de
python/cpython
python__cpython-117441
# Make syslog thread-safe in `--disable-gil` builds # Feature or enhancement The `syslog` module has two mutable global variables: https://github.com/python/cpython/blob/9dae05ee59eeba0e67af2a46f2a2907c9f8d7e4a/Modules/syslogmodule.c#L71-L72 We need to protect access to these variables in the `--disable-gil` builds...
954d616b4c8cd091214aa3b8ea886bcf9067243a
e569f9132b5bdc1c103116a020e19e3ccc20cf34
python/cpython
python__cpython-117469
# Make refleak checking thread-safe without the GIL # Feature or enhancement The refleak checking relies on per-interpreter "total" refcount tracking. It uses non-atomic operations and is not thread-safe without the GIL. In the free-threaded build, I think we should primarily track counts in `PyThreadState` and occa...
1a6594f66166206b08f24c3ba633c85f86f99a56
2067da25796ea3254d0edf61a39bcc0326c4f71d
python/cpython
python__cpython-117436
# Make multiprocessing `SemLock` thread-safe in the free-threaded build # Feature or enhancement The multiprocessing `SemLock` code maintains an internal `count` field. When operating as a recursive mutex, `count` is the number of times the thread has acquired the mutex (i.e., 0, 1, .. N). When operating as a semapho...
de5ca0bf71760aad8f2b8449c89242498bff64c8
04697bcfaf5dd34c9312f4f405083b6d33b3511f
python/cpython
python__cpython-117412
# PyFutureFeatures should not be public ``PyFutureFeatures`` is defined in Include/cpython/compile.h. If it not used in anything which is user-facing, so there is no reason for anyone to use it. It should be private. <!-- gh-linked-prs --> ### Linked PRs * gh-117412 <!-- /gh-linked-prs -->
1d5479b236e9a66dd32a24eff6fb83e3242b999d
5fd1897ec51cb64ef7990ada538fcd8d9ca1f74b
python/cpython
python__cpython-117390
# `test_compileall.EncodingTest` is broken # Bug report This test was added a long time ago as a part of https://github.com/python/cpython/commit/4b00307425bb3219f269a13ba5a9526903d21ce8 But, it is broken right now for several reasons: 1. It does not assert anything at all, so it passes when it really should no...
44f67916dafd3583f482e6d001766581a1a734fc
5092ea238e28c7d099c662d416b2a96fdbea4790
python/cpython
python__cpython-117386
# sys.settrace set some events without callbacks # Bug report ### Bug description: `sys.settrace` sets `PY_MONITORING_EVENT_BRANCH` and `PY_MONITORING_EVENT_EXCEPTION_HANDLED` monitoring events but does not have any registered callbacks. Those two events should not generate any legacy trace events (and `sys.settrace...
0f998613324bcb6fa1cd9a3a2fc7e46f67358df7
a5eeb832c2bbbd6ce1e9d545a553de926af468d5
python/cpython
python__cpython-117382
# Fix error message for `ntpath.commonpath` # Bug report ### Bug description: ```python >>> import ntpath >>> ntpath.commonpath(["/foo", "foo"]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<frozen ntpath>", line 808, in commonpath ValueError: Can't mix absolute and rela...
2ec6bb4111d2c03c1cac02b27c74beee7e5a2a05
a214f55b274df9782e78e99516a372e0b800162a
python/cpython
python__cpython-126538
# forkserver.set_forkserver_preload() silent preload import failures when sys.path is required # Bug report ### Bug description: Bug in `def main()`: https://github.com/python/cpython/blob/main/Lib/multiprocessing/forkserver.py#L167 The param `sys_path` is ignored. Result: `ModuleNotFoundError` for preloaded module...
9d08423b6e0fa89ce9cfea08e580ed72e5db8c70
266328552e922fd9030cd699e10a25f03a67c8ba
python/cpython
python__cpython-117696
# Implement deferred reference counting in free-threaded builds # Feature or enhancement @Fidget-Spinner has started implementing tagged pointers in the evaluation stack in https://github.com/python/cpython/issues/117139. There are two other pieces needed for deferred reference counting support in the free-threa...
4ad8f090cce03c24fd4279ec8198a099b2d0cf97
c50cb6dd09d5a1bfdd1b896cc31ccdc96c72e561
python/cpython
python__cpython-117679
# Confusing wording in `os.path.lexists` docs os.path.lexists(path) https://docs.python.org/3/library/os.path.html#os.path.lexists Return True if path refers to an existing path. Returns **True** for broken symbolic links. Equivalent to [exists()](https://docs.python.org/3/library/os.path.html#os.path.exists...
73906d5c908c1e0b73c5436faeff7d93698fc074
a05068db0cb43337d20a936d919b9d88c35d9818
python/cpython
python__cpython-117350
# Speed up `os.path` # Feature or enhancement ### Proposal: There are some minor optimisations possible in `os.path`, including some fast returns. ### Has this already been discussed elsewhere? This is a minor feature, which does not need previous discussion elsewhere ### Links to previous discussion of...
cae4cdd07ddfcd8bcc05d683bac53815391c9907
8eda146e87d5531c9d2bc62fd1fea3bd3163f9b1
python/cpython
python__cpython-117372
# configparser.RawConfigParser._read is unmanageably complex From the review: > This function is already unmanageably complex (and complexity checks [disabled in the backport](https://github.com/jaraco/configparser/blob/b244f597d871a83986d5146ab49a4e7c19f8b528/backports/configparser/__init__.py#L1039)). Adding this...
019143fecbfc26e69800d28d2a9e3392a051780b
01bd74eadbc4ff839d39762fae6366f50c1e116e
python/cpython
python__cpython-117363
# `test_clinic` fails with the `--forever` argument # Bug report ### Bug description: ```python ./python -m test -q test_clinic --forever Using random seed: 2016588083 0:00:00 load avg: 16.10 Run tests sequentially test test_clinic failed -- Traceback (most recent call last): File "/home/eclips4/CLionProjects/cpyt...
35b6c4a4da201a947b2ceb96ae4c0d83d4d2df4f
7e2fef865899837c47e91ef0180fa59eb03e840b
python/cpython
python__cpython-117343
# dis [docs]: LOAD_SUPER_ATTR should push NULL instead of None if the lowest bit is set # Documentation The docs for LOAD_SUPER_ATTR currently states > The low bit of namei signals to attempt a method load, as with [LOAD_ATTR](https://docs.python.org/3/library/dis.html#opcode-LOAD_ATTR), which results in pushing...
a17f313e3958e825db9a83594c8471a984316536
26d328b2ba26374fb8d9ffe8215ecef7c5e3f7a2
python/cpython
python__cpython-117371
# Deprecate glob.glob0() and glob.glob1() Undocumented functions `glob0()` and `glob1()` were just helpers for `glob.iglob()`. They are not underscored because the `glob` module has `__all__`. They survived numerous refactorings only because they were used in the `msilib` module and some MSI related scripts. But the `...
fc8007ee3635db6ab73e132ebff987c910b6d538
c741ad3537193c63fe697a8f0316aecd45eeb9ba
python/cpython
python__cpython-117336
# Handle non-iterables for `ntpath.commonpath` # Bug report ### Bug description: ```python >>> import ntpath >>> ntpath.commonpath(None) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<frozen ntpath>", line 826, in commonpath ValueError: commonpath() arg is an empty sequence ``` Ex...
14f1ca7d5363386163839b31ce987423daecc3de
18cf239e39e25e6cef50ecbb7f197a82f8920ff5
python/cpython
python__cpython-117330
# Make `cell` thread-safe in the free-threaded build # Feature or enhancement From the [docs](): “Cell” objects are used to implement variables referenced by multiple scopes. Currently, modifying cell contents concurrently with other accesses is not thread-safe without the GIL. This shows up, for example, in `test_s...
19c1dd60c5b53fb0533610ad139ef591294f26e8
397d88db5e9ab2a43de3fdf5f8b973a949edc405
python/cpython
python__cpython-117369
# email.policy.EmailPolicy._fold() breaking multi-byte Unicode sequences https://github.com/python/cpython/blob/eefff682f09394fe4f18b7d7c6ac4c635caadd02/Lib/email/policy.py#L208 I think it's problematic that the method `email.policy.EmailPolicy._fold()` relies on the generic `str` / `bytes` method `.splitlines()`, ...
aec1dac4efe36a7db51f08385ddcce978814dbe3
4e502a4997af4c8042a6ac13115a3f8ba31520ea
python/cpython
python__cpython-117309
# `_ssl._SSLContext` construction crashes when a bad build results in an empty `PY_SSL_DEFAULT_CIPHER_STRING` #define # Bug report ### What happened? This doesn't come up in practice as nobody would ever have such a misbehaving build in a supported released config. Not a security issue. I stumbled upon thi...
8cb7d7ff86a1a2d41195f01ba4f218941dd7308c
6c8ac8a32fd6de1960526561c44bc5603fab0f3e
python/cpython
python__cpython-117304
# Free-threading crash involving `os.fork()` and `PyThreadState_DeleteCurrent()` When running with `PYTHON_GIL=0`, `test_threading.test_reinit_tls_after_fork()` may crash in the forked child process with an assertion error that one of the dead thread states was already cleared. https://github.com/python/cpython/blo...
bfc57d43d8766120ba0c8f3f6d7b2ac681a81d8a
05e0b67a43c5c1778dc2643c8b7c12864e135999
python/cpython
python__cpython-117301
# Use stop-the-world to make `sys._current_frames()` and `sys._current_exceptions()` thread-safe in free-threaded build # Feature or enhancement The [`sys._current_frames`](https://docs.python.org/3/library/sys.html#sys._current_frames) and [`sys._current_exceptions`](https://docs.python.org/3/library/sys.html#sys._c...
01bd74eadbc4ff839d39762fae6366f50c1e116e
94c97423a9c4969f8ddd4a3aa4aacb99c4d5263d
python/cpython
python__cpython-117297
# DocTestCase should report as skipped if the doctest itself is skipped # Feature or enhancement ### Proposal: When a doctest is run through `unittest`, each docstring is wrapped in a `DocTestCase`. Currently, if the docstring's examples are all skipped (either with a `# doctest: +SKIP` comment, or the `optionfl...
29829b58a8328a7c2ccacaa74c1d7d120a5e5ca5
efcc96844e7c66fcd6c23ac2d557ca141614ce9a
python/cpython
python__cpython-117298
# test.libregrtest race condition in runtest_mp leads to 30 second delay in free-threaded build This is related to https://github.com/python/cpython/issues/90363. In https://github.com/python/cpython/pull/30470, the (partial) fix for that issue I wrote: > There are still potential race conditions between checkin...
26a680a58524fe39eecb243e37adfa6e157466f6
59864edd572b5c0cc3be58087a9ea3a700226146
python/cpython
python__cpython-117290
# CFG to instructions creates too many label IDs ``_PyCfg_ToInstructionSequence`` creates an instruction sequence where the jump target labels are equal to the offsets of the jump targets. This by passes the "labelmap" mechanism of the instruction sequence data structure (the mapping is done at source) but also requir...
262fb911ab7df8e890ebd0efb0773c3e0b5a757f
74c8568d07719529b874897598d8b3bc25ff0434
python/cpython
python__cpython-117916
# PyTuple_SetItem documentation doesn't warn about refcount requirements The PyTuple_SetItem() function (correctly) raises a SystemError when used on a tuple whose refcount isn't 1. The `PyTuple_SET_ITEM()` macro doesn't have any checks on the refcount, but it's still really bad to use it on a tuple that already in us...
041a566f3f987619cef7d6ae7915ba93e39d2d1e
3b26cd8ca0e6c65e4b61effea9aa44d06e926797
python/cpython
python__cpython-117285
# 3.13.0a5 SIGSEGV when calling weakref.proxy on a class instance ### What happened? When building [dill](https://github.com/uqfoundation/dill) for Fedora Linux 41 with Python 3.13.0a5, a segmentation fault happens. The investigation leads back to Python. The minimal reproducer for this to happen with Python 3.13....
8ef98924d304b5c9430e23f8170e2c32ec3a9920
8987a5c809343ae0dd2b8e607bf2c32a87773127
python/cpython
python__cpython-117354
# scandir direntry.stat() always returns st_ctime of 0 on Windows # Bug report ### Bug description: In 3.12 on Windows, calling stat() on a direntry returned from os.scandir() always returns an st_ctime of 0: ```python import os for direntry in os.scandir('.'): st = direntry.stat() print(st.st_ctime) ``` I...
985917dc8d34e2d2f717f7a981580a8dcf18d53a
2057c92125f2e37caee209f032be9fe9c208357b
python/cpython
python__cpython-117276
# SystemError: <method-wrapper '__init__' of ast.AST-child object at ...> returned NULL without setting an exception # Bug report ### Bug description: ```python import ast class File(ast.AST): _fields = ("xxx",) def __init__(self): super().__init__() File() ``` ``` Traceback (most recent call l...
4c71d51a4b7989fc8754ba512c40e21666f9db0d
8cb7d7ff86a1a2d41195f01ba4f218941dd7308c
python/cpython
python__cpython-117234
# Allow CPython to build against cryptography libraries lacking BLAKE2 support # Feature or enhancement ### Proposal: As part of a series of changes [discussed on the python Ideas board](https://discuss.python.org/t/support-building-ssl-and-hashlib-modules-against-aws-lc/44505/6), this issue proposes placing guards ...
b8eaad30090b46f115dfed23266305b6546fb364
01a51f949475f1590eb5899f3002304060501ab2
python/cpython
python__cpython-117228
# Refresh doctest summary # Feature or enhancement The doctest output looks like [this](https://github.com/hugovk/cpython/actions/runs/8421808774/job/23059608592?pr=62): ``` Document: howto/ipaddress ------------------------- 1 items passed all tests: 10 tests in default 10 tests in 1 items. 10 passed and 0 failed...
ce00de4c8cd39816f992e749c1074487d93abe9d
92397d5ead38dde4154e70d00f24973bcf2a925a
python/cpython
python__cpython-117493
# collection.ChainMap.fromkeys argument 'value' has incorrect argument kind # Bug report ### Bug description: fromkeys method of collection.ChainMap has vararg argument kind. Description of 'fromkeys' method and redirection to dict.fromkeys implies that there should be single value (positional only or keyword-or-pos...
03f7aaf953f00bf2953c21a057d8e6e88db659c8
fc5f68e58ecfbc8c452e1c2f33a2a53d3f2d7ea2
python/cpython
python__cpython-117206
# compileall with workers would is faster with larger chunksize # Feature or enhancement ### Proposal: Currently we do a map with the default chunksize=1 over files: https://github.com/python/cpython/blob/3726cb0f146cb229a5e9db8d41c713b023dcd474/Lib/compileall.py#L109 A quick local benchmark suggests that chunksize...
b4fe02f595fcb9f78261920a268ef614821ec195
985917dc8d34e2d2f717f7a981580a8dcf18d53a
python/cpython
python__cpython-117220
# object.__sizeof__(1) have different output between 3.9.10 and 3.12.2 # Bug report ### Bug description: on a Windows x64 machine ```python >>> #python 3.9.10 >>> object.__sizeof__(1) 28 >>> >>> #python 3.12.2 >>> object.__sizeof__(1) 56 >>> ``` ### CPython versions tested on: 3.9, 3.12 ### Operating systems te...
406ffb5293a8c9ca315bf63de1ee36a9b33f9aaf
c85e3526736d1cf8226686fdf4f5117e105a7b13
python/cpython
python__cpython-117198
# Wrong formatting in the "What's new in Python 3.13" article, "Improved Modules" section. There is a wrong formatting In the "What's new in Python 3.13" article, "Improved Modules" section: name of the `base64` module is written smaller than other modules' names. Everything becomes clear if you look at the [source co...
78a651fd7fbe7a3d1702e40f4cbfa72d87241ef0
f267d5bf2a99fbeb26a720d1c87c1f0557424b14
python/cpython
python__cpython-117203
# Both test_flush_reparse_deferral_disabled tests fail with older libexpat (2.4.4) # Bug report ### Bug description: Running the test suite for 3.9.19 (and other currently released versions) breaks with the old `libexpat` (of course, patched for the security issues): ``` [ 684s] 0:04:10 load avg: 0.64 Re-running t...
9f74e86c78853c101a23e938f8e32ea838d8f62e
872e212378ef86392069034afd80bb53896fd93d
python/cpython
python__cpython-117184
# new `TestUopsOptimization` test case failing an assert # Bug report ### Bug description: While writing test cases for #116168, I ran into a case that failed on `main` too. Here's the test as a diff. It's under `test_opt.TestUopsOptimization`: ```diff diff --git a/Lib/test/test_capi/test_opt.py b/Lib/test/test_cap...
6c83352bfe78a7d567c8d76257df6eb91d5a7245
f11d0d8be8af28e1368c3c7c116218cf65ddf93e
python/cpython
python__cpython-117179
# 3.13.0a5 broke `importlib.util.LazyLoader` # Bug report ### Bug description: Test program: ```python # An importlib.util.LazyLoader test, based on example from # https://docs.python.org/3/library/importlib.html#implementing-lazy-imports import sys import importlib.util def lazy_import(name): ...
9a1e55b8c5723206116f7016921be3937ef2f4e5
4c71d51a4b7989fc8754ba512c40e21666f9db0d
python/cpython
python__cpython-117199
# New warning: `'initializing': conversion from 'uint64_t' to 'uintptr_t', possible loss of data [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]` # Bug report ### Bug description: Popped up in https://github.com/python/cpython/pull/117171/files and https://github.com/python/cpython/pull/117170/files ### CPyth...
eebea7e515462b503632ada74923ec3246599c9c
83485a095363dad6c97b19af2826ca0c34343bfc
python/cpython
python__cpython-117500
# `linecache.cache` sometimes has an entry for `<string>` under Python 3.13.0a5 # Bug report ### Bug description: I noticed this via Hypothesis' pretty-printer for `lambda` functions, and tracked the divergence through the `inspect` module to `linecache`: ```python import linecache def test(): print(linecache....
a931a8b32415f311008dbb3f09079aae1e6d7a3d
ecdf6b15b0c0570c3c3302ab95bdbfd3007ea941
python/cpython
python__cpython-117190
# FAIL: test_makefile_test_folders (test.test_tools.test_makefile.TestMakefile.test_makefile_test_folders) ### Bug description: Configuration: ```sh ./configure --with-pydebug ``` Test: ```python ./python -m test test_tools --junit-xml test-resuls.xml -j2 --timeout 1200 -v ``` Output: ```python FAIL: te...
d9cfe7e565a6e2dc15747a904736264e31a10be4
35b6c4a4da201a947b2ceb96ae4c0d83d4d2df4f
python/cpython
python__cpython-118037
# performance: Update io.DEFAULT_BUFFER_SIZE to make python IO faster? # Bug report ### Bug description: Hello, I was doing some benchmarking of python and package installation. That got me down a rabbit hole of buffering optimizations between between pip, requests, urllib and the cpython interpreter. TL;DR I wou...
8fa124868519eeda0a6dfe9191ceabd708d84fa7
23950beff84c39d50f48011e930f4c6ebf32fc73
python/cpython
python__cpython-117143
# Convert _ctypes extension module to multi-phase init # Feature or enhancement ### Proposal: This issue is available to keep track of PRs, following the heap type conversion completed at #114314. ### TODO: - ~[ ] Make `free_list` in `malloc_closure.c` per-module variables.~ [rejected](https://github.com/py...
dd44ab994b7262f0704d64996e0a1bc37b233407
3de09cadde788065a4f2d45117e789c9353bbd12
python/cpython
python__cpython-117135
# Microoptimize glob() for include_hidden=True If `include_hidden` is false (by default), the dot-starting names are filtered out if the pattern does not start with a dot. If `include_hidden` is true, no filtering is needed, but the current code still creates a generator expression to filter names with condition which...
5a78f6e798d5c2af1dba2df6c9f1f1e5aac02a86
00baaa21de229a6db80ff2b84c2fd6ad1999a24c
python/cpython
python__cpython-117128
# glob tests miss `mypipe` On my system, `test_glob_named_pipe` has been failing since it was added in #116421: ``` ====================================================================== FAIL: test_glob_named_pipe (test.test_glob.GlobTests.test_glob_named_pipe) ---------------------------------------------------...
42ae924d278c48a719fb0ab86357f3235a9f7ab9
8383915031942f441f435a5ae800790116047b80
python/cpython
python__cpython-117115
# Add `isdevdrive` to `posixpath` # Feature or enhancement ### Proposal: Four changes: 1. Add link to `genericpath.py` & remove redundant availability in the documentation for `os.path` 2. Deduplicate `lexists` & fallback `isjunction` implementations by defining them in `genericpath`. 3. Move fallback `ntpa...
0821923aa979a72464c5da8dfa53a719bba5801c
c2276176d543a2fc2d57709c2787f99850fbb073
python/cpython
python__cpython-117111
# Subclass of `typing.Any` cannot be instantiated with arguments # Bug report ### Bug description: ```python from typing import Any class C(Any): def __init__(self, v): ... C(0) # TypeError: object.__new__() takes exactly one argument (the type to instantiate) ``` The fix should be easy. Just replace -- ``...
8eec7ed714e65d616573b7331780b0aa43c6ed6a
a17f313e3958e825db9a83594c8471a984316536
python/cpython
python__cpython-117120
# Major slowdown on large listcomp # Bug report ### Bug description: That started within the last 48 hours, on the main branch. Here's test code; it's possible it could be simplified ```python if 1: class Obj: def __init__(self, i): self.val = i import sys print(sys.version) fro...
e28477f214276db941e715eebc8cdfb96c1207d9
e2e0b4b4b92694ba894e02b4a66fd87c166ed10f
python/cpython
python__cpython-117092
# Sync with importlib_metadata for Python 3.13 This issue tracks incorporating updates from importlib_metadata into CPython for Python 3.13, including: <!-- gh-linked-prs --> ### Linked PRs * gh-117092 * gh-117094 <!-- /gh-linked-prs -->
8ad88984200b2ccddc0a08229dd2f4c14d1a71fc
7d446548ef53f6c3de1097c6d44cada6642ddc85
python/cpython
python__cpython-132595
# Python 3.13a5 fails to build on AIX # Bug report ### Bug description: ``` gcc -pthread -maix64 -bI:Modules/python.exp -Wl,-blibpath:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib -lutil -Wl,-hlibpython3.13.so ... ld: 0706-012 The -h flag is not recognized. ld: 0706-006 Cannot find or open library file: -l ibpython3.13.so ...
47f1722d8053fb4f79e68cba07cbf08fb58a511c
efcc42ba70fb09333a2be16401da731662e2984b
python/cpython
python__cpython-117113
# importlib.resources.abc.Traversable.joinpath docs incomplete [`importlib.resources.abc.Traversable.joinpath`](https://docs.python.org/3.13/library/importlib.resources.abc.html#importlib.resources.abc.Traversable.joinpath) should mention that it can take multiple descendants. The versionchanged note should mention...
e569f9132b5bdc1c103116a020e19e3ccc20cf34
52f5b7f9e05fc4a25e385c046e0b091641674556
python/cpython
python__cpython-117069
# Unreachable (useless) code in bytesio.c:resize_buffer() # Bug report ### Bug description: https://github.com/NGRsoftlab/cpython/blob/main/Modules/_io/bytesio.c#L158 ```C size_t alloc = PyBytes_GET_SIZE(self->buf); /* skipped for short */ if (alloc > ((size_t)-1) / sizeof(char)) goto overflow...
63d6f2623ef2aa90f51c6a928b96845b9b380d89
42ae924d278c48a719fb0ab86357f3235a9f7ab9
python/cpython
python__cpython-117067
# Repeated optimizations in tier 2, due to the optimizer "failing" when it cannot optimize perfectly. The tier 2 optimizer fails whenever it cannot optimize the entire trace, which results in a large number of repeated attempts to optimize the same code. While we should add some form of backoff #116968 to mitigate ...
63289b9dfbc7d87e81f1517422ee91b6b6d19531
dcaf33a41d5d220523d71c9b35bc08f5b8405dac
python/cpython
python__cpython-120854
# Change `JUMP_TO_TOP` to a more general backwards jump for tier 2. Currently we have the `_JUMP_TO_TOP` uop which jumps to the *second* uop in the tier 2 trace, as the first is reserved for `_START_EXECUTOR`. Since this is a bit of an odd special case, we might as well add a more general jump backward. Doing so wou...
a47abdb45d4f1c3195c324812c33b6ef1d9147da
ce1064e4c9bcfd673323ad690e60f86e1ab907bb
python/cpython
python__cpython-117126
# test_posix: test_sched_setaffinity() fails on CentOS9 # Bug report Example of AMD64 CentOS9 3.x failure: https://buildbot.python.org/all/#/builders/838/builds/5082 ``` ====================================================================== FAIL: test_sched_setaffinity (test.test_posix.PosixTester.test_sched_setaffi...
50f9b0b1e0fb181875751cef951351ed007b6397
0907871d43bffb613cbd560224e1a9db13d06c06
python/cpython
python__cpython-117059
# macOS GUI and packaging suggestions are out of date # Documentation The current macOS usage guide doesn't mention several prominent GUI toolkits (Kivy, Toga), or app packaging tools (PyInstaller, Briefcacse). The guide should be updated to include links to these projects. <!-- gh-linked-prs --> ### Linked PRs * ...
44fbab43d8f3f2df07091d237824cf4fa1f6c57c
9221ef2d8cb7f4cf37592eb650d4c8f972033000
python/cpython
python__cpython-117028
# Store both function and code object in the function version cache (Copied from https://github.com/faster-cpython/ideas/issues/665.) The idea here is to avoid function version cache misses for generator expressions. (See https://github.com/faster-cpython/ideas/issues/664#issuecomment-2000948111.) We have a comp...
570a82d46abfebb9976961113fb0f8bb400ad182
c85d84166a84a5cb2d724012726bad34229ad24e
python/cpython
python__cpython-117042
# "-X gil" is not included in the Python CLI help This option was added in #116167. `PYTHON_GIL` was added in the help output, but `-X gil` was not. <!-- gh-linked-prs --> ### Linked PRs * gh-117042 <!-- /gh-linked-prs -->
2d17309cc719c41e02ffd1d6cac10f95a7e2359c
332ac46c09cd500a16a5f03b53f038b1d9ce77ef
python/cpython
python__cpython-117027
# http.server misleading point in doc about "text/*" mime types # Documentation It's said in the [http.server docs](https://docs.python.org/3/library/http.server.html#http.server.SimpleHTTPRequestHandler.do_GET): > If the file’s MIME type starts with text/ the file is opened in text mode; otherwise binary mode i...
ea2d707bd59963bd4f53407108026930ff12ae56
ac8df4b5892d2e4bd99731e7d87223a35c238f81
python/cpython
python__cpython-117064
# Unchecked signed integer overflow in PyLong_AsPid() If `pid_t` has the same size as `int`, `PyLong_AsPid` is defined as `PyLong_AsLong`. if the size of `int` is less than the size of `long`, there are values out of the C `int` range but in the C `long` range. Calling `PyLong_AsPid()` with such argument will not rais...
519b2ae22b54760475bbf62b9558d453c703f9c6
8182319de33a9519a2f243ac8c35a20ef82a4d2d
python/cpython
python__cpython-117009
# test_functools: test_recursive_pickle() crash on ARM64 Windows Non-Debug 3.x # Bug report build: https://buildbot.python.org/all/#/builders/730/builds/9247 ``` test_recursive_pickle (test.test_functools.TestPartialC.test_recursive_pickle) ... Windows fatal exception: stack overflow Current thread 0x000015c8 (mos...
9967b568edd2e35b0415c14c7242f3ca2c0dc03d
72eea512b88f8fd68b7258242c37da963ad87360
python/cpython
python__cpython-116997
# pystats: Add some stats about where _Py_uop_analyse_and_optimize bails out # Feature or enhancement ### Proposal: It would be useful to know the cases where the new optimizer can't optimize a trace. ### Has this already been discussed elsewhere? No response given ### Links to previous discussion of this feature...
50369e6c34d05222e5a0ec9443a9f7b230e83112
617158e07811edfd6fd552a3d84b0beedd8f1d18
python/cpython
python__cpython-116992
# `pegen --help` should mention that it needs different grammar files # Bug report I've got contacted by a user who tried to generate a pure-python parser with `pegen` from https://github.com/python/cpython/blob/main/Grammar/python.gram It was failing with ```python python -m pegen -o parser.py cpython\Grammar\pyt...
1e5f615086d23c71a9701abe641b5241e4345234
84c3191954b40e090db15da49a59fcc40afe34fd
python/cpython
python__cpython-117004
# Simplify the Grammar # Feature or enhancement ### Proposal: I've been implementing a Python runtime for a couple of months and I've been meaning to ask about something I noticed in the grammar. Why do we use: ``` assignment: | NAME ':' expression ['=' annotated_rhs ] | ('(' single_target ')' ...
9b280ab0ab97902d55ea3bde66b2e23f8b23959f
1acd2497983f1a78dffd6e5b3e0f5dd0920a550f
python/cpython
python__cpython-117025
# inspect.getsource does not work for a class-defined code object # Bug report ### Bug description: In the following MRE, `code.co_firstlineno` correctly returns 4, the first line number of the class definition, but `getsource(code)` returns the content of the entire file: ```python import sys from inspect im...
d16c9d1278164f04778861814ebc87ed087511fc
6547330f4e896c6748da23704b617e060e6cc68e
python/cpython
python__cpython-116985
# Mimalloc header is not installed # Bug report ### Bug description: Mimalloc is introduced in https://github.com/python/cpython/pull/109914. This will cause a header not found when building any extension that includes a `pycore_*.h` header as: ``` [build] In file included from /Users/yyc/repo/py/install/incl...
e17cd1fbfd4f20824c686c7242423e84ba6a6cc5
456c29cf85847c67dfc0fa36d6fe6168569b46fe
python/cpython
python__cpython-116958
# configparser.DuplicateOptionError leaves ConfigParser instance in bad state # Bug report ### Bug description: If you catch `configparser.Error` when reading a config file (the intention is to skip invalid config files) and then attempt to use the ConfigParser instance, you can get really weird errors. In the follo...
b1bc37597f0d36084c4dcb15977fe6d4b9322cd4
a8e93d3dca086896e668b88b6c5450eaf644c0e7
python/cpython
python__cpython-116967
# `./Include/cpython/pyatomic_std.h` will not compile # Bug report ### Bug description: These two functions have unclosed return expression. https://github.com/python/cpython/blob/2982bdb936f76518b29cf7de356eb5fafd22d112/Include/cpython/pyatomic_std.h#L913-L927 ### CPython versions tested on: CPython main branch ...
165cb4578c3cbd4d21faf1050193c297662fd031
ecb4a2b711d62f1395ddbff52576d0cca8a1b43e
python/cpython
python__cpython-116940
# Rewrite binarysort() # Feature or enhancement ### Proposal: I tried many things to speed listobject.c's `binarysort()`, but nothing really helped (neither code tweaks nor entirely different approaches). However, I got annoyed enough at the ancient code to rewrite it :wink: Some specific annoyances: - Whe...
8383915031942f441f435a5ae800790116047b80
97ba910e47ad298114800587979ce7beb0a705a3
python/cpython
python__cpython-125213
# `dict` and `dict.update` treat the first argument as a mapping when it has attribute `keys` without attribute `__getitem__` # Bug report ## How to reproduce 1. Make such a class: ```python class Object: def __iter__(self, /): return iter(()) def keys(self, /): re...
21ac0a7f4cf6d11da728b33ed5e8cfa65a5a8ae7
89515be596a0ca05fd9ab4ddf76c8013dd093545
python/cpython
python__cpython-116937
# C API: Add PyType_GetModuleByDef() to the limited C API version 3.13 I propose adding `PyType_GetModuleByDef()` to the limited C API version 3.13. The function was added to Python 3.9, the function is now well tested. We could add it way earlier to the limited C API. cc @encukou --- The `PyType_GetModuleByD...
507896d97dcff2d7999efa264b29d9003c525c49
0c1a42cf9c8cd0d4534d5c1d58f118ce7c5c446e
python/cpython
python__cpython-118021
# docs(easy): Document that heap types need to support garbage collection # Documentation In https://docs.python.org/3/c-api/typeobj.html#c.Py_TPFLAGS_HEAPTYPE, it does not mention that the heap type must support GC. However this is actually the case. The type itself needs to be visited by the GC because it forms a...
5d544365742a117027747306e2d4473f3b73d921
4605a197bd84da1a232bd835d8e8e654f2fef220