Commit Graph

47770 Commits

Author SHA1 Message Date
Serhiy Storchaka 574241632b
bpo-42222: Improve tests for invalid argument types in randrange() (GH-29021) 2021-10-19 20:40:30 +02:00
Inada Naoki 0a4c82ddd3
bpo-45475: Revert `__iter__` optimization for GzipFile, BZ2File, and LZMAFile. (GH-29016)
This reverts commit d2a8e69c2c.
2021-10-19 11:51:48 +09:00
Mark Shannon 70945d57e7
bpo-45256: Avoid C calls for most Python to Python calls. (GH-28937)
* Avoid making C calls for most calls to Python functions.

* Change initialize_locals(steal=true) and _PyTuple_FromArraySteal to consume the argument references regardless of whether they succeed or fail.
2021-10-18 09:57:24 +01:00
Serhiy Storchaka b3f0ceae91
bpo-45229: Make test_http_cookiejar discoverable (GH-29004) 2021-10-17 15:06:40 +03:00
Terry Jan Reedy 42ac06dcd2
bpo-45495: Add 'case' and 'match' to IDLE completions list. (GH-29000)
Since the keyword list is frozen, only compute it once per
session.  The colorizer already handles context keywords.
2021-10-16 18:44:00 -04:00
Eric Snow b9cdd0fb9c
bpo-45020: Default to using frozen modules unless running from source tree. (gh-28940)
The default was "off".  Switching it to "on" means users get the benefit of frozen stdlib modules without having to do anything.  There's a special-case for running-in-source-tree, so contributors don't get surprised when their stdlib changes don't get used.

https://bugs.python.org/issue45020
2021-10-16 13:16:08 -06:00
Pablo Galindo Salgado fe0d9e22a5
bpo-45249: Fix caret location when end_offset is set to 0 (GH-28855) 2021-10-16 10:27:43 -07:00
Raymond Hettinger 5afa0a4112
bpo-42222: Remove deprecated support for non-integer values (GH-28983) 2021-10-16 10:16:53 -05:00
Dong-hee Na 15ad52fbf6
bpo-45489: Update ForwardRef to support | operator. (GH-28991) 2021-10-17 00:12:58 +09:00
Graham Inggs 59a633d3e2
bpo-45428: Fix reading filenames from stdin in py_compile (GH-28848)
Strip trailing '\n'.
2021-10-15 12:38:55 +03:00
Eric Snow 79cf20e48d
bpo-21736: Set __file__ on frozen stdlib modules. (gh-28656)
Currently frozen modules do not have __file__ set.  In their spec, origin is set to "frozen" and they are marked as not having a location.  (Similarly, for frozen packages __path__ is set to an empty list.)  However, for frozen stdlib modules we are able to extrapolate __file__ as long as we can determine the stdlib directory at runtime.  (We now do so since gh-28586.)  Having __file__ set is helpful for a number of reasons.  Likewise, having a non-empty __path__ means we can import submodules of a frozen package from the filesystem (e.g. we could partially freeze the encodings module).

This change sets __file__ (and adds to __path__) for frozen stdlib modules.  It uses sys._stdlibdir (from gh-28586) and the frozen module alias information (from gh-28655).  All that work is done in FrozenImporter (in Lib/importlib/_bootstrap.py). 
 Also, if a frozen module is imported before importlib is bootstrapped (during interpreter initialization) then we fix up that module and its spec during the importlib bootstrapping step (i.e. imporlib._bootstrap._setup()) to match what gets set by FrozenImporter, including setting the file info (if the stdlib dir is known).  To facilitate this, modules imported using PyImport_ImportFrozenModule() have __origname__ set using the frozen module alias info.  __origname__ is popped off during importlib bootstrap.

(To be clear, even with this change the new code to set __file__ during fixups in imporlib._bootstrap._setup() doesn't actually get triggered yet.  This is because sys._stdlibdir hasn't been set yet in interpreter initialization at the point importlib is bootstrapped.  However, we do fix up such modules at that point to otherwise match the result of importing through FrozenImporter, just not the __file__ and __path__ parts.  Doing so will require changes in the order in which things happen during interpreter initialization.  That can be addressed separately.  Once it is, the file-related fixup code from this PR will kick in.)

Here are things this change does not do:

* set __file__ for non-stdlib modules (no way of knowing the parent dir)
* set __file__ if the stdlib dir is not known (nor assume the expense of finding it)
* relatedly, set __file__ if the stdlib is in a zip file
* verify that the filename set to __file__ actually exists (too expensive)
* update __path__ for frozen packages that alias a non-package (since there is no package dir)

Other things this change skips, but we may do later:

* set __file__ on modules imported using PyImport_ImportFrozenModule()
* set co_filename when we unmarshal the frozen code object while importing the module (e.g. in FrozenImporter.exec_module()) -- this would allow tracebacks to show source lines
* implement FrozenImporter.get_filename() and FrozenImporter.get_source()

https://bugs.python.org/issue21736
2021-10-14 15:32:18 -06:00
Carl Friedrich Bolz-Tereick b2af211e22
bpo-45417: [Enum] fix quadratic behavior during creation (GH-28907)
Creating an Enum exhibited quadratic behavior based on the number of members in three places:
- `EnumDict._member_names`: a list searched with each new member's name
- member creation: a `for` loop checking each existing member to see if new member was a duplicate
- `auto()` values: a list of all previous values in enum was copied before being sent to `_generate_next_value()`

Two of those issues have been resolved:
- `_EnumDict._member_names` is now a dictionary so lookups are fast
- member creation tries a fast value lookup before falling back to the slower `for` loop lookup

The third issue still remains, as `_generate_next_value_()` can be user-overridden and could corrupt the last values list if it were not copied.
2021-10-14 13:59:51 -07:00
Eric Snow 0bbea0723e
bpo-45471: Do not set PyConfig.stdlib_dir in Py_SetPythonHome(). (gh-28954)
The change in gh-28586 (bpo-45211) should not have included code to set _Py_path_config.stdlib_dir in Py_SetPythonHome(). We fix that here.

https://bugs.python.org/issue45471
2021-10-14 14:48:32 -06:00
Serhiy Storchaka 39aa98346d
bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" codec (GH-28944)
They support now splitting escape sequences between input chunks.

Add the third parameter "final" in codecs.raw_unicode_escape_decode().
It is True by default to match the former behavior.
2021-10-14 20:04:19 +03:00
Dennis Sweeney 3b3d30e8f7
bpo-45367: Specialize BINARY_MULTIPLY (GH-28727) 2021-10-14 15:56:33 +01:00
Serhiy Storchaka c96d1546b1
bpo-45461: Fix IncrementalDecoder and StreamReader in the "unicode-escape" codec (GH-28939)
They support now splitting escape sequences between input chunks.

Add the third parameter "final" in codecs.unicode_escape_decode().
It is True by default to match the former behavior.
2021-10-14 13:17:00 +03:00
Pablo Galindo Salgado db2b6a20cd
bpo-45445: Fail if an invalid X-option is provided in the command line (GH-28823) 2021-10-13 18:08:19 +01:00
rtobar 1c83135381
bpo-45386: Handle strftime's ValueError graciously in xmlrpc.client (GH-28765)
At import time, the xmlrpc.client module uses different date formats to
test strftime so it can format years with 4 digits consistently.
Depending on the underlying C library and its strftime implementation
some of these calls can result in ValueErrors, blocking the
xmlrpc.client module from being imported.

