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-103557 | # Incorrect `inspect.Signature` can be created: pos-only with a default followed by pos-or-kw without one
While working on https://github.com/python/cpython/issues/103553 I found one more problem that merits its own issue.
Right now it is impossible to create a function that have a pos-or-keyword parameter without ... | 6b58d419a1bd62ac94274d108d59980a3eb6f6e0 | 7d20783d45a9c78379fe79229b57e4c31610a623 |
python/cpython | python__cpython-103554 | # Improve `test_inspect`
While working on https://github.com/python/cpython/issues/103406 I've noticed that there are some problems with `test_inspect` that we can easily fix.
List of problems I found:
1. https://github.com/python/cpython/blob/2b6f5c3483597abcb8422508aeffab04f500f568/Lib/test/test_inspect.py#L1840... | 4fe1c4b97e39429abbb9c2117fe40f585de00887 | 0097c36e07eeb516bcccba34feb4d494a67832d5 |
python/cpython | python__cpython-103549 | # Improve performance of `pathlib.Path.[is_]absolute()`
Two optimizations are possible:
- `is_absolute()` can pass the _unnormalized_ path to `os.path.isabs()`
- `absolute()` on an empty path (or `Path.cwd()`) can avoid joining an empty string onto the working directory (thus avoiding a call to `os.path.join()`), ... | de7f694e3c92797fe65f04cd2c6941ed0446bb24 | 376137f6ec73e0800e49cec6100e401f6154b693 |
python/cpython | python__cpython-104606 | # expose platform-specific `PRIO_DARWIN_*` constants for core type selection on macOS in `os` module.
# Feature or enhancement
As described in [this stack overflow answer](https://apple.stackexchange.com/a/443735/26977), the way to select "efficiency" vs. "performance" cores on Apple Silicon macOS machines is to us... | 616fcad6e2e10b0d0252e7f3688e61c468c54e6e | fd04bfeaf7a4531120ad450dbd1afc121a2523ee |
python/cpython | python__cpython-103539 | # Remove unused TK_AQUA code
Sections of code which are guarded by `#ifdef TK_AQUA` were committed in cb85244228ed. But from examining the CPython
and Tcl/Tk repository histories, it appears nothing has ever defined this macro. (Tk Aqua itself instead defines/uses the `MAC_OSX_TK` macro.) The only mentions of it I f... | e464ec9f4c4af6c2fdb6db9a3fa70ffd703ae01f | a33ce66dca57d4c36b1022fdf3b7e322f3203468 |
python/cpython | python__cpython-103534 | # Use PEP 669 API for cprofile
# Feature or enhancement
Replace the current `setprofile` mechanism with PEP 669 API for cProfile.
# Pitch
It's faster.
Before:
```
Hanoi: 0.342869599997357, 1.4579414000036195, 4.252174587699983
fib: 0.15549560000363272, 0.7588815999988583, 4.88040561907301
Hanoi: 0.33... | b9797417315cc2d1700cb2d427685016d3380711 | a0df9ee8fc77443510ab7e9ba8fd830f255a8fec |
python/cpython | python__cpython-103535 | # Remove unused TKINTER_PROTECT_LOADTK code
The `TKINTER_PROTECT_LOADTK` macro and relevant code (originally for #49372) are only defined for Tk 8.4.13 and earlier, but Tkinter already requires at least 8.5.12. Is there a reason to keep this code around, or can it be removed?
<!-- gh-linked-prs -->
### Linked PRs
* g... | 69e2c42f42f1d6fb1287ac5f9c6d19f2822df8fe | be8903eb9d66ef1229f93a3a6036aeafc3bb0bda |
python/cpython | python__cpython-103528 | # Make: multibyte codecs lack dependencies
There are no dependencies for the \_codec\_\* and \_multibytecodec modules, so if you're hacking away on a header file in Modules/cjkcodecs/ and execute `make`, you're not going to get a correct rebuild of those extension modules.
<!-- gh-linked-prs -->
### Linked PRs
* gh-1... | 3d71b5ec5ecccc14c00707d73ebbc907877b3448 | 95ee7c47ab53eb0e26f2b2b4f681015f49c0bff7 |
python/cpython | python__cpython-103526 | # Misleading exception message from `pathlib.PurePath()` when mixing str and bytes arguments
Since 6716254e71eeb4666fd6d1a13857832caad7b19f, attempting to create a `pathlib.PurePath` or `Path` object with mixed `str` and `bytes` arguments raises a TypeError (yay!) with a misleading message (booo!):
```python
>>> i... | 8611e7bf5ceace998fefcbf26ab1c5d5bc8a0e2a | d81ca7ec029ba05084751c8df64292bb48f4f30f |
python/cpython | python__cpython-103518 | # Tests for `pathlib.Path.walk()` are a little fragile
`test_walk_topdown()` attempts to handle all possible visitation orders, but the result is difficult to read. We can enforce a specific order by sorting `dirnames`.
https://github.com/python/cpython/blob/a6f95941a3d686707fb38e0f37758e666f25e180/Lib/test/test_pa... | 0097c36e07eeb516bcccba34feb4d494a67832d5 | 2b6f5c3483597abcb8422508aeffab04f500f568 |
python/cpython | python__cpython-103511 | # PEP 697 -- Limited C API for Extending Opaque Types
[PEP 697](https://peps.python.org/pep-0697/) was accepted and needs to be implemented.
<!-- gh-linked-prs -->
### Linked PRs
* gh-103511
<!-- /gh-linked-prs -->
| cd9a56c2b0e14f56f2e83dd4db43c5c69a74b232 | 35d273825abc319d0ecbd69110e847f6040d0cd7 |
python/cpython | python__cpython-103493 | # Clarify SyntaxWarning with literal comparison
I had a coworker slightly confused about the following warning, since None is a literal and `is not None` is idiomatic:
```
>>> 'a' is not None
<stdin>:1: SyntaxWarning: "is not" with a literal. Did you mean "!="?
True
```
I think this would be better as:
```
>>>... | ae25855045e8f19f4715c9b2c02cbcd81e7f6f95 | 79ae019164eeb6b94118bc17bc1e937405684c75 |
python/cpython | python__cpython-103506 | # Expose `sqlite3_db_config` and verbs (or equivalent)
# Feature or enhancement
Python's SQLite bindings should expose [`sqlite3_db_config`](https://www.sqlite.org/c3ref/db_config.html) and at least [`SQLITE_DBCONFIG_DEFENSIVE`](https://www.sqlite.org/c3ref/c_dbconfig_defensive.html) (or an idiomatic version of the... | bb8aa7a2b41ad7649d66909e5266fcee039e63ed | 222c63fc6b91f42e7cc53574615f4e9b7a33c28f |
python/cpython | python__cpython-103502 | # Python 3.12.0a7 can fail to catch exceptions when an iterator is involved
# Bug report
Python 3.12.0a7 (at least as of commit d65ed693a8a13a2a7f9b201bda1224d6ae5fcf0e) can fail to catch exceptions when an iterator is involved. The following code works on Python 3.11 but the `ValueError` is uncaught on Python 3.12... | efb8a2553c88a295514be228c44fb99ef035e3fa | 4307feaddc76b9e93cd38e325a1f0ee59d593093 |
python/cpython | python__cpython-103495 | # Unexpected behavior change in subclassing `Enum` class as of 3.11
I had a question regarding changes in subclassing `Enum` in 3.11. As of 3.11, if enum class has a mixin parent apart from `Enum` which has defined `__init__` or `__new__`, `member._value_` is set to be another instance of the mixin class
unless user ... | a6f95941a3d686707fb38e0f37758e666f25e180 | 2194071540313e2bbdc7214d77453b9ce3034a5c |
python/cpython | python__cpython-103669 | # Document that cache() and lru_cache() do not have a "call once" guarantee
# Documentation
The documentation for `@functools.cache` states that
> The cache is threadsafe so the wrapped function can be used in multiple threads.
but it is not threadsafe before the value is cached.
In the following example ... | e5eaac6064561c8f7643011a31fa506e78330798 | 7b134d3e71af03c4593678f36fbb202cc3650f4e |
python/cpython | python__cpython-103473 | # ResourceWarning due to unclosed response in http.client.HTTPConnection._tunnel
<!--
If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not
the right place to seek help. Consider the following options instead:
- reading the Python tutorial: h... | 9de0cf20fa0485e327e57cc0864c7476da85cfad | 690df4c16ca4f0054d27a6148da9e6af809a2658 |
python/cpython | python__cpython-103465 | # Add argument checking on pdb commands
# Feature or enhancement
Add some argument checking on pdb commands so it is not ignored silently
# Pitch
Currently for some pdb commands, we simply throw out provided arguments and proceed. This could confuse users. A super common case that I had (more than a few times... | d944d873b2d7a627c20246762e931f9d4fcf8fe7 | ed86e14b1672f32f0a31d72070e93d361ee0e2b4 |
python/cpython | python__cpython-103463 | # Calling SelectorSocketTransport.writelines with a very large payload doesn't get completely written to the socket
# Bug report
As a consequence of the optimization introduced in #91166, when `SelectorSocketTransport.writelines` is used with a very large buffer which can't be written in one shot either by using `s... | 19d2639d1e6478e2e251479d842bdfa2e8272396 | 9e677406ee6666b32d869ce68c826519ff877445 |
python/cpython | python__cpython-103454 | # [dataclasses] Exception on `__doc__` generation, when object signature cannot be fetched
Reproducible on current main branch:
```python
from dataclasses import dataclass
from typing import TypedDict
@dataclass
class Foo(TypedDict):
bar: int
```
Traceback:
```python
Traceback (most recent call l... | b57f55c23e15654e9dd77680ff1462603e360b76 | d83faf7f1ba2de95e98e3eeb5ce9009d9cd62192 |
python/cpython | python__cpython-103418 | # sched.scheduler docs improvement
# Documentation
The docs for `sched.scheduler` have an example that uses `time.time` as the `timefunc` https://docs.python.org/3/library/sched.html#sched.scheduler
Using `time.time` instead of `time.monotonic` (the default value of `sched.scheduler`) creates the potential for "st... | f2b7ecb7783299c4555e89125ca9ba8e89854643 | d65ed693a8a13a2a7f9b201bda1224d6ae5fcf0e |
python/cpython | python__cpython-103407 | # Modernize `test_inspect` by adding real pos-only parameters
Right now `test_inspect` uses several hacks to pretend that some parameters are positional only:
https://github.com/python/cpython/blob/ecad802e3f9ef7063e7d7fe9f0c037561396ef8e/Lib/test/test_inspect.py#L2465-L2469
https://github.com/python/cpython/blo... | 756978117698eeac3af270db25d22599e681bcb3 | a3d313a9e2d894f301557c18788aa1eec16c507c |
python/cpython | python__cpython-103396 | # Improve `typing._GenericAlias.__dir__` coverage
Right now the only test we have for `dir()` on `_GenericAlias` is
```python
def test_genericalias_dir(self):
class Foo(Generic[T]):
def bar(self):
pass
baz = 3
# The class attributes of the original ... | a28e2ce3fbcc852959324879e0bbf5ba8ecf0105 | ecad802e3f9ef7063e7d7fe9f0c037561396ef8e |
python/cpython | python__cpython-103391 | # `logging.config` `cfg` protocol rejects non-alphanumeric names, contrary to the documentation
## Description
In `logging.config`, when using the `cfg` protocol, names with spaces or non-alphanumeric characters (e.g. `cfg://nested[prop with spaces]`) raise a `ValueError` contrary to what is stated in the documenta... | 8d4052075ec43ac1ded7d2fa55c474295410bbdc | 135098743a0fae0efbcd98e35458e5bc721702e9 |
python/cpython | python__cpython-103380 | # Vestigial pathlib 'flavour' tests make assertions about internal method
Pathlib used to contain internal "flavour classes" with their own test suites. These were removed in a68e585c8b7b27323f67905868467ce0588a1dae (#31691) and e5b08ddddf1099f04bf65e63017de840bd4b5980 (#101002) along with most of their tests. Only th... | 0a675f4bb57d01a5e69f8f58ae934ad7ca501a8d | 8317d51996e68d8bb205385c1d47a9edcd128e7b |
python/cpython | python__cpython-103374 | # Improve documentation for `__mro_entries__`
# Documentation
The `__mro_entries__` method is documented in the data model here: https://docs.python.org/3.11/reference/datamodel.html#resolving-mro-entries.
However, it's not currently possible to reference it using the expected syntax (`~object.__mro_entries__`) ... | 0ba0ca05d2b56afa0b055db02233e703fe138918 | b22d021ee6309f9b0d43e683056db84cfb6fd3c0 |
python/cpython | python__cpython-103494 | # enum.CONFORM behavior breaks backwards compatibility
Encountered yet another breaking change for enums. There are two problems here:
* CONFORM doesn't "conform" to members that are partially unsupported
* CONFORM does not match the previous behavior for Flag. It used to be more similar to STRICT, but STRICT ... | 2194071540313e2bbdc7214d77453b9ce3034a5c | efb8a2553c88a295514be228c44fb99ef035e3fa |
python/cpython | python__cpython-107962 | # `pathlib.Path.owner()` and `.group()` should accept a `follow_symlinks` argument
# Feature or enhancement
`pathlib.Path.owner()` and `pathlib.Path.group()` always follow symbolic links. They should gain a new argument, `follow_symlinks`, that defaults to `True`. This will align their API with that of `pathlib.Pa... | a1551b48eebb4a68fda031b5ee9e5cbde8d924dd | 2ed20d3bd84fdcf511235cc473a241c5e8278a91 |
python/cpython | python__cpython-103638 | # String escape sequences should be listed in the stdtypes page
# Documentation
Since string escape sequences are FREQUENTLY used and referred to, they should be listed on the [Built In Types](https://docs.python.org/3/library/stdtypes.html) page, not tucked away in an obscure [lexical analysis](https://docs.python... | d29f57f6036353b4e705a42637177442bf7e07e5 | d0f1307580a69372611d27b04bbf2551dc85a1ef |
python/cpython | python__cpython-103359 | # Support Formatter defaults parameter in logging.config.dictconfig and fileconfig
# Feature or enhancement
Currently the logging.Formatter defaults parameter is unsupported in logging.config methodologies. Simply support it.
# Pitch
There's no reason for inconsistency between the rest of the variables which ... | 8f54302ab49a07e857843f1a551db5ddb536ce56 | 449bf2a76b23b97a38158d506bc30d3ebe006321 |
python/cpython | python__cpython-103335 | # `Tools/c-analyzer/cpython/_parser.py` should be ignored from indentation check in `patchcheck`
Right now if you touch this file, it will fail the CI: https://dev.azure.com/Python/cpython/_build/results?buildId=124277&view=logs&j=256d7e09-002a-52d7-8661-29ee3960640e
with:
```
Getting the list of files that hav... | 40db5c65b7ca4e784613b6122106a92576aba2d6 | dc604a8c58af748ce25aee1af36b6521a3592fa5 |
python/cpython | python__cpython-103352 | # Pickling is losing some fields on exceptions
# Bug report
Say we have an AttributeError with some fields on it (like name). When we pickle and unpickle it, we can see that .name (at least) is lost (and set to None). Optimally those fields should still be in-tact on the unpickled instance.
```
C:\Users\csm1049... | 79b17f2cf0e1a2688bd91df02744f461835c4253 | cf720acfcbd8c9c25a706a4b6df136465a803992 |
python/cpython | python__cpython-103358 | # 3.12.0a7 changes behavior of PropertyMock
# Bug report
3.12.0a7 changed the behavior of `unittest.mock.PropertyMock`
Setup:
```
from unittest.mock import MagicMock, PropertyMock
m = MagicMock()
p1 = PropertyMock(return_value=3)
p2 = PropertyMock(side_effect=ValueError)
type(m).foo = p1
type(m).bar = p2
... | 26c65980dc6d842879d133165bb7c461d98cc6c7 | 91794e587306343619a451473efae22aa9f4b9bd |
python/cpython | python__cpython-103331 | # Remove `Python/importlib.h`
https://github.com/python/cpython/blob/main/Python/importlib.h doesn't seem to be used anymore. I _think_ it can simply be deleted and then a quick search through the code base to remove any references (it's mentioned in some comments).
<!-- gh-linked-prs -->
### Linked PRs
* gh-103331
<... | 7f3c10650385907b5a2234edb2b1334cafd47a0a | 52f96d3ea39fea4c16e26b7b10bd2db09726bd7c |
python/cpython | python__cpython-103324 | # Get the "Current" Thread State from a Thread-local
(This is a revival of gh-84702, which @vstinner worked on several years ago.)
For a per-interpreter GIL (PEP 684) we need to start storing the "current" thread state in a thread-local variable, rather than `_PyRuntime.tstate_current`. There may be other benefits... | f8abfa331421e2c28388c5162f37820495e3c2ee | 7ef614c1adad2b8857442bf0fea649891b591109 |
python/cpython | python__cpython-103301 | # `patchcheck.py` hangs infinitely on branches with merges from `main`
# Bug report
`Tools/patchcheck/patchcheck.py` stalls on `Getting base branch for PR ...` on my Windows system if a processed branch has a moderately large diff relative to `main`.
It's easy to achieve with merging `main` into the branch. For ... | 86d20441557bedbea3dadd5d0818a492148335bd | d9305f8e9d3e0f6267286c2da4b24e97b7a569f2 |
python/cpython | python__cpython-103546 | # expose API for writing perf map files
https://github.com/python/cpython/pull/96123 added support for CPython to write `/tmp/perf-<pid>.map` files, associating instruction address ranges with a human-readable frame name for the Linux `perf` profiler.
Two external Python JIT compilers, [Cinder](https://github.com/f... | be0c106789322273f1f76d232c768c09880a14bd | 2e91c7e62609ef405901dd5c4cb9d5aa794591ab |
python/cpython | python__cpython-103307 | # `ast.get_source_segment` is slower than it needs to be because it reads every line of the source.
<!--
If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not
the right place to seek help. Consider the following options instead:
- reading the... | 36860134a9eda8df5af5a38d6c7533437c594c2f | f0ed293f6aec1c2ed22725301b77d6ccedc2d486 |
python/cpython | python__cpython-103336 | # Maximum recursion depth exceeded in __getattr__().
# Bug report
We're hitting `RecursionError: maximum recursion depth exceeded` in Django test suite with Python 3.12.0a7 when accessing an attribute with a custom `__getattr__()` method:
```
ERROR: test_access_warning (deprecation.test_storages.DefaultStorageDep... | 5d7d86f2fdbbfc23325e7256ee289bf20ce7124e | a90863c993157ae65e040476cf46abd73ae54b4a |
python/cpython | python__cpython-103267 | # Misspelling Speilberg vs. Spielberg in example code for bisect() function
The Python documentation has an example code for the `bisect` function [HERE](https://docs.python.org/3/library/bisect.html#examples). In the second example code there's the surname of the movie director Steven Spielberg written incorrectly as... | f0424ba4b6663d2a4240239266bea08aff46bb6c | a653c32d08abfa34d70186542479e3a7e704f8bd |
python/cpython | python__cpython-103286 | # hmac algorithm fallback is broken
`hmac` won't fall back if OpenSSL is available, the requested algorithm isn't in OpenSSL, but the algorithm is in `hashlib`.
If you [monkey]patch `hashlib` to include a new algorithm, you can't use that algorithm from `hmac` by name.
It appears that the OpenSSL implementation (kno... | efb0a2cf3adf4629cf4669cb558758fb78107319 | f0424ba4b6663d2a4240239266bea08aff46bb6c |
python/cpython | python__cpython-103378 | # Can't build '_ssl' extension with Python 3.11.2 and OpenSSL 3.1
# Bug report
I have tried to build latest tagged release of Python v3.11.2 on a CentOS7 system with locally built OpenSSL library v3.1.0. During configuration step ssl library and headers are properly found. When I build Python I encounter error:
``... | 35167043e3a21055a94cf3de6ceccd1585554cb8 | 0ba0ca05d2b56afa0b055db02233e703fe138918 |
python/cpython | python__cpython-103238 | # Polish documentation of pdb
# Documentation
pdb's documentation has not been polished for a while and there are a couple of issues with it.
First of all, the introductive part was pretty awkward. It starts with `pdb.run()`, which no one is using for actual debugging. I've never see a 3rd-party tutorial for pdb... | 449bf2a76b23b97a38158d506bc30d3ebe006321 | 2f41a009b7311a4b44bae5b3583cde3d6d10d8d1 |
python/cpython | python__cpython-103221 | # `ntpath.join()` adds slash to incomplete UNC drive with trailing slash
`ntpath.join()` incorrectly inserts an additional slash when joining an argument onto an incomplete UNC drive with a trailing slash:
```python
>>> import ntpath
>>> ntpath.join('\\\\server\\share\\foo\\', 'bar')
'\\\\server\\share\\foo\\bar... | b57105ae33e1f61e6bdf0eec45c4135d067b9b22 | 50b4b1598411ed393f47ce7f4fffbe5b9063cd42 |
python/cpython | python__cpython-103222 | # Redundant `if` statement in `EnumType._find_data_type_()` in `enum.py`
This statement is redundant:
https://github.com/python/cpython/blob/823622212eb258fcec467db56f6e726d841297b3/Lib/enum.py#L996-L997
in
https://github.com/python/cpython/blob/823622212eb258fcec467db56f6e726d841297b3/Lib/enum.py#L990-L997
<... | d3a7732dd54c27ae523bef73efbb0c580ce2fbc0 | 24facd60f6e5458cc783e429fe63d6a80d476f84 |
python/cpython | python__cpython-103251 | # Installation on macOS fails with "The installer encountered an error"
Thread on discuss: https://discuss.python.org/t/is-there-a-recent-mac-install-issue/23755/20
There are sporadic reports of errors during the installation of Python on macOS using our installer in which "Installer.app" gives a vague generic erro... | f184abbdc9ac3a5656de5f606faf505aa42ff391 | 30f82cf6c9bec4d9abe44f56e7ad84ef32ee2022 |
python/cpython | python__cpython-103205 | # `http.server` parses HTTP version numbers too permissively.
# `http.server` parses HTTP version numbers too permissively.
`http.server` accepts request lines with HTTP version numbers that have `'_'`, `'+'`, and `'-'`.
# Reproduction steps:
(Requires netcat)
```bash
python3 -m http.server --bind 127.0.0.1
p... | cf720acfcbd8c9c25a706a4b6df136465a803992 | 25db95d224d18fb7b7f53165aeaa87632b0230f2 |
python/cpython | python__cpython-103208 | # `zipimport.invalidate_caches()` implementation causes performance regression for `importlib.invalidate_caches()`
In Python 3.10+, [an implementation of `zipimport.invalidate_caches()` was introduced](https://github.com/python/cpython/pull/24159).
An Apache Spark developer recently identified this implementation o... | 1fb9bd222bfe96cdf8a82701a3192e45d0811555 | 6e6a4cd52332017b10c8d88fbbbfe015948093f4 |
python/cpython | python__cpython-103846 | # Tkinter: C API changes are needed for Tcl 8.7 and 9.0 value types
# Bug report
I recently made changes to [Tcl.pm](http://tcl.pm/) (a Tcl wrapper for Perl) to support Tcl 8.7/9.0 (https://github.com/gisle/tcl.pm/pull/42). While I was doing so, I briefly looked at _tkinter.c for comparison (particularly `AsObj()` an... | 94e9585e99abc2d060cedc77b3c03e06b4a0a9c4 | b278c723d79a238b14e99908e83f4b1b6a39ed3d |
python/cpython | python__cpython-103195 | # Optimise `inspect.getattr_static`
# Feature or enhancement
Following 6d59c9e, `typing._ProtocolMeta.__instancecheck__` uses `inspect.getattr_static` in a tight loop, where it had previously used `hasattr`. This improves semantics in several highly desirable ways, but causes a considerable slowdown for `_ProtocolM... | 264c00a1c512a9bd58f47c80e72e436c639763c8 | 119f67de08f1fddc2a3f7b7caac7454cb57ef800 |
python/cpython | python__cpython-103196 | # Regression tests pass but return unnecessary output (errors and warnings)
Just built python for the first time using the devguide and I noticed some (deprecation) warnings and errors in the regression tests, even though all the tests (that ran) passed.
```
/opt/python/cpython/Lib/subprocess.py:849: RuntimeWarning:... | 9d582250d8fde240b8e7299b74ba888c574f74a3 | a840806d338805fe74a9de01081d30da7605a29f |
python/cpython | python__cpython-103175 | # use vectorcall in _asyncio instead of variadic calling APIs
It is relic of past, changing it to use vectorcall will allow it to use bound method calling optimization.
<!-- gh-linked-prs -->
### Linked PRs
* gh-103175
<!-- /gh-linked-prs -->
| e6f7d35be7fb65d8624e9411251554c9dee0c931 | 385b5d6e091da454c3e0d3f7271acf3af26d8532 |
python/cpython | python__cpython-103437 | # Add a timeout to CI builds
The joke PR #103178 included some very slow code that runs at import time, and CI took >3 hours before I canceled it. This wastes resources and is a possible abuse vector; a malicious actor could use it to eat up our CI resource quota. We should have some reasonable timeout (1 hour?) for a... | be8903eb9d66ef1229f93a3a6036aeafc3bb0bda | 1aa376f946ef68ba46937019a424d925bf5b9611 |
python/cpython | python__cpython-103177 | # sys._current_exceptions() should return exceptions rather than exc_info tuples
The function ``sys._current_exceptions()`` returns a mapping of thread-id to an ``exc_info`` tuple representing that thread's handled exception. As part of the larger effort of moving away from exc_info to simple exception instances, we ... | 78b763f63032a7185c0905c319ead9e9b35787b6 | 8026cda10ccd3cbc7f7ff84dc6970266512961e4 |
python/cpython | python__cpython-103173 | # Typing: undocumented behaviour change for protocols decorated with `@final` and `@runtime_checkable` in 3.11
Python 3.11 introduced an undocumented behaviour change for protocols decorated with both `@final` and `@runtime_checkable`. On 3.10:
```pycon
>>> from typing import *
>>> @final
... @runtime_checkable
... | 62c11155eb13e950e10d660b8f5150e04efb3a5e | 3d15bd88063019352d11382f5d1b36b6845f65dc |
python/cpython | python__cpython-103168 | # `-Wstrict-prototypes` warnings on macOS
Recently, I've started noticing new issues while compiling CPython on my mac.
Something like:
```
Python/ceval_gil.c:470:40: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
unsigned long _PyEval_GetSwitchInte... | 119f67de08f1fddc2a3f7b7caac7454cb57ef800 | 1a8f862e329c3872a11d4ef8eb85cf353ca2f4d5 |
python/cpython | python__cpython-103144 | # Polish pdb help messages and doc strings
# Feature or enhancement
Make `pdb`'s help message less ugly.
# Pitch
Currently, the help message of pdb is not pretty.
```
(Pdb) h a
a(rgs)
Print the argument list of the current function.
(Pdb)
```
`a(rgs)` is a little bit confusing by itself an... | 2f41a009b7311a4b44bae5b3583cde3d6d10d8d1 | 96663875b2ea55c65e83551cdb741bbcdcaa7f21 |
python/cpython | python__cpython-103133 | # Update multiprocessing.managers.ListProxy and multiprocessing.managers.DictProxy
# Feature or enhancement
Standard lists accept `clear` as a shortcut for `del xs[:]`
```
xs = ['a']
xs.clear()
```
However, `multiprocessing.ListProxy` omitted support for `clear()`.
```
from multiprocessing import Manag... | bbb49888a752869ae93423c42039a3a8dfab34d4 | 1db4695644388817c727db80cbbd38714cc5125d |
python/cpython | python__cpython-103125 | # Support multi-line statements in pdb
# Feature or enhancement
Support multi-line statements in pdb just like in normal Python interactive shells
# Pitch
Currently, we have this:
```
(Pdb) def f():
*** IndentationError: expected an indented block after function definition on line 1
(Pdb)
```
We can ... | 25a64fd28aaaaf2d21fae23212a0554c24fc7b20 | a4056c8f9c2d9970d39e3cb6bffb255cd4b8a42c |
python/cpython | python__cpython-103113 | # Wrong parameter name in http.client.read documentation: “amt” vs “n”
# Documentation
`pydoc http.client.HTTPResponse.read``
results in help text:
```
http.client.HTTPResponse.read = read(self, amt=None)
Read and return up to n bytes.
```
The parameter is called “amt” but the help text refers to “n”.... | d052a383f1a0c599c176a12c73a761ca00436d8b | e375bff03736f809fbc234010c087ef9d7e0d384 |
python/cpython | python__cpython-103110 | # Improve the documentation for `ignore_warnings`
# Documentation
Recently, I found that using `ignore_warnings(*, category)`, a simple decorator in `test.support.warning_helper`, is sometimes a concise way to suppress warnings in test cases. For example:
```python
# use `with` statement
def test_suppress_warn... | 32937d6aa414ec7db5c63ef277f21db1880b3af4 | 6883007a86bdf0d7cf4560b949fd5e577dab1013 |
python/cpython | python__cpython-103100 | # Link mypy docs from typing.rst
The mypy documentation is the best documentation there is for the Python type system. We should link users to it.
In the long run, typing.readthedocs.io could be a better home, but that shouldn't stop us from helping users today. In my opinion the most likely outcome is that typing.... | fda95aa19447fe444ac2670afbf98ec42aca0c6f | dcd6f226d6596b25b6f4004058a67acabe012120 |
python/cpython | python__cpython-103098 | # Windows ARM64 builds fail index tests
Due to a compiler bug, some functionality involving large integers fail on ARM64. Bug details at https://developercommunity.visualstudio.com/t/Regression-in-MSVC-1433-1434-ARM64-co/10224361
The issue has been fixed, but has not been released in the last three months. So I'm g... | 24ba507b1dd70cf468a1beadea6ca6336fe1d40f | ba65a065cf07a7a9f53be61057a090f7311a5ad7 |
python/cpython | python__cpython-103093 | # Isolate Stdlib Extension Modules
See [PEP 687](https://peps.python.org/pep-0687/).
Currently most stdlib extension have been ported to multi-phase init. There are still a number of them to be ported, almost entirely non-builtin modules. Also, some that have already been ported still have global state that needs... | 52f96d3ea39fea4c16e26b7b10bd2db09726bd7c | 411b1692811b2ecac59cb0df0f920861c7cf179a |
python/cpython | python__cpython-103095 | # Add a C API to assign a new version to a PyTypeObject
# Feature or enhancement
I would like to add an API function like this:
```
/* Attempt to assign a version tag to the given type.
*
* Returns 1 if the type already had a valid version tag or a new one was
* assigned, or 0 if a new tag could not be assi... | b7f4811c88609d1ff12f42a3335fda49f8a478f3 | dca27a69a8261353f7f986eb8f808f0d487ac4b7 |
python/cpython | python__cpython-103325 | # If the working directory and the venv are on different disks, venv doesn't work in bash on Windows
**Environment**
- OS: Windows 10
- Architecture: x86_64
- Shell: bash 4.4.23, part of the git 2.37.0 install
- Python version: 3.11.1
- Output of `path/to/python -m pip list`:
```console
Package Version
... | ebc81034278ea186b4110c7dbf6d1c2a0ada9398 | b57105ae33e1f61e6bdf0eec45c4135d067b9b22 |
python/cpython | python__cpython-103086 | # python version locale.getencoding() warns deprecation and advice to use getencoding() again
<!--
If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not
the right place to seek help. Consider the following options instead:
- reading the Pytho... | 21e9de3bf0ecf32cd61296009518bfb9fdfcd04f | fda95aa19447fe444ac2670afbf98ec42aca0c6f |
python/cpython | python__cpython-103083 | # Implement and document PEP 669.
Now that PEP 669 is accepted, it needs to be implemented and documented.
- [x] Implement the PEP
- [x] Decide on and implement policy for monitors seeing the code in other monitors.
- [x] Document the PEP
- [ ] Use "macro" instructions to reduce code duplication in bytecodes.c... | 411b1692811b2ecac59cb0df0f920861c7cf179a | dce2d38cb04b541bad477ccc1040a68fa70a9a69 |
python/cpython | python__cpython-103069 | # pdb's breakpoint should check if condition is a valid expression
This could be either a bug report or a feature request. `pdb` has conditional breakpoint feature where you can set a condition for the breakpoint to be effective. You can also use `condition` command to change it.
The problem is - it never checks wh... | e375bff03736f809fbc234010c087ef9d7e0d384 | d835b3f05de7e2d800138e5969eeb9656b0ed860 |
python/cpython | python__cpython-103777 | # site.py documentation does not mention special objects help, quit etc added to builtins
The [site.py](https://docs.python.org/3/library/site.html) documentation does not mention the special objects that it adds to builtins:
* help
* quit and exit
* license viewer
* copyright and credit strings.
(Have I miss... | 67957ea77da8c667df1508a9d3d9b39e59f671d6 | d359c7c47b7e713cfbf7ba335d96b5f45e0f13e3 |
python/cpython | python__cpython-112473 | # Provide a script to create a complete WASI build
https://github.com/brettcannon/cpython-wasi-build currently constructs a zip file that one can use to run CPython when built for WASI. But the bundling of everything together is slightly finicky, so having a script or command in `wasm_build.py` that constructs the zip... | 37589d76bbe97b0bf13ffafb8dd6aab361a0209a | d4a6229afe10d7e5a9a59bf9472f36d7698988db |
python/cpython | python__cpython-103058 | # gc.freeze documentation is unclear
# Documentation
The [current advice](https://docs.python.org/3/library/gc#gc.freeze) seems to mean you should `gc.disable()` and `gc.freeze()` right before `os.fork()`, which doesn't do anything.
Łukasz explained the advice in https://bugs.python.org/issue31558#msg302780.
... | 8b1b17134e2241a8cdff9e0c869013a7ff3ca2fe | 40db5c65b7ca4e784613b6122106a92576aba2d6 |
python/cpython | python__cpython-103062 | # Enum._generate_next_value_ should be static
# Bug report
[Here](https://github.com/python/cpython/blob/2cdc5189a6bc3157fddd814662bde99ecfd77529/Lib/enum.py#L1149) and in two more places in the same file function `_generate_next_value_` supposed to be called for instance. But it will not work properly in that case... | b838d80085b0162cc2ae7b4db5d2a9d9c6a28366 | 56d055a0d81a809e4ff8e1d56756a3bf32317efb |
python/cpython | python__cpython-103055 | # Improve test cases for type substitution of a list of types after initial ParamSpec substitution
After merging https://github.com/python/cpython/pull/102808 I realized that I've missed several important cases.
Right now substitution algorithm has these lines: https://github.com/python/cpython/blob/2cdc5189a6bc315... | 60bdc16b459cf8f7b359c7f87d8ae6c5928147a4 | 24ba507b1dd70cf468a1beadea6ca6336fe1d40f |
python/cpython | python__cpython-103170 | # test_tools: test_freeze_simple_script() times out after 15 min: --with-lto --enable-optimizations (s390x LTO buildbots)
Reproduction:
1. `make clean && ./configure --with-lto --enable-optimizations && make`
2. `./python.exe -E ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=900 ... | f68f2fec7df1224a031c3feed8a0ef6028cfcddd | 5ac97957f72d42d5bc3ec658b4321cc207cb038e |
python/cpython | python__cpython-103047 | # dis.disco()/dis.dis() does not show current line correctly with CACHE entries
Now with CACHE entries, the `lasti` could point to a CACHE entry and current line indicator will be confused.
```python
import dis
def f():
print(a)
dis.disco(f.__code__, lasti=2)
dis.disco(f.__code__, lasti=4)
```
will d... | 34eb6f727632d9a1a6998f90c9421e420c785643 | 36067532467ec58c87ac9c140e555e1866431981 |
python/cpython | python__cpython-103028 | # Outdated `dataclass.make_dataclass` docstring
This docstring line in `make_dataclass` is outdated:
https://github.com/python/cpython/blob/1fd603fad20187496619930e5b74aa7690425926/Lib/dataclasses.py#L1424-L1425
There are new parameters: `kw_only`, `slots`, `weakref_slot` that are not mentioned.
I will send a P... | 8ec6486462b920ab92ecb685a79fc3446681e1b8 | 0708437ad043657f992cb985fd5c37e1ac052f93 |
python/cpython | python__cpython-103026 | # [ctypes documentation issues] varadic typo and doctest directive mistake
# Documentation
Two issues on https://docs.python.org/3/library/ctypes.html
Issue 1: typo "Calling varadic functions" => should be "variadic"
Issue 2:
`
# Enhancement Request:
The current version of [`sqlite3.Connection.load_extension()`](https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.load_extension) takes in a single parameter `path`. However, the underlying C API... | 222c63fc6b91f42e7cc53574615f4e9b7a33c28f | 28a05f4cc2b150b3ff02ec255daf1b6ec886ca6f |
python/cpython | python__cpython-103005 | # Dataclasses - Improve the performance of asdict/astuple for common types and default values
# Feature or enhancement
Improve the performance of asdict/astuple in common cases by making a shortcut for common types that are unaffected by deepcopy in the inner loop. Also special casing for the default `dict_factory=... | d034590294d4618880375a6db513c30bce3e126b | f80014a9b0e8d00df3e65379070be1dfd2721682 |
python/cpython | python__cpython-102998 | # Update Windows and MacOS installers to SQLite 3.41.2+.
Updating Windows and MacOS installers to SQLite 3.41.2, see [release notes](https://sqlite.org/releaselog/3_41_2.html).
There is a small [bugfix](https://www.sqlite.org/src/info/76e683c5f25fe047) in the `3.41` branch, so we can wait 2-3 weeks for SQLite 3.41.... | f0ad4567319ee4ae878d570ab7709ab63df9123e | 9de0cf20fa0485e327e57cc0864c7476da85cfad |
python/cpython | python__cpython-103074 | # Profile docs has error in example in tldr
# Documentation
https://docs.python.org/3/library/profile.html
The following example is given in the Instant User's Manual section:
```
214 function calls (207 primitive calls) in 0.002 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall ... | 55decb72c4d2e4ea00ed13da5dd0fd22cecb9083 | 32937d6aa414ec7db5c63ef277f21db1880b3af4 |
python/cpython | python__cpython-102981 | # Improve test coverage on pdb
# Feature or enhancement
Add more tests on pdb module
# Pitch
The coverage on pdb module is poor - some of the commands are not tested at all. There are at least some low hanging fruits that we can do.
<!-- gh-linked-prs -->
### Linked PRs
* gh-102981
* gh-103016
* gh-103017
... | ded9a7fc194a1d5c0e38f475a45f8f77dbe9c6bc | f2e5a6ee628502d307a97f587788d7022a200229 |
python/cpython | python__cpython-103228 | # unittest.mock.patch with autospec doesn't hold for classmethods nor staticmethods
# Bug report
Using `patch` with `autospec=True` does not work when a method is decorated with `@classmethod` or `@staticmethod`. The resulting mock can be called with any arguments without raising a `TypeError`.
Example:
```pyth... | 59e0de4903c02e72b329e505fddf1ad9794928bc | 19d2639d1e6478e2e251479d842bdfa2e8272396 |
python/cpython | python__cpython-102975 | # Add a dev container to the repository
Originally discussed at https://discuss.python.org/t/add-support-for-devcontainers-to-facilitate-github-codespaces-usage/21330 , the idea is to get to the point where we can have [GitHub Codespaces prebuilds](https://docs.github.com/en/codespaces/prebuilding-your-codespaces/abou... | 0b1d9c44f1f091a499856d81542eeafda25011e1 | d052a383f1a0c599c176a12c73a761ca00436d8b |
python/cpython | python__cpython-103565 | # Regression in zipfile, read1(-1) after seek() returns empty byte string
# Bug report
When debugging a test failure in https://pypi.org/project/fs/ I found a regression in `zipfile`, read1(-1) after seek() returns empty byte string instead of substring. I've bisected it into this commit 330f1d58282517bdf1f19577ab9... | c73b0f35602abf5f283bf64266641f19bc82fce0 | e5168ff3f8abe651d0a96d9e2d49028183e21b15 |
python/cpython | python__cpython-102953 | # Implement PEP 706 – Filter for tarfile.extractall
This issue tracks implementation of [PEP 706](https://peps.python.org/pep-0706/) – Filter for tarfile.extractall
- [x] Fix WASI tests (or at least understand and document the symlink behavior)
<!-- gh-linked-prs -->
### Linked PRs
* gh-102953
* gh-103832
* ... | af530469954e8ad49f1e071ef31c844b9bfda414 | 36860134a9eda8df5af5a38d6c7533437c594c2f |
python/cpython | python__cpython-102948 | # Bad traceback when `dataclasses.fields` is called on a non-dataclass
Currently, if you call `dataclasses.fields` on a non-dataclass, quite a poor traceback is produced:
```pycon
>>> import dataclasses
>>> dataclasses.fields(object)
Traceback (most recent call last):
File "C:\Users\alexw\AppData\Local\Progra... | baf4eb083c09b323cc12b8636c28c14089b87de8 | 08254be6c5324416081cc28a047b377e1f4ed644 |
python/cpython | python__cpython-102944 | # test case test_socket failed on Windows with non English locale
On Windows (tested on Win11) with non English locale (zh-CN), test_socket will be failed with this error message:
```
Traceback (most recent call last):
File "C:\Users\xxxxxx\source\cpython\Lib\test\test_socket.py", line 2567, in testCreateHyperV... | bf42eb8722befddf099a7bc26ea4a258179c32bf | adb0621652f489033b9db8d3949564c9fe545c1d |
python/cpython | python__cpython-102942 | # New warning: "‘subobj’ may be used uninitialized in this function" in `Objects/bytes_methods.c`
Example:
<img width="662" alt="Снимок экрана 2023-03-23 в 12 05 59" src="https://user-images.githubusercontent.com/4660275/227154730-efd0169d-fb5d-4bb6-bbb6-72ba7cc5159f.png">
This looks like a false-positive, because... | 2cdc5189a6bc3157fddd814662bde99ecfd77529 | 30a306c2ade6c2af3c0b1d988a17dae3916e0d27 |
python/cpython | python__cpython-102940 | # New warnings in `bltnsmodule.c`: "conversion from 'Py_ssize_t' to 'long'"
After https://github.com/python/cpython/commit/7559f5fda94ab568a1a910b17683ed81dc3426fb#diff-e4fd8b8ee6a147f86c0719ff122aca6dfca36edbd4812c87892698b3b72e40a1 there are two new warnings on GH:
<img width="908" alt="Снимок экрана 2023-03-23 в... | 0f2ba6580565c3b51396c840406211ad81297735 | 87be8d95228ee95de9045cf2952311d20dc5de45 |
python/cpython | python__cpython-102937 | # Typing: Document performance pitfalls of protocols decorated with `@runtime_checkable`
# Documentation
The following two calls look similar, but the second is dramatically slow compared to the first:
```python
from typing import SupportsInt
isinstance(3, int)
isinstance(3, SupportsInt)
```
The reason ... | 58d2b30c012c3a9fe5ab747ae47c96af09e0fd15 | 46957091433bfa097d7ea19b177bf42a52412f2d |
python/cpython | python__cpython-102922 | # `ExceptionGroup.derive` example uses different argument name than base class specifies
# Documentation
## Link
https://docs.python.org/3/library/exceptions.html#BaseExceptionGroup.derive
## Description
The type for the `derive` method is specified as:
```python
derive(excs)
```
The type hints for der... | 9b19d3936d7cabef67698636d2faf6fa23a95059 | 3468c768ce5e467799758ec70b840da08c3c1da9 |
python/cpython | python__cpython-102901 | # Link to wrong function in sys.getfilesystemencoding to get filesystem error handler
# Documentation
The doc of the `sys.getfilesystemencoding` function indicates:
> [...] the encoding used with the [filesystem error handler](https://docs.python.org/3/glossary.html#term-filesystem-encoding-and-error-handler) to... | fdd0fff277a55c010a4da0a7af0e986e38560545 | 5e7c468fc4ceb801c30844b794e04a2ac6a35743 |
python/cpython | python__cpython-102896 | # code.interact() will exit the whole process when given exit() or quit()
`code.interact()` is provided as a method to embed an interactive shell in arbitrary python code. It was used in `pdb` for `interact` command.
However, when the user needs to exit, they probably will use a very familiar command `exit()` (or `... | e6eb8cafca441046b5f9ded27c68d9a84c42022a | cb1bf89c4066f30c80f7d1193b586a2ff8c40579 |
python/cpython | python__cpython-102877 | # Redundant parens in itertools.batched recipe
# Documentation
```
def batched(iterable, n):
# batched('ABCDEFG', 3) --> ABC DEF G
if n < 1:
raise ValueError('n must be at least one')
it = iter(iterable)
while (batch := tuple(islice(it, n))):
yield batch
```
The parenthese... | 4bb1dd3c5c14338c9d9cea5988431c858b3b76e0 | 3bb475662ba998e1b2d26fa370794d0804e33927 |
python/cpython | python__cpython-102875 | # logging module LogRecord can accept non-str msg but it's not documented
# Documentation
In the documentation of the logging `LogRecord` it's mentioned that it accepts msg as str argument:
https://docs.python.org/3/library/logging.html#logging.LogRecord
But just below that it explains that in `getMessage`:
... | f2e5a6ee628502d307a97f587788d7022a200229 | acfe02f3b05436658d92add6b168538b30f357f0 |
python/cpython | python__cpython-102872 | # Cleanup and Modernize webbrowser
# Feature or enhancement
Certain browsers supported by webbrowser are now completely obsolete (and in some cases, have been for over 20 years).
I suggest to remove support for historical browsers from webbrowser, as they aren't used today, and it leaves us with a simpler and mo... | b0422e140df8fdc83c51cc64a3ed5426188de7f1 | 048d6243d45b9381dd4fcaad28ae9c5d443b8b4b |
python/cpython | python__cpython-102861 | # test.compile.test_stack_overflow is very slow
It's because of the quadratic performance of instr_sequence_to_cfg, which is easy to fix.
<!-- gh-linked-prs -->
### Linked PRs
* gh-102861
<!-- /gh-linked-prs -->
| 8d015fa000db5775d477cd04dc574ba13721e278 | d1b883b52a99427d234c20e4a92ddfa6a1da8880 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.