cpython/Lib
Eric Snow b2e71ff4f8
gh-120161: Fix a Crash in the _datetime Module (gh-120182)
In gh-120009 I used an atexit hook to finalize the _datetime module's static types at interpreter shutdown.  However, atexit hooks are executed very early in finalization, which is a problem in the few cases where a subclass of one of those static types is still alive until the final GC collection.  The static builtin types don't have this probably because they are finalized toward the end, after the final GC collection.  To avoid the problem for _datetime, I have applied a similar approach here.

Also, credit goes to @mgorny and @neonene for the new tests.

FYI, I would have liked to take a slightly cleaner approach with managed static types, but wanted to get a smaller fix in first for the sake of backporting.  I'll circle back to the cleaner approach with a future change on the main branch.
2024-06-14 13:29:09 -06:00
..
__phello__
_pyrepl gh-120417: Remove unused imports in the stdlib (#120420) 2024-06-12 20:56:42 +02:00
asyncio gh-113892: Add a extra check to `ProactorEventLoop.sock_connect` to ensure that the given socket is in non-blocking mode (#119519) 2024-06-01 09:05:19 -07:00
collections gh-120417: Fix "imported but unused" linter warnings (#120461) 2024-06-14 20:39:50 +02:00
concurrent gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
ctypes gh-87969: Align docs and docstrings with implementation for ctypes' [w]string_at() (#25384) 2024-04-18 14:57:37 +00:00
curses gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
dbm gh-120417: Remove unused imports in the stdlib (#120420) 2024-06-12 20:56:42 +02:00
email Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
encodings gh-85287: Change codecs to raise precise UnicodeEncodeError and UnicodeDecodeError (#113674) 2024-03-17 04:58:42 +00:00
ensurepip gh-114965: Updated bundled pip to 24.0 (gh-114966) 2024-02-03 17:45:09 +00:00
html
http Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
idlelib gh-120417: Remove unused imports in the stdlib (#120420) 2024-06-12 20:56:42 +02:00
importlib gh-120417: Fix "imported but unused" linter warnings (#120461) 2024-06-14 20:39:50 +02:00
json gh-95382: Improve performance of json encoder with indent (GH-118105) 2024-05-06 11:04:39 +03:00
logging gh-119819: Update logging configuration to support joinable multiproc… (GH-120090) 2024-06-05 07:25:47 +01:00
multiprocessing gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
pathlib GH-73991: Add `pathlib.Path.copy()` (#119058) 2024-06-14 17:15:49 +01:00
pydoc_data Python 3.13.0b1 2024-05-08 11:21:00 +02:00
re gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
site-packages
sqlite3 gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
sysconfig gh-116622: Android sysconfig updates (#118352) 2024-05-01 16:47:54 +00:00
test gh-120161: Fix a Crash in the _datetime Module (gh-120182) 2024-06-14 13:29:09 -06:00
tkinter gh-120211: Fix tkinter.ttk with Tcl/Tk 9.0 (GH-120213) 2024-06-07 10:49:07 +00:00
tomllib
turtledemo gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
unittest gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
urllib gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
venv gh-90329: Add _winapi.GetLongPathName and GetShortPathName and use in venv to reduce warnings (GH-117817) 2024-04-15 15:36:06 +01:00
wsgiref Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
xml gh-120417: Fix "imported but unused" linter warnings (#120461) 2024-06-14 20:39:50 +02:00
xmlrpc
zipfile gh-119588: Implement zipfile.Path.is_symlink (zipp 3.19.0). (#119591) 2024-06-03 11:13:07 -04:00
zoneinfo gh-106233: Fix stacklevel in zoneinfo.InvalidTZPathWarning (GH-106234) 2024-02-06 15:08:56 +02:00
__future__.py
__hello__.py
_aix_support.py
_android_support.py gh-116622: Redirect stdout and stderr to system log when embedded in an Android app (#118063) 2024-04-30 16:00:31 +02:00
_collections_abc.py gh-118803: Remove `ByteString` from `typing` and `collections.abc` (#118804) 2024-05-09 00:37:55 +01:00
_colorize.py gh-117225: Move colorize functionality to own internal module (#118283) 2024-05-01 12:27:06 -06:00
_compat_pickle.py
_compression.py
_ios_support.py gh-119253: use ImportError in _ios_support (#119254) 2024-05-20 16:39:30 -04:00
_markupbase.py
_opcode_metadata.py gh-119676: remove several pseudo instructions which are use only in codegen (#119677) 2024-05-28 19:05:38 +00:00
_osx_support.py gh-102362: Fix macOS version number in result of sysconfig.get_platform() (GH-112942) 2023-12-18 18:51:58 -05:00
_py_abc.py
_pydatetime.py gh-120268: Prohibit passing ``None`` to ``_pydatetime.date.fromtimestamp`` (#120269) 2024-06-08 16:45:57 -04:00
_pydecimal.py gh-118164: str(10**10000) hangs if the C _decimal module is missing (#118503) 2024-05-04 18:22:33 -05:00
_pyio.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
_pylong.py gh-119057: Use better error messages for zero division (#119066) 2024-06-03 19:03:56 +03:00
_sitebuiltins.py
_strptime.py GH-70647: Deprecate strptime day of month parsing without a year present to avoid leap-year bugs (GH-117107) 2024-04-03 14:19:49 +02:00
_threading_local.py
_weakrefset.py
abc.py
antigravity.py
argparse.py gh-118805: Remove type, choices, metavar params of `BooleanOptionalAction` (#118806) 2024-05-09 11:46:45 +00:00
ast.py gh-117865: Defer import of re in ast (#119546) 2024-05-28 11:04:08 -07:00
base64.py gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
bdb.py gh-58933: Make pdb return to caller frame correctly when f_trace is not set (#118979) 2024-05-13 13:38:21 +01:00
bisect.py
bz2.py gh-115961: Add name and mode attributes for compressed file-like objects (GH-116036) 2024-04-21 11:46:39 +03:00
cProfile.py gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
calendar.py gh-112240: Add option to calendar module CLI to specify the weekday to start each week (GH-112241) 2024-01-29 16:58:21 +00:00
cmd.py Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
code.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
codecs.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
codeop.py gh-113744: Add a new IncompleteInputError exception to improve incomplete input detection in the codeop module (#113745) 2024-01-30 16:21:30 +00:00
colorsys.py
compileall.py gh-117205: Increase chunksize when compiling pyc in parallel (#117206) 2024-04-03 15:24:24 -07:00
configparser.py Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
contextlib.py gh-103791: handle `BaseExceptionGroup` in `contextlib.suppress()` (#111910) 2023-11-10 13:32:36 +00:00
contextvars.py
copy.py gh-114264: Optimize performance of copy.deepcopy by adding a fast path for atomic types (GH-114266) 2024-06-07 18:42:01 +03:00
copyreg.py
csv.py gh-114628: Display csv.Error without context (#115005) 2024-02-04 20:57:54 -05:00
dataclasses.py gh-120417: Remove unused imports in the stdlib (#120420) 2024-06-12 20:56:42 +02:00
datetime.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
decimal.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
difflib.py gh-115801: Only allow sequence of strings as input for difflib.unified_diff (GH-118333) 2024-06-10 14:06:18 +03:00
dis.py gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321) 2024-05-22 00:46:39 +00:00
doctest.py Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
enum.py gh-118650: Exclude `_repr_*` methods from Enum's _sunder_ reservation (GH-118651) 2024-05-07 12:35:51 +02:00
filecmp.py gh-57141: Add dircmp shallow option (GH-109499) 2024-03-04 17:27:43 +00:00
fileinput.py Use bool in fileinput.input() docstring and tests for the inplace argument (GH-111998) 2024-01-27 23:47:55 +02:00
fnmatch.py GH-72904: Add `glob.translate()` function (#106703) 2023-11-13 17:15:56 +00:00
fractions.py gh-119838: Treat Fraction as a real value in mixed arithmetic operations with complex (GH-119839) 2024-06-03 12:29:01 +03:00
ftplib.py Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
functools.py GH-100242: bring functools.py partial implementation more in line with C code (GH-100244) 2024-04-17 15:34:46 +02:00
genericpath.py gh-117114: Make os.path.isdevdrive available on all platforms (GH-117115) 2024-03-25 22:55:11 +00:00
getopt.py Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
getpass.py gh-76912: Raise OSError from any failure in getpass.getuser() (#29739) 2023-11-27 10:05:55 -08:00
gettext.py gh-88434: Emit deprecation warnings for non-integer numbers in gettext if translation not found (GH-110574) 2023-10-14 09:07:02 +03:00
glob.py GH-116380: Move pathlib-specific code from `glob` to `pathlib._abc`. (#120011) 2024-06-07 17:59:34 +01:00
graphlib.py
gzip.py gh-115961: Add name and mode attributes for compressed file-like objects (GH-116036) 2024-04-21 11:46:39 +03:00
hashlib.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
heapq.py gh-119721: Integrate documentation fixes into heapq module docstring. (gh-119722) 2024-05-29 11:39:34 -05:00
hmac.py gh-112999: Replace the outdated "deprecated" directives with "versionchanged" (GH-113000) 2023-12-12 18:31:04 +02:00
imaplib.py Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
inspect.py gh-114053: Fix bad interaction of PEP 695, PEP 563 and `inspect.get_annotations` (#120270) 2024-06-13 21:16:40 +00:00
io.py gh-111356: io: Add missing documented objects to io.__all__ (#111370) 2023-11-10 16:18:52 +09:00
ipaddress.py gh-120128: fix description of argument to ipaddress.collapse_addresses() (#120131) 2024-06-06 00:52:40 +03:00
keyword.py
linecache.py linecache: Fix docstring location (#117948) 2024-04-16 15:37:18 -07:00
locale.py gh-91565: Replace bugs.python.org links with Devguide/GitHub ones (GH-91568) 2024-04-01 13:02:07 +00:00
lzma.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
mailbox.py gh-117467: Add preserving of mailbox owner on flush (GH-117510) 2024-04-04 13:32:53 +03:00
mimetypes.py Remove almost all unpaired backticks in docstrings (#119231) 2024-05-22 12:35:18 -04:00
modulefinder.py gh-114099 - Add iOS framework loading machinery. (GH-116454) 2024-03-19 08:36:19 -04:00
netrc.py
ntpath.py gh-120417: Remove unused imports in the stdlib (#120420) 2024-06-12 20:56:42 +02:00
nturl2path.py
numbers.py
opcode.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
operator.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
optparse.py
os.py gh-120057: Add os.environ.refresh() method (#120059) 2024-06-10 16:34:17 +00:00
pdb.py gh-119824: Print stack entry when user input is needed (#119882) 2024-06-14 11:25:23 -07:00
pickle.py gh-85567: Fix resouce warnings in pickle and pickletools CLIs (GH-113618) 2024-01-06 00:12:34 +02:00
pickletools.py gh-115146: Fix typo in pickletools.py documentation (GH-115148) 2024-02-08 10:12:58 +02:00
pkgutil.py
platform.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
plistlib.py gh-111803: Support loading more deeply nested lists in binary plist format (GH-114024) 2024-01-13 15:26:55 +02:00
poplib.py
posixpath.py pathlib ABCs: remove duplicate `realpath()` implementation. (#119178) 2024-06-05 18:54:50 +01:00
pprint.py [pprint]: Add docstring about `PrettyPrinter.underscore_numbers` parameter (#112963) 2023-12-13 12:04:17 +00:00
profile.py gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
pstats.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
pty.py gh-118824: Remove deprecated `master_open` and `slave_open` from `pty` (#118826) 2024-05-28 16:42:35 +03:00
py_compile.py
pyclbr.py
pydoc.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
queue.py gh-117531: Unblock getters after non-immediate queue shutdown (#117532) 2024-04-10 08:01:42 -07:00
quopri.py gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
random.py gh-118131: Command-line interface for the `random` module (#118132) 2024-05-05 06:30:03 +00:00
reprlib.py gh-109818: `reprlib.recursive_repr` copies `__type_params__` (#109819) 2023-09-27 19:26:42 -07:00
rlcompleter.py gh-113978: Ignore warnings on text completion inside REPL (#113979) 2024-05-21 18:28:21 +02:00
runpy.py gh-99437: runpy: decode path-like objects before setting globals 2024-01-15 16:58:50 +00:00
sched.py
secrets.py
selectors.py gh-110038: KqueueSelector must count all read/write events (#110039) 2023-09-28 17:25:10 +00:00
shelve.py
shlex.py
shutil.py GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (#119808) 2024-06-01 19:49:12 +01:00
signal.py gh-112559: Avoid unnecessary conversion attempts to enum_klass in signal.py (#113040) 2023-12-23 17:07:52 -08:00
site.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
smtplib.py gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
socket.py gh-110383: Document `socket.makefile()` accepts combined modes (#119150) 2024-05-21 16:23:50 +00:00
socketserver.py
sre_compile.py
sre_constants.py
sre_parse.py
ssl.py gh-107361: strengthen default SSL context flags (#112389) 2024-03-06 13:44:58 -08:00
stat.py gh-120417: Remove unused imports in the stdlib (#120420) 2024-06-12 20:56:42 +02:00
statistics.py Refactor (mostly rearrange) the statistics module (gh-119930) 2024-06-01 22:07:46 -05:00
string.py
stringprep.py
struct.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
subprocess.py gh-120417: Fix "imported but unused" linter warnings (#120461) 2024-06-14 20:39:50 +02:00
symtable.py gh-120417: Add #noqa to used imports in the stdlib (#120421) 2024-06-13 16:14:50 +02:00
tabnanny.py gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
tarfile.py gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
tempfile.py gh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod() on Windows (GH-113049) 2023-12-14 13:28:37 +02:00
textwrap.py
this.py
threading.py gh-114271: Fix race in `Thread.join()` (#114839) 2024-03-16 13:56:30 +01:00
timeit.py gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
token.py
tokenize.py gh-115154: Fix untokenize handling of unicode named literals (#115171) 2024-02-19 14:54:10 +00:00
trace.py gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
traceback.py gh-99180: Make `StackSummary.should_show_carets` private (#119554) 2024-05-25 17:08:32 +00:00
tracemalloc.py
tty.py gh-114328: tty cbreak mode should not alter ICRNL (#114335) 2024-01-21 15:25:52 -08:00
turtle.py
types.py
typing.py gh-119180: PEP 649 compiler changes (#119361) 2024-06-11 13:06:49 +00:00
uuid.py gh-113308: Remove some internal parts of `uuid` module (#115934) 2024-03-14 13:01:41 +03:00
warnings.py gh-117535: Change unknown filename of warnings from `sys` to `<sys>` (#118018) 2024-04-18 20:50:09 -07:00
wave.py
weakref.py
webbrowser.py gh-118673: Remove shebang and executable bits from stdlib modules. (#119658) 2024-05-29 12:43:19 -04:00
zipapp.py
zipimport.py Remove references to private symbols from zipimport module docstring (GH-119015) 2024-05-15 11:21:52 -05:00