This commit changes the behavior of this bit of code to react to
ValueError exceptions, treating the format that caused them as an
non-viable option.
2021-10-13 18:38:36 +02:00
andrei kulakov 6fafc25aea
bpo-24444: fix an error in argparse help when help for an option is blank (GH-28050) 2021-10-13 18:31:51 +02:00
Ben Hoyt b9e687618d
bpo-45239: Fix parsedate_tz when time has more than 2 dots in it (GH-28452)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-13 18:21:27 +02:00
Serhiy Storchaka f59ed3c310
bpo-45229: Make tkinter tests discoverable (GH-28637) 2021-10-13 18:12:48 +02:00
Victor Stinner 676201a59f
bpo-45410: regrtest replaces print_warning.orig_stderr (GH-28926)
When running Python tests with -W, runtest() now replaces
support.print_warning.orig_stderr to preserve the messages order.

Add an unit test.
2021-10-13 17:35:21 +02:00
Mark Shannon a8b9350964
bpo-45340: Don't create object dictionaries unless actually needed (GH-28802)
* Never change types' cached keys. It could invalidate inline attribute objects.

* Lazily create object dictionaries.

* Update specialization of LOAD/STORE_ATTR.

* Don't update shared keys version for deletion of value.

* Update gdb support to handle instance values.

* Rename SPLIT_KEYS opcodes to INSTANCE_VALUE.
2021-10-13 14:19:34 +01:00
Victor Stinner 7733307739
bpo-45410: regrtest -W leaves stdout/err FD unchanged (GH-28915)
support.print_warning() now stores the original value of
sys.__stderr__ and uses it to log warnings. libregrtest uses the same
stream to log unraisable exceptions and uncaught threading
exceptions.

Partially revert commit dbe213de7ef28712bbfdb9d94a33abb9c33ef0c2:
libregrtest no longer replaces sys.__stdout__, sys.__stderr__, and
stdout and stderr file descriptors.

Remove also a few unused imports in libregrtest.
2021-10-13 14:08:18 +02:00
Victor Stinner 678433f25e
bpo-45453: Fix test_embed.StdPrinterTests (GH-28916)
test_embed.StdPrinterTests now always use the file descriptor 1 for
stdout, rather than using sys.__stdout__.fileno().
PyFile_NewStdPrinter() does crash if the argument is not 1 or 2.

Fix also a few pyflakes warnings: remove unused import and variables.
2021-10-13 05:24:33 +02:00
Victor Stinner dbe213de7e
bpo-45410: Enhance libregrtest -W/--verbose3 option (GH-28908)
libregrtest -W/--verbose3 now also replace sys.__stdout__,
sys.__stderr__, and stdout and stderr file descriptors (fd 1 and fd
2).

support.print_warning() messages are now logged in the expected
order.

The "./python -m test test_eintr -W" command no longer logs into
stdout if the test pass.
2021-10-13 01:52:22 +02:00
Alberto Mardegan 562c0d7398
bpo-45421: Remove dead code from html.parser (GH-28847)
Support for HtmlParserError was removed back in 2014 with commit
73a4359eb0, however this small block was
missed.
2021-10-12 10:12:21 -07:00
Victor Stinner 1ebd798fdd
bpo-45410: Add test.support.flush_std_streams() (GH-28885)
support.print_warning() now flushs sys.stdout.
2021-10-11 23:07:21 +02:00
Dong-hee Na ab62051152
bpo-20028: Empty escapechar/quotechar is not allowed for csv.Dialect (GH-28833) 2021-10-11 20:08:15 +09:00
Josephine-Marie d74da9e140
bpo-45411: Update mimetypes.py (GH-28792)
.vtt and .srt files are common subtitle files, used by browsers.
2021-10-11 13:05:28 +02:00
Serhiy Storchaka 15188b115a
bpo-45401: Fix a resource warning in test_logging (GH-28864) 2021-10-11 11:54:44 +03:00
Joongi Kim 1a7892414e
bpo-45416: Fix use of asyncio.Condition() with explicit Lock objects (GH-28850)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-10 19:01:41 +03:00
Vinay Sajip 62a667784b
bpo-45401: Change shouldRollover() methods to only rollover regular f… (GH-28822)
…iles.

Also changed some historical return values from 1 -> True and 0 -> False.
2021-10-10 08:15:24 -07:00
Inada Naoki ad970e8623
bpo-29410: Change the default hash algorithm to SipHash13. (GH-28752)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Christian Heimes <christian@python.org>
2021-10-10 17:29:46 +09:00
Inada Naoki a1c3c9e824
Fix EncodingWarning in test_tools. (GH-28846) 2021-10-10 09:14:40 +02:00
Landon Yarrington 5b4a7675bc
Fix dataclassses spelling (GH-28837) 2021-10-09 15:17:52 -04:00
Serhiy Storchaka b454e8e4df
bpo-27580: Add support of null characters in the csv module. (GH-28808) 2021-10-09 19:17:43 +03:00
Pablo Galindo Salgado b4903afd4d
bpo-45256: Remove the usage of the C stack in Python to Python calls (GH-28488)
Ths commit inlines calls to Python functions in the eval loop and steals all the arguments in the call from the caller for
performance.
2021-10-09 16:51:30 +01:00
Dong-hee Na 34bbc87b2d
bpo-20028: Improve error message of csv.Dialect when initializing (GH-28705) 2021-10-09 23:50:12 +09:00
Mark Shannon 5e173f5db1
Bump MAGIC_NUMBER to reflect change in JUMP_ABSOLUTE semantics. (GH-28829) 2021-10-09 14:17:22 +01:00
Julien Palard c91b6f57f3
bpo-10716: Migrating pydoc to html5. (GH-28651) 2021-10-09 09:36:50 +02:00
Victor Stinner b108db63e0
bpo-45410: libregrtest -jN writes stderr into stdout (GH-28819)
When libregrtest spawns a worker process, stderr is now written into
stdout to keep messages order. Use a single pipe for stdout and
stderr, rather than two pipes. Previously, messages were out of order
which made analysis of buildbot logs harder
2021-10-08 17:14:37 +02:00
Pablo Galindo Salgado 0219017df7
bpo-45408: Don't override previous tokenizer errors in the second parser pass (GH-28812) 2021-10-07 22:33:05 +01:00
Steve Dower 6811fdaec8
bpo-45337: Use the realpath of the new executable when creating a venv on Windows (GH-28663) 2021-10-07 21:26:12 +01:00
Erlend Egeberg Aasland 8deb7afbaa
bpo-16379: Fix SQLite version checks in test_module_constants() (GH-28809)
Automerge-Triggered-By: GH:pablogsal
2021-10-07 12:48:13 -07:00
Victor Stinner 768aaf6c43
bpo-45403: Fix test_sys.test_stdlib_dir() (GH-28785)
Fix test_sys.test_stdlib_dir() when Python is built outside the
source tree: compare normalized paths.
2021-10-07 21:22:28 +02:00
Victor Stinner 4e605666b0
bpo-45400: Fix suggestion test of test_exceptions (GH-28783)
Fix test_name_error_suggestions_do_not_trigger_for_too_many_locals()
of test_exceptions if a directory name contains "a1" (like
"Python-3.11.0a1"): use a stricter regular expression.
2021-10-07 13:47:23 +02:00
Erlend Egeberg Aasland 3f2c433da5
bpo-45041: Restore `sqlite3` executescript behaviour for `SELECT` queries (GH-28509)
* bpo-45041: Restore sqlite3 executescript behaviour for select queries

