Skip to content

Commit 8119bb8

Browse files
committed
Avoid a DeprecationWarning on Python 3.13+
... /usr/lib/python3.13/site-packages/jupyter_client/jsonutil.py:31: in <module> datetime.strptime("1", "%d") # noqa /usr/lib64/python3.13/_strptime.py:573: in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) /usr/lib64/python3.13/_strptime.py:336: in _strptime format_regex = _TimeRE_cache.compile(format) /usr/lib64/python3.13/_strptime.py:282: in compile return re_compile(self.pattern(format), IGNORECASE) /usr/lib64/python3.13/_strptime.py:270: in pattern warnings.warn("""\ E DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious E and fails to parse leap day. The default behavior will change in Python 3.15 E to either always raise an exception or to use a different default year (TBD). E To avoid trouble, add a specific year to the input & format. E See python/cpython#70647. Fixes jupyter#1020
1 parent 8ca76ea commit 8119bb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jupyter_client/jsonutil.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
# holy crap, strptime is not threadsafe.
3030
# Calling it once at import seems to help.
31-
datetime.strptime("1", "%d") # noqa
31+
datetime.strptime("2000-01-01", "%Y-%m-%d") # noqa
3232

3333
# -----------------------------------------------------------------------------
3434
# Classes and functions

0 commit comments

Comments
 (0)