Commit graph

113829 commits

Author SHA1 Message Date
Victor Stinner 47e35625ff
gh-84623: Remove unused imports (#94132) 2022-06-22 19:14:27 +02:00
partev 8661c5053f
gh-94114: Remove obsolete reference to python.org mirrors (GH-94115)
* gh-94114
2022-06-22 09:55:06 -07:00
Illia Volochii d36954b7ea
gh-91172: Create a workflow for verifying bundled pip and setuptools (GH-31885)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-06-22 15:32:22 +02:00
Jason R. Coombs c029b552f3
gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxiliary importers. (GH-93962)
Co-authored-by: Brett Cannon <brett@python.org>
2022-06-22 14:05:45 +02:00
fikotta ca308c13da
Fix typo in _io.TextIOWrapper Clinic input (#94037)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-06-22 14:02:14 +02:00
chgnrdv dc8e1d0390
gh-94101 Disallow instantiation of SSLSession objects (GH-94102)
Fixes #94101

Automerge-Triggered-By: GH:tiran
2022-06-22 03:10:22 -07:00
Serhiy Storchaka fda4b2f063
gh-74696: Do not change the current working directory in shutil.make_archive() if possible (GH-93160)
It is no longer changed when create a zip or tar archive.

It is still changed for custom archivers registered with shutil.register_archive_format()
if root_dir is not None.

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-06-22 10:47:25 +02:00
Mark Shannon f805d37641
Stats: Add summary of top instructions for misses and deferred specialization. (GH-94072) 2022-06-22 08:50:02 +01:00
Carl Bordum Hansen 9a479c3c10
gh-88123: Implement new Enum __contains__ (GH-93298)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-06-22 00:04:04 -07:00
Irit Katriel 6575841266
bpo-30535: [doc] state that sys.meta_path is not empty by default (GH-94098)
Co-authored-by: Windson yang <wiwindson@outlook.com>
2022-06-21 23:03:08 +01:00
Gregory P. Smith 296e4efebb
gh-89336: Remove configparser APIs that were deprecated for 3.12 (#92503)
https://github.com/python/cpython/issue/89336: Remove configparser 3.12 deprecations.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-06-21 14:31:25 -07:00
Gregory P. Smith 4abab6b603
gh-87389: Fix an open redirection vulnerability in http.server. (#93879)
Fix an open redirection vulnerability in the `http.server` module when
an URI path starts with `//` that could produce a 301 Location header
with a misleading target.  Vulnerability discovered, and logic fix
proposed, by Hamza Avvan (@hamzaavvan).

Test and comments authored by Gregory P. Smith [Google].
2022-06-21 13:16:57 -07:00
Thomas A Caswell 0709586744
DOC: correct bytesarray -> bytearray in comments (GH-92410) 2022-06-21 22:04:03 +02:00
Ezio Melotti f28ec34c5c
gh-82927: Update files related to HTML entities. (GH-92504) 2022-06-21 22:03:12 +02:00
Jelle Zijlstra 4e08fbcfdf
gh-93021: Fix __text_signature__ for __get__ (GH-93023)
Because of the way wrap_descr_get is written, the second argument
to __get__ methods implemented through the wrapper is always
optional.
2022-06-21 21:45:38 +02:00
max dd5cf84f24
Tutorial: specify match cases don't fall through (GH-93615) 2022-06-21 21:44:09 +02:00
paulreece 51d673176a
gh-93240: clarify wording in IO tutorial (GH-93276)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-06-21 21:40:11 +02:00
Mark Dickinson 420f0df862
Minor optimization for Fractions.limit_denominator (GH-93730)
When we construct the upper and lower candidates in limit_denominator,
the numerator and denominator are already relatively prime (and the
denominator positive) by construction, so there's no need to go through
the usual normalisation in the constructor. This saves a couple of
potentially expensive gcd calls.

Suggested by Michael Scott Asato Cuthbert in GH-93477.
2022-06-21 21:36:35 +02:00
luzpaz 830513754d
gh-93675: Fix typos in Doc/ (GH-93676)
Closes #93675
2022-06-21 21:10:45 +02:00
Oleg Iarygin f62ff97f31
gh-93851: Fix all broken links in Doc/ (GH-93853) 2022-06-21 20:55:18 +02:00
MilanJuhas 7327d61abe
Closes gh-94038: Update Release Schedule in README.rst from PEP 664 to PEP 693 (GH-94046) 2022-06-21 13:08:21 -05:00
Steve Dower 5a08e0fda4
gh-94068: Remove HVSOCKET_CONTAINER_PASSTHRU constant because it has been removed from Windows (GH-94069)
Fixes #94068

Automerge-Triggered-By: GH:zware
2022-06-21 10:27:21 -07:00
Adam Turner 0efe3a1636
gh-86986: Drop compatibility support for Sphinx 2 (GH-93737)
* Revert "bpo-42843: Keep Sphinx 1.8 and Sphinx 2 compatibility (GH-24282)"

This reverts commit 5c1f15b4b1

* Revert "bpo-42579: Make workaround for various versions of Sphinx more robust (GH-23662)"

This reverts commit b63a620014.
2022-06-21 17:04:46 +02:00
Mark Shannon 6f8875eba3
GH-93841: Allow stats to be turned on and off, cleared and dumped at runtime. (GH-93843) 2022-06-21 15:40:54 +01:00
Victor Stinner c7a79bb036
gh-74953: _PyThread_cond_after() uses _PyTime_t (#94056)
pthread _PyThread_cond_after() implementation now uses the _PyTime_t
type to handle properly overflow: clamp to the maximum value.

Remove MICROSECONDS_TO_TIMESPEC() function.
2022-06-21 15:45:49 +02:00
Victor Stinner 616fa3465d
gh-54781: Move Lib/lib2to3/tests/ to Lib/test/test_lib2to3/ (#94049)
* Move Lib/lib2to3/tests/ to Lib/test/test_lib2to3/.
* Remove Lib/test/test_lib2to3.py.
* Update imports.
* all_project_files(): use different paths and sort files
  to make the tests more reproducible.
* Update references to tests.
2022-06-21 15:21:22 +02:00
Christian Heimes 50ebd72fb0
gh-93839: Use load_package_tests() for testmock (GH-94055)
Fixes failing tests on WebAssembly platforms.

Automerge-Triggered-By: GH:tiran
2022-06-21 05:51:39 -07:00
Christian Heimes 0ff7b996f5
gh-94052: Don't re-run failed tests with --python option (#94054) 2022-06-21 14:42:32 +02:00
Erlend Egeberg Aasland 94eeac03dc
gh-94028: Clear and reset sqlite3 statements properly in cursor iternext (GH-94042) 2022-06-21 12:30:29 +01:00
Dennis Sweeney 5fcfdd87c9
GH-91432: Specialize FOR_ITER (GH-91713)
* Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations.

* Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
2022-06-21 11:19:26 +01:00
Victor Stinner c735d54534
gh-93839: Move Lib/unttest/test/ to Lib/test/test_unittest/ (#94043)
* Move Lib/unittest/test/ to Lib/test/test_unittest/
* Remove Lib/test/test_unittest.py
* Replace unittest.test with test.test_unittest
* Remove unittest.load_tests()
* Rewrite unittest __init__.py and __main__.py
* Update build system, CODEOWNERS, and wasm_assets.py
2022-06-21 10:27:59 +02:00
Victor Stinner d82e0bfe8b
gh-93839: Move Lib/ctypes/test/ to Lib/test/test_ctypes/ (#94041)
* Move Lib/ctypes/test/ to Lib/test/test_ctypes/
* Remove Lib/test/test_ctypes.py
* Update imports and build system.
2022-06-21 10:24:33 +02:00
Irit Katriel 889772fb56
GH-93678: refactor compiler so that optimizer does not need the assembler and compiler structs (GH-93842) 2022-06-21 09:22:17 +01:00
Christian Heimes 77c839c98f
gh-94021: Address unreachable code warning in specialize code (GH-94022) 2022-06-20 23:34:11 -07:00
Irit Katriel 1603a1029f
GH-93249: relax overly strict assertion on bounds->ar_start (GH-93961) 2022-06-20 17:13:39 +01:00
Victor Stinner cfb986a1a2
gh-93937: PyOS_StdioReadline() uses PyConfig.legacy_windows_stdio (#94024)
On Windows, PyOS_StdioReadline() now gets
PyConfig.legacy_windows_stdio from _PyOS_ReadlineTState, rather than
using the deprecated global Py_LegacyWindowsStdioFlag variable.

Fix also a compiler warning in Py_SetStandardStreamEncoding().
2022-06-20 16:10:47 +02:00
Victor Stinner 7ad6f74fcf
gh-87347: Add parenthesis around macro arguments (#93915)
Add unit test on Py_MEMBER_SIZE() and some other macros.
2022-06-20 16:04:52 +02:00
Matthias Köppe 61f24e7885
gh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (#92754) 2022-06-20 15:58:02 +02:00
Mark Shannon ab0e601016
GH-93516: Speedup line number checks when tracing. (GH-93763)
* Use a lookup table to reduce overhead of getting line numbers during tracing.
2022-06-20 13:00:42 +01:00
Mark Shannon 45e62a2bc1
GH-93897: Store frame size in code object and de-opt if insufficient space on thread frame stack. (GH-93908) 2022-06-20 12:59:25 +01:00
Christian Heimes 774ef28814
gh-84461: Silence some compiler warnings on WASM (GH-93978) 2022-06-20 13:34:40 +02:00
itssme affa9f22cf
gh-79009: sqlite3.iterdump now correctly handles tables with autoincrement (#9621)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-06-20 00:59:24 +02:00
Erlend Egeberg Aasland 8e08978141
gh-61162: Clarify sqlite3 connection context manager docs (GH-93890)
Explicitly note that transactions are only closed if there is an open
transation at `__exit__`, and that transactions are not implicitly
opened during `__enter__`.

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>

Automerge-Triggered-By: GH:erlend-aasland
2022-06-19 13:17:43 -07:00
Erlend Egeberg Aasland 6446592c89
gh-93925: Improve clarity of sqlite3 commit/rollback, and close docs (#93926)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-06-19 21:17:28 +02:00
Christian Heimes 62363bfe59
gh-84461: Skip test_unwritable_directory again on Emscripten (GH-94007)
GH-93992 removed geteuid() and enabled the test again on Emscripten.
2022-06-19 20:18:57 +02:00
Christian Heimes 2702e408fd
gh-84461: Fix Emscripten umask and permission issues (GH-94002)
- Emscripten's default umask is too strict, see
  https://github.com/emscripten-core/emscripten/issues/17269
- getuid/getgid and geteuid/getegid are stubs that always return 0
  (root). Disable effective uid/gid syscalls and fix tests that use
  chmod() current user.
- Cannot drop X bit from directory.
2022-06-19 18:28:55 +02:00
Lei Zhang 476d302508
gh-93991: Use boolean instead of 0/1 for condition check (GH-93992)
# gh-93991: Use boolean instead of 0/1 for condition check
2022-06-19 07:12:59 -07:00
Victor Stinner 27b9894033
gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938)
Move the follow functions and type from frameobject.h to pyframe.h,
so the standard <Python.h> provide frame getter functions:

* PyFrame_Check()
* PyFrame_GetBack()
* PyFrame_GetBuiltins()
* PyFrame_GetGenerator()
* PyFrame_GetGlobals()
* PyFrame_GetLasti()
* PyFrame_GetLocals()
* PyFrame_Type

Remove #include "frameobject.h" from many C files. It's no longer
needed.
2022-06-19 12:02:33 +02:00
Victor Stinner 2664d9aacf
gh-74953: Reformat PyThread_acquire_lock_timed() (#93947)
Reformat the pthread implementation of PyThread_acquire_lock_timed()
using a mutex and a conditioinal variable.

* Add goto to avoid multiple indentation levels and exit quickly
* Use "while(1)" and make the control flow more obvious.
* PEP 7: Add braces around if blocks.
2022-06-19 11:50:21 +02:00
Victor Stinner dba3fa57e2
gh-93761: Fix test_logging test_config_queue_handler() race condition (#93952)
Fix a race condition in test_config_queue_handler() of test_logging.
2022-06-19 11:49:35 +02:00