* Add regression test
2021-10-07 10:16:45 +01:00
Ammar Askar 5baec4aea6
bpo-35970: Add help flag to base64 module (GH-28774)
This continues off rkuska's work from https://github.com/python/cpython/pull/11789 seeing as the patch wasn't updated to add tests.
2021-10-06 18:38:43 -07:00
Christian Clauss 745c9d9dfc
Fix typos in the Lib directory (GH-28775)
Fix typos in the Lib directory as identified by codespell.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-10-06 16:13:48 -07:00
rtobar 0571b934f5
bpo-45328: Avoid failure in OSs without TCP_NODELAY support (GH-28646)
Operating systems without support for TCP_NODELAY will raise an OSError
when trying to set the socket option, but the show can still go on.
2021-10-06 19:49:44 +02:00
Łukasz Langa f528045f69
bpo-40321: Add missing test, slightly expand documentation (GH-28760) 2021-10-06 17:28:16 +02:00
Mark Shannon a7252f88d3
bpo-40116: Add insertion order bit-vector to dict values to allow dicts to share keys more freely. (GH-28520) 2021-10-06 13:19:53 +01:00
Mark Shannon f6eafe18c0
Normalize jumps in compiler. All forward jumps to use JUMP_FORWARD. (GH-28755) 2021-10-06 13:05:45 +01:00
Jochem Schulenklopper c379bc5ec9
bpo-40321: Support HTTP response status code 308 in urllib.request (#19588)
* Support HTTP response status code 308 in urllib.

HTTP response status code 308 is defined in https://tools.ietf.org/html/rfc7538 to be the permanent redirect variant of 307 (temporary redirect).

* Update documentation to include http_error_308()

* Add blurb for bpo-40321 fix

Co-authored-by: Roland Crosby <roland@rolandcrosby.com>
2021-10-05 19:02:58 -07:00
Illia Volochii 4c8d543823
bpo-45343: Update bundled pip to 21.2.4 and setuptools to 58.1.0 (GH-28684) 2021-10-05 23:30:38 +02:00
Eric Snow 08285d563e
bpo-45020: Identify which frozen modules are actually aliases. (gh-28655)
In the list of generated frozen modules at the top of Tools/scripts/freeze_modules.py, you will find that some of the modules have a different name than the module (or .py file) that is actually frozen. Let's call each case an "alias". Aliases do not come into play until we get to the (generated) list of modules in Python/frozen.c. (The tool for freezing modules, Programs/_freeze_module, is only concerned with the source file, not the module it will be used for.)

Knowledge of which frozen modules are aliases (and the identity of the original module) normally isn't important. However, this information is valuable when we go to set __file__ on frozen stdlib modules. This change updates Tools/scripts/freeze_modules.py to map aliases to the original module name (or None if not a stdlib module) in Python/frozen.c. We also add a helper function in Python/import.c to look up a frozen module's alias and add the result of that function to the frozen info returned from find_frozen().

https://bugs.python.org/issue45020
2021-10-05 11:26:37 -06:00
Pablo Galindo 350e7a25d6 Python 3.11.0a1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEz9yiRbEEPPKl+Xhl/+h0BBaL2EcFAmFcSLIACgkQ/+h0BBaL
 2Edt+A//euGR2lSeASHsLMeFwZkhMGOHHPZKmCcUP7CyQC6zfvajVnEORcsRhMI1
 dD1jLMv/PsednzYV+nBBdSVGCGnnAX3O5u2eB+W7cG4xvt78ok/DX5lYXJrnyAfy
 YzWv74zWR/W8HJYy7LQfrhvqfJHK/c5ar/Jk6+t7c9LqZrlkPM2rEpAWWILASQuX
 2eR/A+9TifqIPtZN5c67OObtm190ScYWUID5HjqROcEjiOh9Y9tASk0VpyDtfIHP
 imJro+JGsV3WOlRpVkfAvyC0L8LrEjVxyFyBok8+fWJQ0yjjepC+EkLGX3DKWutz
 LgS5Wx/onnCT5dDlIcda9GVuDnEbr8WvAHWwwu0nJhmZ2XzXRNMzRf8lxw9hH09X
 mvmKS+nzx12pDZs5IAdWNUyWFJx1pPLNOqRa3heTIC/yB9+rHvY3WfGYkpD+r7FJ
 JAbD/LiWfVTRnl3HIyoNCyIOHxSZaYlAN9qJeapEFoFdYCLWByQsCiMoUH+W8zKE
 kpF7yl2RaSUFIZ7b6VJ0tDk2QDTWYPHYh37zii4OtfHgY1AkqbiWA1FTfNW3ZiX0
 1QHpB89feB4TdnFP7c+piEQxHxxJnhGCfb3bpEHdofDJVpMn+pz9DRXEpWTkPhBK
 JK7z5eVBzxYfACbb/IULc79Bsnp/5P2ZQiXMNpb+/W2wwjqjOdw=
 =RF/t
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEz9yiRbEEPPKl+Xhl/+h0BBaL2EcFAmFchnQACgkQ/+h0BBaL
 2Eekgg/+LEvtmrE0O8VgzG/+4EiMWk6AWSc0h9ZIuY+qDLSMTjJBnsG9nl7fl7Gb
 LzeDeQSWglnNsut/K63XVniADFZ4nqU9L1c9KF//4jfS8xqOv9m2GNe4ESbV4JlG
 hVP6dmKjsl1BM0rgAEF4V2lCslxwI5rGkHL7MUuST+G4yyRfo7jARw9nAOHz9OIo
 fr+S1rry2KPexUTxRFvQ+5dzV01o8ylkleIIZZIQ1Z186LvrDi7YgNqBAdi3bECc
 U+PuLvLEx1SzuuzJQNkstfGHS9Mabu5UvvGj2fZmvGhgOqxFdEtT6/QmHdFEJlnk
 65T5xT6QUE6NlRyzbb044Rs0czCs8tpVZL+LrAhJnnKxufqKUZVOxWwzMkGTG3Ia
 4SUeMr+70+Qs4Uwe3xYqfLvym4AnBDGKgHQaMiEe7gpmqQUgfKIBBORjMBezNiOQ
 DI+fAi+w4+T+aGEhSSjdgyj9NqpSkYjrP1ODpb1I7kKJfronVufUwp1afJoKaLBR
 bLAQKNIAop08zuMY7N7l1hATqpiaFyGlFU4rjH0dNEaQzaGSVqyEOpWanhqOsMPV
 l1AoTMUtJxdM1y/T1WxdKbaN/XoZYznFZbQrCDsPzAXhWHx+1thJBN7BGdCi/Krm
 2f7Kk//8uLj+BuHowMzOzArNvAfCiFPJypPhUktCFU++GvEWnjY=
 =hwKX
 -----END PGP SIGNATURE-----

Merge tag 'v3.11.0a1'

Python 3.11.0a1
2021-10-05 18:07:59 +01:00
Eric Snow 69f6dabb9c
Rearrage the finder tests. (gh-28740)
This makes the tests a bit cleaner and makes adding more tests a little simpler.

https://bugs.python.org/issue45324
2021-10-05 10:37:14 -06:00
Eric Snow c3d9ac8b34
bpo-45324: Capture data in FrozenImporter.find_spec() to use in exec_module(). (gh-28633)
Before this change we end up duplicating effort and throwing away data in FrozenImporter.find_spec().  Now we do the work once in find_spec() and the only thing we do in FrozenImporter.exec_module() is turn the raw frozen data into a code object and then exec it.

We've added _imp.find_frozen(), add an arg to _imp.get_frozen_object(), and updated FrozenImporter.  We've also moved some code around to reduce duplication, get a little more consistency in outcomes, and be more efficient.

Note that this change is mostly necessary if we want to set __file__ on frozen stdlib modules. (See https://bugs.python.org/issue21736.)

https://bugs.python.org/issue45324
2021-10-05 10:01:27 -06:00
Hai Shi b9bb74871b
bpo-44050: Extension modules can share state when they don't support sub-interpreters. (GH-27794)
Automerge-Triggered-By: GH:encukou
2021-10-05 06:19:32 -07:00
Pablo Galindo 7c12e4835e
Python 3.11.0a1 2021-10-05 13:44:05 +01:00
Jeremy Kloth de4052fe06
bpo-45354: Skip obsolete device name tests on Windows 11 (GH-28712) 2021-10-05 13:17:13 +01:00
Christian Heimes ef6196028f
bpo-45371: Fix distutils' rpath support for clang (GH-28732)
Signed-off-by: Christian Heimes <christian@python.org>
2021-10-05 02:43:46 -07:00
John Belmonte e6d1aa1ac6
bpo-44594: fix (Async)ExitStack handling of __context__ (gh-27089)
* bpo-44594: fix (Async)ExitStack handling of __context__

Make enter_context(foo()) / enter_async_context(foo()) equivalent to
`[async] with foo()` regarding __context__ when an exception is raised.

Previously exceptions would be caught and re-raised with the wrong
context when explicitly overriding __context__ with None.
2021-10-03 23:49:55 -07:00
Serhiy Storchaka a5a56154f1
Remove trailing spaces. (GH-28706) 2021-10-03 16:58:14 +03:00
Raymond Hettinger db91b058d5
bpo-45346: Keep docs consistent regarding true and false values (GH-28697) 2021-10-02 13:48:08 -05:00
Nikita Sobolev 746d648d47
bpo-45125: Improves pickling docs and tests for `shared_memory` (GH-28294) 2021-10-01 13:45:59 +03:00
Serhiy Storchaka 2f20592012
Revert "Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650)" (GH-28667)
This reverts commit b07fddd527.
2021-10-01 10:57:58 +03:00
Serhiy Storchaka eb4495e8e2
bpo-45310: Fix parrallel shared memory tests (GH-28661)
Add a PID to names of POSIX shared memory objects to allow
running multiprocessing tests (test_multiprocessing_fork,
test_multiprocessing_spawn, etc) in parallel.
2021-10-01 10:56:32 +03:00
Eric Snow 7e5c107541
bpo-45020: Add more test cases for frozen modules. (gh-28664)
I've added a number of test-only modules. Some of those cases are covered by the recently frozen stdlib modules (and some will be once we add encodings back in). However, I figured we'd play it safe by having a set of modules guaranteed to be there during tests.

https://bugs.python.org/issue45020
2021-09-30 18:38:52 -06:00
Serhiy Storchaka ec4d917a6a
bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654)
* Work correctly if an additional fresh module imports other
  additional fresh module which imports a blocked module.
* Raises ImportError if the specified module cannot be imported
  while all additional fresh modules are successfully imported.
* Support blocking packages.
* Always restore the import state of fresh and blocked modules
  and their submodules.
* Fix test_decimal and test_xml_etree which depended on an undesired
  side effect of import_fresh_module().
2021-09-30 19:20:39 +03:00
Pablo Galindo Salgado b07fddd527
Revert "bpo-45229: Make datetime tests discoverable (GH-28615)" (GH-28650)
This reverts commit d441437ee7.
2021-09-30 14:46:26 +01:00
Victor Stinner 09796f2f14
bpo-41710: Add _PyTime_AsTimespec_clamp() (GH-28629)
Add the _PyTime_AsTimespec_clamp() function: similar to
_PyTime_AsTimespec(), but clamp to _PyTime_t min/max and don't raise
an exception.

PyThread_acquire_lock_timed() now uses _PyTime_AsTimespec_clamp() to
remove the Py_UNREACHABLE() code path.

* Add _PyTime_AsTime_t() function.
* Add PY_TIME_T_MIN and PY_TIME_T_MAX constants.
* Replace _PyTime_AsTimeval_noraise() with _PyTime_AsTimeval_clamp().
* Add pytime_divide_round_up() function.
* Fix integer overflow in pytime_divide().
* Add pytime_divmod() function.
2021-09-30 02:11:41 +02:00
Serhiy Storchaka d441437ee7
bpo-45229: Make datetime tests discoverable (GH-28615) 2021-09-29 23:27:57 +03:00
Łukasz Langa f1ca5d7f61
[typo] Fix threading.Barrier comment that used confusing punctuation (GH-28623)
Removed extra comma in comment that indicates state of a `Barrier` as it was confusing and breaking the flow while reading.

Co-authored-by: Priyank <5903604+cpriyank@users.noreply.github.com>
2021-09-29 16:11:26 +02:00
Serhiy Storchaka eed32df5b6
bpo-24391: Better reprs for threading objects. (GH-20534)
Add reprs for Semaphore, BoundedSemaphore, Event, and Barrier.
2021-09-29 13:07:58 +03:00
Jack DeVries b6fe857250
bpo-39039: tarfile raises descriptive exception from zlib.error (GH-27766)
* during tarfile parsing, a zlib error indicates invalid data
* tarfile.open now raises a descriptive exception from the zlib error
* this makes it clear to the user that they may be trying to open a
  corrupted tar file
2021-09-29 11:25:48 +02:00
Nikita Sobolev e046aabbe3
bpo-45269: test wrong `markers` type to `c_make_encoder` (GH-28540) 2021-09-28 23:18:00 +02:00
Eric Snow 0c50b8c0b8
bpo-45211: Remember the stdlib dir during startup. (gh-28586)
During runtime startup we figure out the stdlib dir but currently throw that information away. This change preserves it and exposes it via PyConfig.stdlib_dir, _Py_GetStdlibDir(), and sys._stdlib_dir.

https://bugs.python.org/issue45211
2021-09-28 12:18:28 -06:00
Pablo Galindo Salgado 84975146a7
bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595) 2021-09-28 13:32:43 +01:00
Terry Jan Reedy e649e0658f
bpo-45296: Fix exit/quit message on Windows (GH-28577)
IDLE recognizes Ctrl-D, as on other systems, instead of Ctrl-Z.
2021-09-28 14:05:56 +02:00
Victor Stinner 95d3137082
bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549)
Fix the threading._shutdown() function when the threading module was
imported first from a thread different than the main thread: no
longer log an error at Python exit.
2021-09-27 23:09:00 +02:00
Pablo Galindo Salgado 20f439b6b9
bpo-45249: Ensure the traceback module prints correctly syntax errors with ranges (GH-28575) 2021-09-27 21:59:06 +01:00
Eric Snow ae7839bbe8
bpo-45211: Move helpers from getpath.c to internal API. (gh-28550)
This accomplishes 2 things:

