summaryrefslogtreecommitdiffstats
path: root/Misc
Commit message (Collapse)AuthorAgeFilesLines
* gh-98415: Fix uuid.getnode() ifconfig implementation (#98423)Chaim Sanders2022-11-021-0/+1
| | | | | | | | | The uuid.getnode() function has multiple implementations, tested sequentially. The ifconfig implementation was incorrect and always failed: fix it. In practice, functions of libuuid library are preferred, if available: uuid_generate_time_safe(), uuid_create() or uuid_generate_time(). Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* gh-98790: When DLLs directory is missing on Windows, assume executable_dir ↵Steve Dower2022-11-021-0/+2
| | | | contains PYD files instead (GH-98936)
* gh-99016: Make build scripts compatible with Python 3.8 (GH-99017)Serhiy Storchaka2022-11-021-0/+1
|
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-021-0/+2
|
* gh-98989: configure: add 3.11 to list of Pythons (#98988)Jelle Zijlstra2022-11-021-0/+1
| | | | | Closes #98989 Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-98903: Test suite fails with exit code 4 if no tests ran (#98904)Victor Stinner2022-11-021-0/+2
| | | | | | | The Python test suite now fails wit exit code 4 if no tests ran. It should help detecting typos in test names and test methods. * Add "EXITCODE_" constants to Lib/test/libregrtest/main.py. * Fix a typo: "NO TEST RUN" becomes "NO TESTS RAN"
* gh-98925: Lower marshal recursion depth for WASI (GH-98938)Brett Cannon2022-11-011-0/+2
| | | | | For wasmtime 2.0, the stack depth cost is 6% higher. This causes the default max `marshal` recursion depth to blow the stack. As the default marshal depth is 2000 and Windows is set to 1000, split the difference and choose 1500 for WASI to be safe.
* gh-98689: Update Windows builds to zlib v1.2.13 (GH-98968)Zachary Ware2022-11-011-0/+2
|
* gh-98931: Improve error message when the user types 'import x from y' ↵Pablo Galindo Salgado2022-11-011-0/+2
| | | | instead of 'from y import x' (#98932)
* gh-98852: Fix subscription of type aliases (GH-98920)Serhiy Storchaka2022-11-011-0/+4
| | | | | Fix subscription of type aliases containing bare generic types or types like TypeVar: for example tuple[A, T][int] and tuple[TypeVar, T][int], where A is a generic type, and T is a type variable.
* gh-98658: Add __class_getitem__ to array.array (#98661)Jelle Zijlstra2022-11-011-0/+2
| | | Closes #98658
* GH-98897: fix memory leak if `math.dist` raises exception (GH-98898)Kumar Aditya2022-11-011-0/+1
|
* gh-98692: Enable treating shebang lines as executables in py.exe launcher ↵Steve Dower2022-10-311-0/+2
| | | | (GH-98732)
* gh-98610: Adjust the Optional Restrictions on Subinterpreters (GH-98618)Eric Snow2022-10-311-0/+9
| | | | | | | Previously, the optional restrictions on subinterpreters were: disallow fork, subprocess, and threads. By default, we were disallowing all three for "isolated" interpreters. We always allowed all three for the main interpreter and those created through the legacy `Py_NewInterpreter()` API. Those settings were a bit conservative, so here we've adjusted the optional restrictions to: fork, exec, threads, and daemon threads. The default for "isolated" interpreters disables fork, exec, and daemon threads. Regular threads are allowed by default. We continue always allowing everything For the main interpreter and the legacy API. In the code, we add `_PyInterpreterConfig.allow_exec` and `_PyInterpreterConfig.allow_daemon_threads`. We also add `Py_RTFLAGS_DAEMON_THREADS` and `Py_RTFLAGS_EXEC`.
* gh-98410: move getbufferproc and releasebufferproc to buffer.h (#31158)David Hewitt2022-10-312-0/+5
| | | This adds them to the Limited API.
* gh-98878: Use builtins from the bound frame when offering a suggestion (#98880)Batuhan Taskaya2022-10-311-0/+2
|
* gh-98811: use full source location to simplify __future__ imports error ↵Irit Katriel2022-10-311-0/+4
| | | | checking. This also fixes an incorrect error offset. (GH-98812)
* gh-96151: Use a private name for passing builtins to dataclass. This now ↵Shantanu2022-10-311-0/+1
| | | | allows for a field named BUILTIN (gh-98143)
* gh-97966: Update uname docs to clarify the special nature of the platform ↵Jason R. Coombs2022-10-301-0/+2
| | | | attribute and to indicate when it became late-bound. (#97972)
* gh-96853: Restore test coverage for Py_Initialize(Ex) (GH-98212)Nick Coghlan2022-10-302-0/+7
| | | | | | | | | | | * As most of `test_embed` now uses `Py_InitializeFromConfig`, add a specific test case to cover `Py_Initialize` (and `Py_InitializeEx`) * Rename `_testembed` init helper to clarify the API used * Add a `PyConfig_Clear` call in `Py_InitializeEx` to make the code more obviously correct (it already didn't leak as none of the dynamically allocated config fields were being populated, but it's clearer if the wrappers follow the documented API usage guidelines)
* gh-98783: Fix crashes when `str` subclasses are used in `_PyUnicode_Equal` ↵Nikita Sobolev2022-10-301-0/+2
| | | | (#98806)
* gh-98793: Fix typecheck in `overlapped.c` (#98835)Charlie Zhao2022-10-301-0/+1
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-90352: fix _SelectorDatagramTransport to inherit from DatagramTransport ↵Kumar Aditya2022-10-291-0/+1
| | | | (#98844)
* gh-98744: Prevent column-level decoding crashes on traceback module (#98824)Batuhan Taskaya2022-10-291-0/+2
|
* gh-84538: add strict argument to pathlib.PurePath.relative_to (GH-19813)domragusa2022-10-282-0/+2
| | | | | | | | | | | | | | | | | | | | | | | By default, :meth:`pathlib.PurePath.relative_to` doesn't deal with paths that are not a direct prefix of the other, raising an exception in that instance. This change adds a *walk_up* parameter that can be set to allow for using ``..`` to calculate the relative path. example: ``` >>> p = PurePosixPath('/etc/passwd') >>> p.relative_to('/etc') PurePosixPath('passwd') >>> p.relative_to('/usr') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "pathlib.py", line 940, in relative_to raise ValueError(error_message.format(str(self), str(formatted))) ValueError: '/etc/passwd' does not start with '/usr' >>> p.relative_to('/usr', strict=False) PurePosixPath('../etc/passwd') ``` https://bugs.python.org/issue40358 Automerge-Triggered-By: GH:brettcannon
* gh-92452: Avoid race in initialization of sysconfig._CONFIG_VARSGareth Rees2022-10-281-0/+2
| | | Co-authored-by: Filipe Laíns <lains@riseup.net>
* gh-98776: Fix make regen-test-levenshtein for out-of-tree builds (GH-98779)Miro Hrončok2022-10-281-0/+1
| | | | | Fixes https://github.com/python/cpython/issues/98776 Automerge-Triggered-By: GH:erlend-aasland
* gh-98745: Allow py.exe launcher to install 3.11 by default and 3.12 on ↵Steve Dower2022-10-281-0/+1
| | | | request (GH-98780)
* gh-98624 Add mutex to unittest.mock.NonCallableMock (#98688)noah-weingarden2022-10-281-0/+2
| | | | | | | | | | | * Added lock to NonCallableMock in unittest.mock * Add blurb * Nitpick blurb * Edit comment based on @Jason-Y-Z's review * Add link to GH issue
* gh-98739: Update libexpat from 2.4.9 to 2.5.0 (#98742)Shaun Walbridge2022-10-271-0/+1
| | | | | * Update libexpat from 2.4.9 to 2.5.0 to address CVE-2022-43680. Co-authored-by: Shaun Walbridge <shaun.walbridge@gmail.com>
* GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. (GH-96801)Mark Shannon2022-10-271-0/+2
| | | | Change FOR_ITER to have the same stack effect regardless of whether it branches or not. Performance is unchanged as FOR_ITER (and specialized forms jump over the cleanup code).
* gh-98586: Add vector call APIs to the Limited API (GH-98587)Wenzel Jakob2022-10-272-0/+13
| | | Expose the facilities for making vector calls through Python's limited API.
* gh-98703: Fix asyncio proactor_events calling _call_connection_lost multiple ↵Ken Jin2022-10-271-0/+2
| | | | | times (GH-98704) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-98608: Change _Py_NewInterpreter() to _Py_NewInterpreterFromConfig() ↵Eric Snow2022-10-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | (gh-98609) (see https://github.com/python/cpython/issues/98608) This change does the following: 1. change the argument to a new `_PyInterpreterConfig` struct 2. rename the function to `_Py_NewInterpreterFromConfig()`, inspired by `Py_InitializeFromConfig()` (takes a `_PyInterpreterConfig` instead of `isolated_subinterpreter`) 3. split up the boolean `isolated_subinterpreter` into the corresponding multiple granular settings * allow_fork * allow_subprocess * allow_threads 4. add `PyInterpreterState.feature_flags` to store those settings 5. add a function for checking if a feature is enabled on an opaque `PyInterpreterState *` 6. drop `PyConfig._isolated_interpreter` The existing default (see `Py_NewInterpeter()` and `Py_Initialize*()`) allows fork, subprocess, and threads and the optional "isolated" interpreter (see the `_xxsubinterpreters` module) disables all three. None of that changes here; the defaults are preserved. Note that the given `_PyInterpreterConfig` will not be used outside `_Py_NewInterpreterFromConfig()`, nor preserved. This contrasts with how `PyConfig` is currently preserved, used, and even modified outside `Py_InitializeFromConfig()`. I'd rather just avoid that mess from the start for `_PyInterpreterConfig`. We can preserve it later if we find an actual need. This change allows us to follow up with a number of improvements (e.g. stop disallowing subprocess and support disallowing exec instead). (Note that this PR adds "private" symbols. We'll probably make them public, and add docs, in a separate change.)
* gh-98713: Use `@cpython_only` for a test that fails on PyPy (#98714)Nikita Sobolev2022-10-261-0/+3
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-90716: add _pylong.py module (#96673)Neil Schemenauer2022-10-261-0/+3
| | | | | | | | | | | | Add Python implementations of certain longobject.c functions. These use asymptotically faster algorithms that can be used for operations on integers with many digits. In those cases, the performance overhead of the Python implementation is not significant since the asymptotic behavior is what dominates runtime. Functions provided by this module should be considered private and not part of any public API. Co-author: Tim Peters <tim.peters@gmail.com> Co-author: Mark Dickinson <dickinsm@gmail.com> Co-author: Bjorn Martinsson
* docs: Change links to label refs (#98454)Stanley2022-10-261-2/+1
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-91058: Add error suggestions to 'import from' import errors (#98305)Pablo Galindo Salgado2022-10-251-0/+3
|
* gh-94328: Update Windows installer to use SQLite 3.39.4 (#98640)Erlend E. Aasland2022-10-251-0/+1
|
* GH-87390: Add remaining tests for PEP 646 (#98267)Matthew Rahtz2022-10-251-0/+1
| | | Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* gh-93696: Locate frozen module source with __file__ (#93697)James Gerity2022-10-251-0/+1
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-94328: Update macOS installer to use SQLite 3.39.4. (#98639)Erlend E. Aasland2022-10-251-0/+1
|
* Python 3.12.0a1v3.12.0a1Thomas Wouters2022-10-24594-1265/+6194
|
* GH-89237: fix hang in proactor `subprocess.wait_closed()` (#98572)Kumar Aditya2022-10-241-0/+1
|
* gh-91524: Speed up the regular expression substitution (#91525)Serhiy Storchaka2022-10-231-0/+3
| | | | | | | | | Functions re.sub() and re.subn() and corresponding re.Pattern methods are now 2-3 times faster for replacement strings containing group references. Closes #91524 Primarily authored by serhiy-storchaka Serhiy Storchaka Minor-cleanups-by: Gregory P. Smith [Google] <greg@krypto.org>
* Fix typo in news entry (#98361)Ikko Ashimine2022-10-221-1/+1
| | | ouput -> output
* gh-95027: Fix regrtest stdout encoding on Windows (#98492)Victor Stinner2022-10-211-0/+4
| | | | | | On Windows, when the Python test suite is run with the -jN option, the ANSI code page is now used as the encoding for the stdout temporary file, rather than using UTF-8 which can lead to decoding errors.
* gh-91051: allow setting a callback hook on PyType_Modified (GH-97875)Carl Meyer2022-10-211-0/+2
|
* gh-97514: Don't use Linux abstract sockets for multiprocessing (#98501)Gregory P. Smith2022-10-201-0/+15
| | | | | | | | | | | | | | | Linux abstract sockets are insecure as they lack any form of filesystem permissions so their use allows anyone on the system to inject code into the process. This removes the default preference for abstract sockets in multiprocessing introduced in Python 3.9+ via https://github.com/python/cpython/pull/18866 while fixing https://github.com/python/cpython/issues/84031. Explicit use of an abstract socket by a user now generates a RuntimeWarning. If we choose to keep this warning, it should be backported to the 3.7 and 3.8 branches.
* gh-97912: Avoid quadratic behavior when adding LOAD_FAST_CHECK (GH-97952)Dennis Sweeney2022-10-201-0/+1
| | | | | * The compiler analyzes the usage of the first 64 local variables all at once using bit masks. * Local variables beyond the first 64 are only partially analyzed, achieving linear time.