-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-74953: _PyThread_cond_after() uses _PyTime_t #94056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pthread _PyThread_cond_after() implementation now uses the _PyTime_t type to handle properly overflow: clamp to the maximum value.
serhiy-storchaka
added a commit
that referenced
this pull request
Jun 26, 2022
* GH-93444: remove redundant fields from basicblock: b_nofallthrough, b_exit, b_return (GH-93445) * netrc: Remove unused "import shlex" (#93311) * gh-92886: Fix test that fails when running with `-O` in `test_imaplib.py` (#93237) * Fix missing word in sys.float_info docstring (GH-93489) * [doc] Correct a grammatical error in a docstring. (GH-93441) * gh-93442: Make C++ version of _Py_CAST work with 0/NULL. (#93500) Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow C++ extensions that pass 0 or NULL to macros using _Py_CAST() to continue to compile. Without this, you get an error like: invalid ‘static_cast’ from type ‘int’ to type ‘_object*’ The modern way to use a NULL value in C++ is to use nullptr. However, we want to not break extensions that do things the old way. Co-authored-by: serge-sans-paille * gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) * gh-90473: wasmtime does not support absolute symlinks (GH-93490) * gh-89973: Fix re.error in the fnmatch module. (GH-93072) Character ranges with upper bound less that lower bound (e.g. [c-a]) are now interpreted as empty ranges, for compatibility with other glob pattern implementations. Previously it was re.error. * Document LOAD_FAST_CHECK opcode (#93498) * gh-93247: Fix assert function in asyncio locks test (#93248) * gh-90473: WASI requires proper open(2) flags (GH-93529) * GH-92308 What's New: list pending removals in 3.13 and future versions (#92562) * gh-90473: Skip POSIX tests that don't apply to WASI (GH-93536) * asyncio.Barrier docs: Fix typo (#93371) taks -> tasks * gh-83728: Add hmac.new default parameter deprecation (GH-91939) * gh-90473: Make chmod a dummy on WASI, skip chmod tests (GH-93534) WASI does not have the ``chmod(2)`` syscall yet. * Remove action=None kwarg from Barrier docs (GH-93538) * [docs] fix some asyncio.Barrier.wait docs grammar (GH-93552) * gh-93475: Expose FICLONE and FICLONERANGE constants in fcntl (#93478) * gh-89018: Improve documentation of `sqlite3` exceptions (#27645) - Order exceptions as in PEP 249 - Reword descriptions, so they match the current behaviour Co-authored-by: Alex Waygood <[email protected]> * bpo-42658: Use LCMapStringEx in ntpath.normcase to match OS behaviour for case-folding (GH-32010) * Fix contributor name in WhatsNew 3.11 (GH-93556) * Grammar fix to socket error string (GH-93523) * gh-86986: bump min sphinx version to 3.2 (GH-93337) * gh-79096: Protect cookie file created by {LWP,Mozilla}CookieJar.save() (GH-93463) Note: This change is not effective on Microsoft Windows. Cookies can store sensitive information and should therefore be protected against unauthorized third parties. This is also described in issue #79096. The filesystem permissions are currently set to 644, everyone can read the file. This commit changes the permissions to 600, only the creater of the file can read and modify it. This improves security, because it reduces the attack surface. Now the attacker needs control of the user that created the cookie or a ways to circumvent the filesystems permissions. This change is backwards incompatible. Systems that rely on world-readable cookies will breake. However, one could argue that those are misconfigured in the first place. * gh-93162: Add ability to configure QueueHandler/QueueListener together (GH-93269) Also, provide getHandlerByName() and getHandlerNames() APIs. Closes #93162. * gh-57539: Increase calendar test coverage (GH-93468) Co-authored-by: Sean Fleming Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Łukasz Langa <[email protected]> * gh-88831: In docs for asyncio.create_task, explain why strong references to tasks are needed (GH-93258) Co-authored-by: Łukasz Langa <[email protected]> * Shrink the LOAD_METHOD cache by one codeunit. (#93537) * Fix MSVC compiler warnings in ceval.c (#93569) * gh-93162: test_config_queue_handler requires threading (GH-93572) * gh-84461: Emscripten's faccessat() does not accept flags (GHß92353) * gh-92592: Allow logging filters to return a LogRecord. (GH-92591) * Fix `PurePath.relative_to` links in the pathlib documentation. (GH-93268) These are currently broken as they refer to :meth:`Path.relative_to` rather than :meth:`PurePath.relative_to`, and `relative_to` is a method on `PurePath`. * GH-93481: Suppress expected deprecation warning in test_pyclbr (GH-93483) * gh-93370: Deprecate sqlite3.version and sqlite3.version_info (#93482) Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]> * GH-93521: For dataclasses, filter out `__weakref__` slot if present in bases (GH-93535) * gh-93421: Update sqlite3 cursor.rowcount only after SQLITE_DONE (#93526) * gh-93584: Make all install+tests targets depends on all (GH-93589) All install targets use the "all" target as synchronization point to prevent race conditions with PGO builds. PGO builds use recursive make, which can lead to two parallel `./python setup.py build` processes that step on each others toes. "test" targets now correctly compile PGO build in a clean repo. * gh-87961: Remove outdated notes from functions that aren't in the Limited API (GH-93581) * Remove outdated notes from functions that aren't in the Limited API Nowadays everything that *is* in the Limited API has a note added automatically. These notes could mislead people to think that these functions could never be added to the limited API. Remove them. * Also remove forgotten note on tp_vectorcall_offset not being finalized * gh-93180: Update os.copy_file_range() documentation (#93182) * gh-93575: Use correct way to calculate PyUnicode struct sizes (GH-93602) * gh-93575: Use correct way to calculate PyUnicode struct sizes * Add comment to keep test_sys and test_unicode in sync * Fix case code < 256 * gh-90473: Define HOSTRUNNER for WASI (GH-93606) * gh-79096: Fix/improve http cookiejar tests (GH-93614) Fixup of GH-93463: - remove stray print - use proper way to check file mode - add working chmod decorator Co-authored-by: Łukasz Langa <[email protected]> * gh-93616: Fix env changed issue in test_modulefinder (GH-93617) * gh-90494: Reject 6th element of the __reduce__() tuple (GH-93609) copy.copy() and copy.deepcopy() now always raise a TypeError if __reduce__() returns a tuple with length 6 instead of silently ignore the 6th item or produce incorrect result. * Doc: Update references and examples of old, unsupported OSes and uarches (GH-92791) * bpo-45383: Get metaclass from bases in PyType_From* (GH-28748) This checks the bases of of a type created using the FromSpec API to inherit the bases metaclasses. The metaclass's alloc function will be called as is done in `tp_new` for classes created in Python. Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Erlend Egeberg Aasland <[email protected]> * Improve logging documentation with example and additional cookbook re… (GH-93644) * gh-90473: disable user site packages on WASI/Emscripten (GH-93633) * gh-90473: Skip get_config_h() tests on WASI (GH-93645) * gh-90549: Fix leak of global named resources using multiprocessing spawn (#30617) Co-authored-by: XD Trol <[email protected]> Co-authored-by: Antoine Pitrou <[email protected]> * gh-92434: Silence compiler warning in Modules/_sqlite/connection.c on 32-bit systems (#93090) * gh-90763: Modernise xx template module initialisation (#93078) Use C APIs such as PyModule_AddType instead of PyModule_AddObject. Also remove incorrect module decrefs if module fails to initialise. * gh-93491: Add support tier detection to configure (GH-93492) Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Steve Dower <[email protected]> Co-authored-by: Erlend Egeberg Aasland <[email protected]> * gh-93466: Document PyType_Spec doesn't accept repeated slot IDs; raise where this was problematic (GH-93471) * gh-93671: Avoid exponential backtracking in deeply nested sequence patterns in match statements (GH-93680) Co-authored-by: Łukasz Langa <[email protected]> * gh-81790: support "UNC" device paths in `ntpath.splitdrive()` (GH-91882) * GH-93621: reorder code in with/async-with exception exit path to reduce the size of the exception table (GH-93622) * gh-93461: Invalidate sys.path_importer_cache entries with relative paths (GH-93653) * gh-91317: Document that Path does not collapse initial `//` (GH-32193) Documentation for `pathlib` says: > Spurious slashes and single dots are collapsed, but double dots ('..') are not, since this would change the meaning of a path in the face of symbolic links: However, it omits that initial double slashes also aren't collapsed. Later, in documentation of `PurePath.drive`, `PurePath.root`, and `PurePath.name` it mentions UNC but: - this abbreviation says nothing to a person who is unaware about existence of UNC (Wikipedia doesn't help either by [giving a disambiguation page](https://en.wikipedia.org/wiki/UNC)) - it shows up only if a person needs to use a specific property or decides to fully learn what the module provides. For context, see the BPO entry. * gh-92886: Fix tests that fail when running with optimizations (`-O`) in `test_zipimport.py` (GH-93236) * gh-92930: _pickle.c: Acquire strong references before calling save() (GH-92931) * gh-84461: Use HOSTRUNNER to run regression tests (GH-93694) Co-authored-by: Brett Cannon <[email protected]> * gh-90473: Skip test_queue when threading is not available (GH-93712) * gh-90153: whatsnew: "z" option in format spec (GH-93624) Add what's new entry for PEP 682 in Python 3.11. * gh-86404: [doc] A make sucpicious false positive. (GH-93710) * Change list to view object (#93661) * gh-84508: tool to generate cjk traditional chinese mappings (gh-93272) * Remove usage of _Py_IDENTIFIER from math module (#93739) * gh-91162: Support splitting of unpacked arbitrary-length tuple over TypeVar and TypeVarTuple parameters (alt) (GH-93412) For example: A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]] A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int] * gh-93728: fix memory leak in deepfrozen code objects (GH-93729) * gh-93747: Fix Refleak when handling multiple Py_tp_doc slots (gh-93749) * GH-90699: use statically allocated strings in typeobject.c (gh-93751) * Add more FOR_ITER specialization stats (GH-32151) * gh-89653: PEP 670: Convert PyFunction macros (#93765) Convert PyFunction macros to static inline functions. * Remove ANY_VARARGS() macro from the C API (#93764) The macro was exposed by mistake. * gh-84623: Remove unused imports in stdlib (#93773) * gh-91731: Don't define 'static_assert' in C++11 where is a keyword to avoid UB (GH-93700) * gh-84623: Remove unused imports in tests (#93772) * gh-93353: Fix importlib.resources._tempfile() finalizer (#93377) Fix the importlib.resources.as_file() context manager to remove the temporary file if destroyed late during Python finalization: keep a local reference to the os.remove() function. Patch by Victor Stinner. * gh-84461: Fix parallel testing on WebAssembly (GH-93768) * gh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766) Header files in the Include/cpython/ are only included if the Py_LIMITED_API macro is not defined. * gh-93353: Add test.support.late_deletion() (#93774) * gh-93741: Add private C API _PyImport_GetModuleAttrString() (GH-93742) It combines PyImport_ImportModule() and PyObject_GetAttrString() and saves 4-6 lines of code on every use. Add also _PyImport_GetModuleAttr() which takes Python strings as arguments. * gh-79512: Fixed names and __module__ value of weakref classes (GH-93719) Classes ReferenceType, ProxyType and CallableProxyType have now correct atrtributes __module__, __name__ and __qualname__. It makes them (types, not instances) pickleable. * gh-91810: Fix regression with writing an XML declaration with encoding='unicode' (GH-93426) Suppress writing an XML declaration in open files in ElementTree.write() with encoding='unicode' and xml_declaration=None. If file patch is passed to ElementTree.write() with encoding='unicode', always open a new file in UTF-8. * gh-93761: Fix test to avoid simple delay when synchronizing. (GH-93779) * gh-89546: Clean up PyType_FromMetaclass (GH-93686) When changing PyType_FromMetaclass recently (GH-93012, GH-93466, GH-28748) I found a bunch of opportunities to improve the code. Here they are. Fixes: #89546 Automerge-Triggered-By: GH:encukou * gh-91321: Fix compatibility with C++ older than C++11 (#93784) Fix the compatibility of the Python C API with C++ older than C++11. _Py_NULL is only defined as nullptr on C++11 and newer. * GH-93662: Make sure that column offsets are correct in multi-line method calls. (GH-93673) * GH-93516: Store offset of first traceable instruction in code object (GH-93769) * gh-90473: Include stdlib dir in wasmtime PYTHONPATH (GH-93797) * GH-93429: Merge `LOAD_METHOD` back into `LOAD_ATTR` (GH-93430) * gh-93353: regrtest checks for leaked temporary files (#93776) When running tests with -jN, create a temporary directory per process and mark a test as "environment changed" if a test leaks a temporary file or directory. * gh-79579: Improve DML query detection in sqlite3 (#93623) The fix involves using pysqlite_check_remaining_sql(), not only to check for multiple statements, but now also to strip leading comments and whitespace from SQL statements, so we can improve DML query detection. pysqlite_check_remaining_sql() is renamed lstrip_sql(), to more accurately reflect its function, and hardened to handle more SQL comment corner cases. * GH-93678: reduce boilerplate and code repetition in the compiler (GH-93682) * gh-91877: Fix WriteTransport.get_write_buffer_{limits,size} docs (#92338) - Amend docs for WriteTransport.get_write_buffer_limits - Add docs for WriteTransport.get_write_buffer_size * GH-93429: Document `LOAD_METHOD` removal (GH-93803) * Include freelists in allocation total. (GH-93799) * gh-93795: Use test.support TESTFN/unlink in sqlite3 tests (#93796) * Remove LOAD_METHOD stats. (GH-93807) * Rename 'LOAD_METHOD' specialization stat consts to 'ATTR'. (GH-93812) * gh-93353: Fix regrtest for -jN with N >= 2 (GH-93813) * [docs] Fix LOAD_ATTR version changed (GH-93816) * gh-93814: Add infinite test for itertools.chain.from_iterable (GH-93815) fix #93814 Automerge-Triggered-By: GH:rhettinger * gh-93735: Split Docs CI to speed-up the build (GH-93736) * gh-93183: Adjust wording in socket docs (#93832) package => packet Co-authored-by: Victor Norman * gh-93829: In sqlite3, replace Py_BuildValue with faster APIs (#93830) - In Modules/_sqlite/connection.c, use PyLong_FromLong - In Modules/_sqlite/microprotocols.c, use PyTuple_Pack * Add test.support.busy_retry() (
pthread _PyThread_cond_after() implementation now uses the _PyTime_t
type to handle properly overflow: clamp to the maximum value.