Commit Graph

113555 Commits

Author SHA1 Message Date
oda-gitso 9485a0dbdd
gh-93040 Wrap unused parameters in Objects/obmalloc.c with Py_UNUSED (#93175) 2022-05-25 12:39:06 +02:00
Victor Stinner 5695c0e0a2
gh-91924: Fix __lltrace__ for non-UTF-8 stdout encoding (#93199)
Fix __lltrace__ debug feature if the stdout encoding is not UTF-8.

If the stdout encoding is not UTF-8, the first call to
lltrace_resume_frame() indirectly sets lltrace to 0 when calling
unicode_check_encoding_errors() which calls
encodings.search_function().
2022-05-25 11:45:33 +02:00
Florian Bruhin 19710145b4
test_threaded_import: Fix unittest.main spelling (GH-93114) 2022-05-25 10:59:32 +03:00
Miro Hrončok 16a7e4a0b7
gh-92728: Restore re.template, but deprecate it (GH-93161)
Revert "bpo-47211: Remove function re.template() and flag re.TEMPLATE (GH-32300)"

This reverts commit b09184bf05.
2022-05-25 09:05:35 +03:00
Victor Stinner 08e4e887f2
gh-92658: AF_HYPERV is only supported on Windows (#93192)
Only build the AF_HYPERV support on Windows for the _socket extension.
FreeBSD defines the AF_HYPERV macro but doesn't have the SOCKADDR_HV
type.
2022-05-25 04:44:57 +02:00
neonene ac1dcb8ee7
gh-92434: Silence a compiler warning in _xxsubinterpretersmodule.c for 32bit version (gh-93091) 2022-05-25 10:22:39 +09:00
Tobin Yehle 08cfc3dabf
gh-93035: [Enum] Fix IntFlag crash when no single-bit members (GH-93076)
`EnumType` attempts to create a custom docstring for each enum/flag, but that was failing with pathological flags that had no members (only multi-bit aliases).
2022-05-24 18:16:20 -07:00
Victor Stinner 4a31ed8a32
test.pythoninfo no longer requires socket (#93191)
test.pythoninfo no longer fails if "import socket" fails: the socket
module is now optional.
2022-05-25 02:11:51 +02:00
Victor Stinner 32b7bcffba
gh-93103: Py_DecodeLocale() uses _PyRuntime.preconfig (#93187)
The Py_DecodeLocale() and Py_EncodeLocale() now use
_PyRuntime.preconfig, rather than Py_UTF8Mode and
Py_LegacyWindowsFSEncodingFlag global configuration varibles, to
decide if the UTF-8 encoding is used or not.

As documented, these functions must not be called before Python is
preinitialized. The new PyConfig API should now be used, rather than
using deprecated functions like Py_SetPath() or PySys_SetArgv().
2022-05-25 00:09:48 +02:00
Victor Stinner c7667a2d35
gh-93103: Enhance PyConfig.parser_debug documentation (#93186)
Document that -d option and PYTHONDEBUG env var require a debug
build of Python. Also mention them in the debug build documentation.
2022-05-24 23:23:01 +02:00
Jordan Borean fbd11f3edd
gh-92658: Add Hyper-V socket support (GH-92755) 2022-05-24 21:37:06 +01:00
Victor Stinner 5115a16831
gh-93103: Parser uses PyConfig.parser_debug instead of Py_DebugFlag (#93106)
* Replace deprecated Py_DebugFlag with PyConfig.parser_debug in the
  parser.
* Add Parser.debug member.
* Add tok_state.debug member.
* Py_FrozenMain(): Replace Py_VerboseFlag with PyConfig.verbose.
2022-05-24 22:35:08 +02:00
Kumar Aditya d2ef66a10b
GH-89369: test_contextlib_async finalizes event loop after each test (#93074)
Use asyncio.run().
2022-05-24 15:41:32 +02:00
Florian Bruhin 37c9a351b1
GH-93112: Fix missing ResourceDenied import in test_urllib2net (#93113)
The code was moved out of test.support in
311110abcd (GH-20812), thus making
ResourceDenied undefined.
2022-05-24 14:09:52 +02:00
goldsteinn 7108bdf27c
gh-93033: Use wmemchr in stringlib (GH-93034)
Generally comparable perf for the "good" case where memchr doesn't
return any collisions (false matches on lower byte) but clearly faster
with collisions.
2022-05-24 10:45:31 +09:00
Dong-hee Na f7fabae75c
gh-93099: Fix _pyio to use locale module properly (gh-93136) 2022-05-24 09:37:01 +09:00
Julien Palard e739ff1416
Doc: No need to use rst syntax in code comments. (GH-93102)
And it raises `make suspicious` false positives.
2022-05-23 23:45:16 +02:00
Nicolas Haller 2176898308
gh-92859: Doc: add info about logging.debug() calling basicConfig() (GH-93063) 2022-05-23 20:18:43 +01:00
Yury Selivanov c1f5c903a7
gh-93065: Fix HAMT to iterate correctly over 7-level deep trees (GH-93066)
Also while there, clarify a few things about why we reduce the hash to 32 bits.

Co-authored-by: Eli Libman <eli@hyro.ai>
Co-authored-by: Yury Selivanov <yury@edgedb.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-05-23 21:09:59 +02:00
Ethan Furman a49721ea07
gh-93118: [Enum] fix error message (GH-93138)
Include member names in error message.
2022-05-23 11:21:58 -07:00
Sam Ezeh 202ed2506c
gh-83245: Raise BadZipFile instead of ValueError when reading a corrupt ZIP file (GH-32291)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-23 20:59:21 +03:00
Steve Dower 6a6f823ea7
gh-92913: Fix typos in documentation (GH-93129) 2022-05-23 17:39:10 +01:00
oda-gitso 71abeb0895
gh-93010: InvalidHeaderError used but nonexistent (#93015)
* fix issue 93010

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2022-05-23 09:10:18 -07:00
Steve Dower 949dbf97ba
gh-93005: Fixes launcher test when no Python install is available (GH-93007) 2022-05-23 17:04:26 +01:00
Florian Bruhin d5f0dd1600
GH-93115: Fix version check in sqlite3 module constants test (#93116) 2022-05-23 17:58:11 +02:00
Ethan Furman 046df59658
gh93107: [Enum] fix missing variable in global_str (GH-93107) 2022-05-23 08:56:07 -07:00
Wenzel Jakob b2694ab469
gh-92536: Mark PyUnicode_READY() argument as unused (#93011) 2022-05-23 16:15:09 +02:00
Dennis Sweeney a458be3263
gh-93061: Mark as artificial: backwards jump after async for (GH-93062) 2022-05-23 13:58:41 +01:00
Victor Stinner fc00667247
gh-93103: Update PyUnicode_DecodeFSDefault() doc (#93105)
Update documentation of PyUnicode_DecodeFSDefault(),
PyUnicode_DecodeFSDefaultAndSize() and PyUnicode_EncodeFSDefault():
they now use the filesystem encoding and error handler of PyConfig,
Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors
variables are no longer used.
2022-05-23 14:56:59 +02:00
Victor Stinner 764e83db85
gh-93103: Deprecate global configuration variable (#93104)
Deprecate global configuration variables, like
Py_IgnoreEnvironmentFlag, in the documentation: the
Py_InitializeFromConfig() API should be instead.
2022-05-23 14:56:35 +02:00
Christian Heimes 760ec8940a
gh-90473: WASI: skip gethostname tests (GH-93092)
- WASI's ``gethostname()`` is a stub that always fails with OSError
  ``ENOTSUP``
- skip mailcap ``test`` if subprocess is not available
- WASI process_time clock does not work.
2022-05-23 10:39:57 +02:00
Nicolas Haller 88f0d0c1e8
gh-89158: Add some REPL secondary prompt markers (#93073)
This fixes an issue on tutorial/classes.rst section 9.4 where the example "class Warehouse"
was truncated when pressing the >>> button to hide the prompts and output.
2022-05-23 00:58:07 -04:00
Mori Bellamy 9bc616cb4c
gh-91061: also accept pathlib.Path for winsound.PlaySound (#91489)
Fixes #91061

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-22 18:54:24 -07:00
Shantanu e39cd76561
gh-92994: Clarify importlib "check" example (#92995)
Fixes #92994
2022-05-22 18:53:24 -07:00
Stanley b7a6610bc8
gh-73137: Added sub-subsection headers for flags in re (#93000)
Fixes #73137
2022-05-22 18:52:17 -07:00
Jelle Zijlstra ac718d357a
binascii docs: strict_mode parameter is keyword-only (#93055)
See 35b98e38b6

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-05-22 18:48:17 -07:00
Jelle Zijlstra ea5918e932
termios docs: fix indentation (#93080) 2022-05-22 15:55:11 -07:00
Serhiy Storchaka e5d8dbdd30
Clean up the sqlite3 tests (GH-93056)
Remove helper managed_connect(). Use memory_database() or
contextlib.closing() + addCleanup(unlink) instead.
2022-05-21 19:06:12 +03:00
Shantanu f9d6c59917
gh-91362: reword pickle docs to account for nested classes (#92429)
Fixes #91362
2022-05-21 07:54:10 -07:00
Serhiy Storchaka 4e2b664892
Improve tests for opening Sqlite by URI (GH-93047)
* Test with with escaped non-ascii characters
* Test read-only open of existing DB.
2022-05-21 17:38:22 +03:00
serge-sans-paille 5b71b519f9
GH-92898: Make _Py_Cast C++ version compatible with cast operator (gh-92951) 2022-05-21 22:16:37 +09:00
Serhiy Storchaka 14c0d33016
gh-93044: No longer convert the database argument of sqlite3.connect() to bytes (GH-93046)
Just pass it to the factory as is.
2022-05-21 14:35:46 +03:00
Varun Sharma b96e20c1d9
ci: add GitHub token permissions (#92999) 2022-05-21 03:55:21 -04:00
Serhiy Storchaka 7f835923c1
gh-71223: Improve rendering of some references in the docs (GH-93041)
For example, instead of "eval()uated" (link from "eval()")
show "evaluated" (link from the whole word).
2022-05-21 10:33:23 +03:00
Shantanu 2fadde7e66
gh-93019: Fix markup in zipfile.rst (#93025)
Fixes #93019
2022-05-20 21:36:09 -07:00
Raymond Hettinger 59719a242d
Take advantage of math.comb() in the nth_combination() recipe (#93027) 2022-05-20 18:02:33 -05:00
Brett Cannon d59b2d0441
Fix a directive in the `pathlib` docs (GH-93030) 2022-05-20 15:52:38 -07:00
Stanley f51ed04c66
gh-72073: Add Windows case in pathlib.rename (GH-93002)
#72073

https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.rename
2022-05-20 15:25:39 -07:00
CAM Gerlach 31fa41ed68
gh-92611: Clarify planned removal version in PEP 594-deprecated modules (GH-92793)
As discussed in #92611 and #92564 and as a followup to PR #92612 , this 3.11+ only PR uses the proper `deprecated-removed` role for the modules deprecated by PEP 593 (PEP-594) to clearly indicate to users that a removal version is planned and what it is, so they can prepare accordingly or voice any unanticipated impacts.

Related to #92792 ; if we decide to backport that PR, the upgrade to using `deprecated-removed` on those functions can be moved to this one.
2022-05-20 14:47:51 -07:00
Lucinda May Phipps 87b9b4e060
shutil._copyfileobj_readinto: tiny speedup (#92377) 2022-05-20 08:14:05 -07:00