gh-115320: Refactor `get_hash_info` in `sysmodule.c` not to swallow errors (GH-115321)
(cherry picked from commit 207030f552)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-116281: Remove wrong '\' from '\*' in some doc signatures (#116282)
(cherry picked from commit 4859ecb860)
Co-authored-by: HarryLHW 123lhw321@gmail.com
Improve algorithm for computing which rolled-over log files to delete
in logging.TimedRotatingFileHandler. It is now reliable for handlers
without namer and with arbitrary deterministic namer that leaves
the datetime part in the file name unmodified.
(cherry picked from commit 87faec28c7)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-115978: Disable `*readv()` and `*writev()` on WASI (GH-116228)
Wasmtime doesn't implement these functions in a way to pass test_posix (https://github.com/bytecodealliance/wasmtime/issues/7830).
(cherry picked from commit 5dc8c84d39)
Co-authored-by: Brett Cannon <brett@python.org>
This mostly restores information removed in c12240ed28 (GH-114749).
(cherry picked from commit 05b04903a1)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Do not overwrite already rolled over files. It happened at midnight or
during the DST change and caused the loss of data.
* computeRollover() now always return the timestamp larger than the
specified time.
* Fix computation of the rollover time during the DST change.
(cherry picked from commit fee86fd9a4)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Support callables with the __call__() method and types with
__new__() and __init__() methods set to class methods, static
methods, bound methods, partial functions, and other types of
methods and descriptors.
Add tests for numerous types of callables and descriptors.
(cherry picked from commit 59167c962e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-87115: Set `__main__.__spec__` to `None` in pdb (#116141)
(cherry picked from commit ccfc042bbf)
* [3.11] gh-87115: Set `__main__.__spec__` to `None` in pdb (GH-116141)
(cherry picked from commit ccfc042bbf)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Fix rendering of null character in ast.rst (GH-116080)
(cherry picked from commit c04a981ff4)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission error (GH-116105)
(cherry picked from commit 186fa93876)
gh-116103: Prevent error in WindowsLoadTracker.__del__ if there was a permission error
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-115197: Stop resolving host in urllib.request proxy bypass (GH-115210)
Use of a proxy is intended to defer DNS for the hosts to the proxy itself, rather than a potential for information leak of the host doing DNS resolution itself for any reason. Proxy bypass lists are strictly name based. Most implementations of proxy support agree.
(cherry picked from commit c43b26d02e)
Co-authored-by: Weii Wang <weii.wang@canonical.com>
(cherry picked from commit 6c1c94dc51)
Introduce a new subsubsection, 'Functions', for module level functions,
and place it before the PrettyPrinter class reference.
Also:
- Fix pprint.pprint() references so they properly link to the module
level function.
- Add links to sys.stdout.
Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
doc: Use super() in subclassed JSONEncoder examples (GH-115565)
Replace calls to `json.JSONEncoder.default(self, obj)`
by `super().default(obj)` within the examples of the documentation.
(cherry picked from commit 647053fed1)
Co-authored-by: Jan Max Meyer <jmm@phorward.de>
* Increase coverage for compressed file-like objects initialized with a
file name, an open file object, a file object opened by file
descriptor, and a file-like object without name and mode attributes
(io.BytesIO)
* Increase coverage for name, fileno(), mode, readable(), writable(),
seekable() in different modes and states
* No longer skip tests with bytes names
* Test objects implementing the path protocol, not just pathlib.Path.
(cherry picked from commit e72576c48b)
Listener.accept() no longer hangs when authkey is an empty bytes object.
(cherry picked from commit 686ec17f50)
Co-authored-by: Miguel Brito <5544985+miguendes@users.noreply.github.com>
gh-114763: Protect lazy loading modules from attribute access races (GH-114781)
Setting the __class__ attribute of a lazy-loading module to ModuleType enables other threads to attempt to access attributes before the loading is complete. Now that is protected by a lock.
(cherry picked from commit 200271c61d)
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* clean up fcntl module doc
* simplify
* a few changes, based on suggestion by CAM-Gerlach
* nitpick ignore for a couple other C functions mentioned in the fcntl module doc
* more changes, especially related to LOCK_* constants
* :data: back to :const:
* Apply suggestions from code review
---------
(cherry picked from commit 84a275c4a2)
Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Arguments to enterabs() are specified as Unix time.
If the scheduler use the time.monotonic timer, the code will take
decades to complete.
(cherry picked from commit cb287d3421)
Co-authored-by: mauricelambert <50479118+mauricelambert@users.noreply.github.com>
shm_open() and shm_unlink() now check for embedded null characters in
the name and raise an error instead of silently truncating it.
(cherry picked from commit 79811ededd)
Added to repr entry in Doc/library/functions.rst.
---------
(cherry picked from commit 5770006ffa)
Co-authored-by: Oh seungmin <tmdals179@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Thanks to Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) for help with this bug.
(cherry picked from commit f7455864f2)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>