cpython
cpython copied to clipboard
The Python programming language
I do Python interviewing, and part of one of our interviews has folks parsing URLs. I've noticed people gloss over the `._replace` at the end of the examples in https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse...
**Bug Description:** The code will re-scan the newly generated content after replacing the variable. If a variable is defined to contain itself (i.e., a recursive definition), this process will fall...
* Fix potential infinite recursion and/or memory consumption. * Fix a bug when reference can cross boundaries of substitutions, e.g. expandvars('$a)', {'a': '$(b', 'b': 'c'}). * Fix potential quadratic complexity....
# Crash report ### What happened? Take the following simple example C extension: ```c #define PY_SSIZE_T_CLEAN #include typedef struct { PyObject_HEAD /* Type-specific fields go here. */ } CustomObject; static...
…ter` have some positional-only arguments ```python import csv with open("example.csv", "w", newline='') as csvfile: csv.writer(csvfile=csvfile) # TypeError: expected at least 1 argument, got 0 ``` ```python import csv csv.reader(csvfile="a") #...
# Documentation > [!CAUTION] > For new contributors, please do **not** consider this issue as an "easy" one. While the changes may seem mechanical, they are not necessarily trivial as...
This is a revised version of [PR #103033](https://github.com/python/cpython/pull/103033), implementing two new methods in `zipfile.ZipFile`: `remove()` and `repack()`, as suggested in [this comment](https://github.com/python/cpython/pull/103033#issuecomment-1490705652). ## Features ### `ZipFile.remove(zinfo_or_arcname)` * Removes a file...
Yet another IPv6 bug fix. Instead of using the helper functions here, I've found a regex in the code, it looks like this: ```python cut_port_re = re.compile(r":\d+$", re.ASCII) ``` This...
# Bug report ### Bug description: **Bug Description:** When debugging in Python using pdb, I set a breakpoint at a line with a list comprehension. However, when I use `n`...
The include is too big (one string) and translations leave it untranslated. ---- 📚 Documentation preview 📚: https://cpython-previews--133868.org.readthedocs.build/