* consolidates some common code between getpath.c and getpathp.c
* makes the helpers available to code in other files

FWIW, the signature of the join_relfile() function (in fileutils.c) intentionally mirrors that of Windows' PathCchCombineEx().

Note that this change is mostly moving code around. No behavior is meant to change.

https://bugs.python.org/issue45211
2021-09-27 10:00:32 -06:00
Pablo Galindo Salgado e5f13ce5b4
bpo-43914: Correctly highlight SyntaxError exceptions for invalid generator expression in function calls (GH-28576) 2021-09-27 14:37:43 +01:00
Victor Stinner a22be4943c
bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)
Fix a race condition in the Thread.join() method of the threading
module. If the function is interrupted by a signal and the signal
handler raises an exception, make sure that the thread remains in a
consistent state to prevent a deadlock.
2021-09-27 14:20:31 +02:00
Nikita Sobolev f56268a2cd
bpo-45280: Add test for empty `NamedTuple` in `test_typing` (GH-28559)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2021-09-26 18:32:18 +02:00
Nikita Sobolev 784905dbef
bpo-45166: fixes `get_type_hints` failure on `Final` (GH-28279)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-09-25 10:56:22 +02:00
Antony Lee 6587fc60d4
bpo-44019: Implement operator.call(). (GH-27888)
Having `operator.call(obj, arg)` mean `type(obj).__call__(obj, arg)` is
consistent with the other dunder operators.  The semantics with `*args,
**kwargs` then follow naturally from the single-arg semantics.
2021-09-24 16:22:49 +01:00
Nikita Sobolev 8d8729146f
bpo-20524: adds better error message for `.format()` (GH-28310)
It now lists the bad format_spec and the type of the object.
2021-09-24 11:18:04 -04:00
Alex Vig 3f8b23f8dd
bpo-30951: Correct co_names docstring in inspect module (GH-2743) 2021-09-24 12:05:34 +02:00
Daniel Hillier 91099e2544
bpo-39359: [zipfile] add missing "pwd: expected bytes, got str" exception (GH-18031) 2021-09-23 23:37:53 +02:00
Jason Fried 86b833badd
bpo-38415: Allow using @asynccontextmanager-made ctx managers as decorators (GH-16667) 2021-09-23 23:36:03 +02:00
Alexander Böhn 8c21941dda
bpo-39549: reprlib.Repr uses a “fillvalue” attribute (GH-18343) 2021-09-22 15:45:58 -05:00
Serhiy Storchaka ecb6922ff2
bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449)
It runs now asynchronous methods and callbacks.

If it fails, doCleanups() can be called for cleaning up.
2021-09-22 17:43:23 +02:00
Mohamad Mansour 8f943ca257
[codemod] Fix non-matching bracket pairs (GH-28473)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-22 01:09:00 +02:00
andrei kulakov a007347100
[tests] Add missing assert against expected tracebacks in test_exceptions.py (GH-28484) 2021-09-22 00:06:13 +02:00
andrei kulakov b7eac52b46
bpo-45234: Fix FileNotFound exception raised instead of IsADirectoryError in shutil.copyfile() (GH-28421)
This was a regression from fixing BPO-43219.
2021-09-21 23:53:07 +02:00
Nikita Sobolev 06e1773c8d
bpo-45216: Remove extraneous method docs from `difflib` (GH-28445) 2021-09-21 23:31:12 +02:00
Nikita Sobolev f604cf1c37
bpo-45209: fix `UserWarning: resource_tracker` in test_multiprocessing (GH-28377) 2021-09-21 19:49:42 +02:00
Erlend Egeberg Aasland 3e3ff09058
bpo-44958: Fix ref. leak introduced in GH-27844 (GH-28490)
Modify managed_connect() helper to support in-memory databases. Use it
for the regression tests added in GH-27844.

Automerge-Triggered-By: GH:pablogsal
2021-09-21 06:15:54 -07:00
Erlend Egeberg Aasland 050d103595
bpo-44958: Only reset `sqlite3` statements when needed (GH-27844) 2021-09-21 12:20:34 +01:00
nullptr 0bfa1106ac
bpo-45021: Fix a hang in forked children (GH-28007)
_global_shutdown_lock should be reinitialized in forked children
2021-09-20 11:30:19 -07:00
Raymond Hettinger 9510e6f3c7
bpo-45155: Apply new byteorder default values for int.to/from_bytes (GH-28465) 2021-09-20 13:22:55 -05:00
Serhiy Storchaka e6ba992288
bpo-45229: Make pickle tests discoverable (GH-28467) 2021-09-20 18:21:33 +03:00
Rémi Lapeyre 4d2957c1b9
bpo-40497: Fix handling of check in subprocess.check_output() (GH-19897)
Co-authored-by: Tal Einat <taleinat@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-20 17:09:05 +02:00
Serhiy Storchaka a856364cc9
bpo-45229: Use doctest.DocTestSuite instead of run_doctest (GH-28468)
Alo use load_tests() for adding tests.
2021-09-20 11:36:57 +03:00
Victor Stinner 5e2c32e08e
bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466)
Calling Py_InitializeFromConfig()+Py_RunMain() multiple times must
not crash.

Cleanup also test_get_argc_argv().
2021-09-20 10:30:02 +02:00
Raymond Hettinger fcbf9b176b
Docs: Clarify the before_and_after() example (GH-28458) 2021-09-19 19:52:27 -05:00
Nikita Sobolev 1d42408495
bpo-45128: fixes `test_multiprocessing_fork` mysterious crash (GH-28387) 2021-09-19 23:50:04 +01:00
Serhiy Storchaka a624177386
bpo-45229: Fix setUpModule in test_ssl (GH-28454) 2021-09-19 16:18:16 +03:00
Serhiy Storchaka 40348acc18
bpo-45229: Remove test_main in many tests (GH-28405)
Instead of explicitly enumerate test classes for run_unittest()
use the unittest ability to discover tests. This also makes these
tests discoverable and runnable with unittest.

load_tests() can be used for dynamic generating tests and adding
doctests. setUpModule(), tearDownModule() and addModuleCleanup()
can be used for running code before and after all module tests.
2021-09-19 15:27:33 +03:00
Serhiy Storchaka 664448d81f
bpo-30856: Update TestResult early, without buffering in _Outcome (GH-28180)
TestResult methods addFailure(), addError(), addSkip() and
addSubTest() are now called immediately after raising an exception
in test or finishing a subtest.  Previously they were called only
after finishing the test clean up.
2021-09-19 15:24:38 +03:00
Serhiy Storchaka dea59cf88a
bpo-36674: Honour the skipping decorators in TestCase.debug() (GH-28446)
unittest.TestCase.debug() raises now a SkipTest if the class or
the test method are decorated with the skipping decorator.

Previously it only raised a SkipTest if the test method was decorated
with other decorator in addition to the skipping decorator, or
if SkipTest was explicitly raised in the test or setup methods.
2021-09-18 15:34:22 +03:00
Adam Schwalm a6e8db5e8e
bpo-45235: Fix argparse overrides namespace with subparser defaults (GH-28420) 2021-09-17 23:20:31 -05:00
Brett Cannon 209b7035f7
bpo-45183: don't raise an exception when calling zipimport.zipimporter.find_spec() when the zip file is missing and the internal cache has been reset (GH-28435)
This can occur when the zip file gets deleted, you call zipimport.zipimporter.invalidate_cache(), and then try to use zipimport.zipimporter.find_spec() (i.e. you left the zip file path on sys.path).
2021-09-17 16:48:17 -07:00
Eric Snow 090591636c
bpo-45020: Freeze os, site, and codecs. (gh-28398)
https://bugs.python.org/issue45020
2021-09-17 16:31:31 -06:00
Daniel Hahler 74cc2453ae
Fix missing space with help for `-m compileall -o` (GH-27591) 2021-09-18 00:28:09 +02:00
Serhiy Storchaka 51ebb7f4f5
bpo-45187: Fix dangling threads in test_socket.CreateServerFunctionalTest (GH-28422) 2021-09-17 21:56:41 +03:00
Omer Katz 778b07565e
Remove compatibility check for Python versions below 2.2. (GH-28314)
`os.path.realpath()` already exists in all our supported Python versions.
There's no longer a need to check if it exists or not.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-17 15:36:41 +02:00
Serhiy Storchaka 54a1760cde
bpo-45212: Add a comment for time.sleep() in tests (GH-28414)
Co-authored-by: Victor Stinner <vstinner@python.org>
2021-09-17 16:20:15 +03:00
Serhiy Storchaka b0a6ede3d0
bpo-45162: Remove many old deprecated unittest features (GH-28268)
* "fail*" and "assert*" aliases of TestCase methods.
* Broken from start TestCase method assertDictContainsSubset().
* Ignored TestLoader.loadTestsFromModule() parameter use_load_tests.
* Old alias _TextTestResult of TextTestResult.
2021-09-17 13:33:27 +03:00
Serhiy Storchaka 0361335b80
bpo-45187: Collect test_socket tests using unittest (GH-28317)
Previously, test classes ISOTPTest, J1939Test, BasicUDPLITETest and
UDPLITETimeoutTest were not included in the list of tests and
were not run by regrtest.
2021-09-17 12:13:09 +02:00
Serhiy Storchaka b2b035a949
bpo-5846: Fix deprecations for obsolete unittest functions and add tests. (GH-28382) 2021-09-17 12:09:32 +03:00
speedrun-program a59ede2447
bpo-45225: use map function instead of genexpr in capwords (GH-28342) 2021-09-16 14:49:38 -05:00
Serhiy Storchaka 7dacb70485
bpo-45212: Fix dangling threads in skipped tests in test_socket (GH-28361)
tearDown() is not called if setUp() raises an exception
(including SkipTest). addCleanup() should be used for guaranteed
execution of the cleanup code.
2021-09-16 13:30:00 +03:00
Barry Warsaw 07e737d002
bpo-45155 : Default arguments for int.to_bytes(length=1, byteorder=sys.byteorder) (#28265)
Add default arguments for int.to_bytes() and int.from_bytes()

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2021-09-15 19:55:24 -07:00
Hubert Badocha a75a257725
bpo-39710: Remove Python 2-specific sentence from calendar documentation (GH-26985) 2021-09-15 22:36:38 +02:00
Eric Snow 3814e2036d
bpo-45019: Clean up the frozen __hello__ module. (gh-28374)
Here's one more small cleanup that should have been in PR gh-28319. We eliminate stdout side-effects from importing the frozen __hello__ module, and update tests accordingly. We also move the module's source file into Lib/ from Toos/freeze/flag.py.

https://bugs.python.org/issue45019
2021-09-15 14:15:32 -06:00
Konstantin Popov d081eab7df
Fix typo in Lib/sqlite3/test/test_types.py (GH-28226)
preceeding -> preceding

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-15 22:09:08 +02:00
Eric Snow 4b30aaa0c9
bpo-45019: Silence a warning in test_ctypes. (gh-28362)
This was missed in PR gh-28319.

https://bugs.python.org/issue45019
2021-09-15 13:33:05 -06:00
Erlend Egeberg Aasland ff6d2cc55a
bpo-5846: Deprecate obsolete methods in `unittest` (GH-28299)
Deprecate makeSuite, findTestCases, and getTestCaseNames. Scheduled for removal in Python 3.13.
2021-09-15 20:33:31 +02:00
Serhiy Storchaka 5dce51a887
bpo-45167: Fix deepcopying of GenericAlias (GH-28324) 2021-09-15 20:25:41 +02:00
Victor Stinner 84a6061e29
bpo-45207: Make test_gdb.test_pycfunction() quiet (GH-28355)
test_gdb.test_pycfunction() now ignores gdb stderr, it no longer logs
messages like:

    Function "meth_varargs" not defined.
2021-09-15 20:21:06 +02:00
Victor Stinner cc057ff522
bpo-45205: Make test_compileall quiet (GH-28356)
Make test_compileall quiet: test_year_2038_mtime_compilation() and
test_larger_than_32_bit_times() of test_compileall no longer log
"Compiling ..." messages to stdout.
2021-09-15 20:20:45 +02:00
Victor Stinner e08e491a6c
bpo-45208: Make test_pdb.test_checkline_is_not_executable() quiet (GH-28354)
test_pdb.test_checkline_is_not_executable() no longer writes output
to stdout.

Remove also unused variables 'f'.
2021-09-15 20:19:31 +02:00
Pablo Galindo Salgado 764e6823a7
bpo-45204: Reduce verbosity of test_peg_generator (GH-28360) 2021-09-15 20:16:51 +02:00
Nikita Sobolev d897579a80
bpo-45185: enables `TestEnumerations` in `test_ssl` (GH-28330) 2021-09-15 19:57:03 +03:00
Eric Snow cbeb819710
bpo-45020: Freeze some of the modules imported during startup. (gh-28335)
Doing this provides significant performance gains for runtime startup (~15% with all the imported modules frozen). We don't yet freeze all the imported modules because there are a few hiccups in the build systems we need to sort out first. (See bpo-45186 and bpo-45188.)

Note that in PR GH-28320 we added a command-line flag (-X frozen_modules=[on|off]) that allows users to opt out of (or into) using frozen modules. The default is still "off" but we will change it to "on" as soon as we can do it in a way that does not cause contributors pain.

https://bugs.python.org/issue45020
2021-09-15 10:19:30 -06:00
Irit Katriel 40d2ac92f9
bpo-45152: refactor the dis module to make handling of hasconst opcodes more generic (GH-28258) 2021-09-15 10:14:15 +01:00
Terry Jan Reedy 1afc7b3219
bpo-45193: Restore IDLE completion boxes on Ubuntu (GH-28343)
The line that should not have been needed on macOS tk 8.6.8 but was,
should not be a problem on Ubuntu, but is.  It is not needed on macOS
tk 8.6.11, installed with 3.10.  Disable it but leave it for
now in case some system needs it.
2021-09-15 03:13:23 -04:00
Terry Jan Reedy 369bf949cc
bpo-45020: Don't test IDLE with frozen module. (GH-28344)
Otherwise, test would need special import.
2021-09-15 03:08:44 -04:00
Eric Snow a65c86889e
bpo-45020: Add -X frozen_modules=[on|off] to explicitly control use of frozen modules. (gh-28320)
Currently we freeze several modules into the runtime. For each of these modules it is essential to bootstrapping the runtime that they be frozen. Any other stdlib module that we later freeze into the runtime is not essential. We can just as well import from the .py file.  This PR lets users explicitly choose which should be used, with the new "-X frozen_modules=[on|off]" CLI flag. The default is "off" for now.

https://bugs.python.org/issue45020
2021-09-14 17:31:45 -06:00
junyixie b668cdfa09
bpo-45196: prevent unittest crash on address sanitizer builds (GH-28331) 2021-09-14 11:31:50 -07:00
Benjamin Peterson 024fda47d4
closes bpo-45190: Update Unicode data to version 14.0.0. (GH-28336) 2021-09-14 11:00:38 -07:00
Victor Stinner 797c8eb9ef
bpo-45195: Fix test_readline.test_nonascii() (GH-28329)
Fix test_readline.test_nonascii(): sometimes, the newline character
is not written at the end, so don't expect it in the output.
2021-09-14 17:38:04 +02:00
Nikita Sobolev 7f60c9e1c6
bpo-45156: Fixes inifite loop on unittest.mock.seal() (GH-28300)
Fixes infinite loop on unittest.mock.seal() of mocks created by
unittest.create_autospec().

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2021-09-14 12:20:40 +02:00
Irit Katriel c99fc4e53a
bpo-45168: change dis output to omit missing values rather than replacing them by their index (GH-28313) 2021-09-14 10:09:05 +01:00
Hugo van Kemenade 9f93018b69
bpo-42135 Correct version slated for importlib.find_loader removal (GH-28312)
importlib.find_loader should also be slated for 3.12 like the others in GH-25169 and as documented in https://docs.python.org/3.11/whatsnew/3.10.html#deprecated.
2021-09-13 15:57:50 -07:00
Eric Snow a2d8c4b81b
bpo-45019: Do some cleanup related to frozen modules. (gh-28319)
There are a few things I missed in gh-27980. This is a follow-up that will make subsequent PRs cleaner. It includes fixes to tests and tools that reference the frozen modules.

https://bugs.python.org/issue45019
2021-09-13 16:18:37 -06:00
Hugo van Kemenade 1fc41ae870
bpo-45173 Remove configparser deprecations (GH-28292)
In the configparser module, these have been deprecated since Python 3.2:

* the SafeConfigParser class,
* the filename property of the ParsingError class,
* the readfp method of the ConfigParser class,
2021-09-13 19:12:36 +02:00
Serhiy Storchaka 3e19409d64
bpo-45181: Simplify loading sqlite3 tests (GH-28304)
Use unittest discover instead of manually enumerating all
test modules and classes.
Also add support for filtering them by pattern.
2021-09-13 14:16:26 +03:00
Serhiy Storchaka 9260e67398
bpo-45182: Fix incorrect use of requires_zlib in test_bdist_rpm (GH-28305)
It is a decorator factory and should be always followed by "()".
2021-09-13 14:10:16 +03:00
Serhiy Storchaka 851811f577
bpo-5846: Do not use obsolete unittest functions. (GH-28303)
Get rid of use of makeSuite() and findTestCases().
Also make test_math and test_threading_local discoverable.
2021-09-13 10:49:53 +03:00
Serhiy Storchaka 92bf8691fb
bpo-43413: Fix handling keyword arguments in subclasses of some buitin classes (GH-26456)
* Constructors of subclasses of some buitin classes (e.g. tuple, list,
  frozenset) no longer accept arbitrary keyword arguments.
* Subclass of set can now define a __new__() method with additional
  keyword parameters without overriding also __init__().
2021-09-12 13:27:50 +03:00
Serhiy Storchaka 97ea18eced
bpo-35474: Fix mimetypes.guess_all_extensions() potentially mutating list (GH-28286)
* Calling guess_all_extensions() with strict=False potentially
  mutated types_map_inv.
* Mutating the result of guess_all_extensions() mutated types_map_inv.
2021-09-11 17:44:44 +03:00
giovanniwijaya b74c819fab
IDLE: adjust Python version in doc url for 3.10+ (GH-28228)
Expression 'python_version()[:3]' truncated '3.10.0' to '3.1' instead of '3.10'.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-09-10 17:10:28 -04:00
Irit Katriel f8d624d6a5
bpo-45144: use subTests in test_peepholer (GH-28247) 2021-09-10 18:29:21 +02:00
Serhiy Storchaka f0f29f328d
bpo-25894: Always report skipped and failed subtests separately (GH-28082)
* In default mode output separate characters for skipped and failed subtests.
* In verbose mode output separate lines (including description) for skipped
   and failed subtests.
* In verbose mode output test description for errors in test cleanup.
2021-09-10 17:55:05 +02:00
Henry-Joseph Audéoud 707137b863
bpo-40563: Support pathlike objects on dbm/shelve (GH-21849)
Co-authored-by: Hakan Çelik <hakancelik96@outlook.com>
2021-09-10 15:26:16 +03:00
Irit Katriel 04676b6946
bpo-45017: move opcode-related logic from modulefinder to dis (GH-28246) 2021-09-09 14:04:12 +01:00
Victor Stinner 49acac00c0
bpo-44860: Update test_sysconfig for posix_user platlib (GH-28235)
Update test_sysconfig.test_user_similar() for the posix_user scheme:
"platlib" doesn't use sys.platlibdir.
2021-09-09 11:02:48 +02:00
Raymond Hettinger 4a5cccb02b
bpo-20499: Rounding error in statistics.pvariance (GH-28230) 2021-09-08 22:00:12 -05:00
Erlend Egeberg Aasland f235dd0784
bpo-38371: Remove deprecated `tkinter` split() method (GH-28237) 2021-09-08 23:02:19 +03:00
Hugo van Kemenade 59ea704df7
bpo-45129 Remove deprecated reuse_address (GH-28207)
Due to significant security concerns, the reuse_address parameter of
asyncio.loop.create_datagram_endpoint, deprecated in Python 3.9, is
now removed. This is because of the behavior of the socket option
SO_REUSEADDR in UDP.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-08 18:58:43 +02:00
andrei kulakov a561005761
bpo-19113: Remove unused test_errors from ctypes tests (GH-28008)
This test was forever shadowed by another test method named `test_errors`.
2021-09-08 17:28:32 +02:00
Yurii Karabas c11956a8bd
bpo-45121: Fix RecursionError when calling Protocol.__init__ from a subclass' __init__ (GH-28206) 2021-09-08 18:25:09 +08:00
Hugo van Kemenade d003a5bd25
bpo-45132 Remove deprecated __getitem__ methods (GH-28225)
Remove deprecated __getitem__ methods of xml.dom.pulldom.DOMEventStream,
wsgiref.util.FileWrapper and fileinput.FileInput, deprecated since Python 3.9.
2021-09-08 13:07:40 +03:00
Raymond Hettinger 750368cbcd
Add more itertool recipes (GH-28165) 2021-09-07 12:29:00 -05:00
Victor Stinner c4ea45d7d2
bpo-45118: Fix regrtest second summary for re-run tests (GH-28183)
Fix regrtest second summary when using -w/--verbose2 command line
option: lists re-run tests in the second test summary.
2021-09-07 18:21:00 +02:00
Nikita Sobolev 8ca6b61e3f
bpo-45034: Fix how upper limit is formatted for `struct.pack("H", ...)` (GH-28178)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-07 13:18:46 +01:00
Pablo Galindo Salgado 97b754d4b4
Revert "bpo-45035: Make sysconfig posix_home depend on platlibdir (GH-28011)" (GH-28201)
This reverts commit 4f88161f07.
2021-09-07 12:46:25 +01:00
Hugo van Kemenade eb254b43d2
bpo-45124: Remove the bdist_msi command (GH-28195)
The bdist_msi command, deprecated in Python 3.9, is now removed.
Use bdist_wheel (wheel packages) instead.
2021-09-07 12:34:27 +02:00
Pablo Galindo Salgado 533e725821
bpo-44963: Implement send() and throw() methods for anext_awaitable objects (GH-27955)
Co-authored-by: Yury Selivanov <yury@edgedb.com>
2021-09-07 11:30:14 +01:00
Tzu-ping Chung 4f88161f07
bpo-45035: Make sysconfig posix_home depend on platlibdir (GH-28011) 2021-09-07 11:27:48 +01:00
Tzu-ping Chung a5c6bcf244
Make sysconfig posix_user not depend on platlibdir (GH-27655) 2021-09-07 11:26:42 +02:00
Terry Jan Reedy f05ad92028
Update idlelib/help.html to include idle.rst spelling fix (GH-28191)
The idle.rst fix was GH-27903 two weeks ago.
2021-09-07 00:04:54 -04:00
Nikita Sobolev 19871fce3b
bpo-45052: Unskips a failing `test_shared_memory_basics` test (GH-28182) 2021-09-06 17:55:34 +01:00
Irit Katriel 9e31b3952f
bpo-41031: Match C and Python code formatting of unprintable exceptions and exceptions in the __main__ module. (GH-28139) 2021-09-05 18:54:13 +03:00
Pablo Galindo Salgado b01fd533fe
Extract visitors from the grammar nodes and call makers in the peg generator (GH-28172)
Simplify the peg generator logic by extracting as much visitors as possible to disentangle the flow and separate concerns.
2021-09-05 14:58:52 +01:00
Serhiy Storchaka 28264269de
bpo-45102: unittest: add tests for skipping and errors in cleanup (GH-28166) 2021-09-05 10:34:14 +03:00
Raymond Hettinger 91be41ad93
bpo-44571: Add itertool recipe for a variant of takewhile() (GH-28167) 2021-09-05 00:09:26 -05:00
Nikita Sobolev dd7b816ac8
bpo-45042: Now test classes decorated with `requires_hashdigest` are not skipped (GH-28060)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-04 23:42:36 +03:00
Serhiy Storchaka 936f6a16b9
bpo-45030: Fix integer overflow in __reduce__ of the range iterator (GH-28000)
It happened with fast range iterator  when the calculated stop = start + step * len
was out of the C long range.
2021-09-04 21:02:21 +03:00
Serhiy Storchaka c2970fdec5
bpo-45097: Add more tests for shutdown_asyncgens() (GH-28154) 2021-09-04 20:55:20 +03:00
Brandt Bucher 3beef86e22
Handle different string hash algorithms correctly (#28147) 2021-09-04 07:14:27 -07:00
Irit Katriel 0b58e863df
bpo-45075: distinguish between frame and FrameSummary in traceback mo… (GH-28112) 2021-09-03 22:39:23 +01:00
Dong-hee Na bc1c49fa94
bpo-42255: Deprecate webbrowser.MacOSX from Python 3.11 (GH-27837)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-03 18:21:03 +02:00
Batuhan Taskaya 85ea2d6165
bpo-43950: support positions for dis.Instructions created through dis.Bytecode (GH-28142) 2021-09-03 18:29:09 +03:00
Irit Katriel b4b6342848
bpo-45083: Include the exception class qualname when formatting an exception (GH-28119)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-09-03 09:30:17 +02:00
Victor Stinner a1e15a7a60
bpo-45082: Cleanup ctypes.c_buffer alias (GH-28129)
* Remove commented deprecation of ctypes.c_buffer.
* Remove references to ctypes.c_string which doesn't exist.
* Remove StringTestCase: it only had skipped test methods.
2021-09-02 19:02:03 +02:00
Yurii Karabas 0635e201be
bpo-45081: Fix __init__ method generation when inheriting from Protocol (GH-28121)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-09-02 18:17:13 +02:00
Ruben Vorderman ea23e7820f
bpo-43613: Faster implementation of gzip.compress and gzip.decompress (GH-27941)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-02 17:02:59 +02:00
Inada Naoki 55c4a92fc1
bpo-45056: Remove trailing unused constants from co_consts (GH-28109) 2021-09-02 13:02:06 +02:00
Victor Stinner 19ba2122ac
bpo-37330: open() no longer accept 'U' in file mode (GH-28118)
open(), io.open(), codecs.open() and fileinput.FileInput no longer
accept "U" ("universal newline") in the file mode. This flag was
deprecated since Python 3.3.
2021-09-02 12:58:00 +02:00
Victor Stinner a806608705
bpo-45085: Remove the binhex module (GH-28117)
The binhex module, deprecated in Python 3.9, is now removed. The
following binascii functions, deprecated in Python 3.9, are now also
removed:

* a2b_hqx(), b2a_hqx();
* rlecode_hqx(), rledecode_hqx().

The binascii.crc_hqx() function remains available.
2021-09-02 12:10:08 +02:00
Victor Stinner d589a7e7eb
bpo-40360: Deprecate the lib2to3 package (GH-28116) 2021-09-02 11:46:47 +02:00
Victor Stinner 679cb4781e
bpo-44895: libregrtest: refleak check clears types later (GH-28113)
libregrtest now clears the type cache later to reduce the risk of
false alarm when checking for reference leaks. Previously, the type
cache was cleared too early and libregrtest raised a false alarm
about reference leaks under very specific conditions.

Move also support.gc_collect() outside clear/cleanup functions to
make the garbage collection more explicit.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-09-01 17:45:27 +02:00
Irit Katriel 863154c929
bpo-31299: make it possible to filter out frames from tracebacks (GH-28067) 2021-08-31 21:42:08 +01:00