Skip to content
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

Avoid a DeprecationWarning on Python 3.13+ #1027

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Jun 10, 2024

...
/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 https://github.com/python/cpython/issues/70647.

Fixes #1020

    ...
    /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
@minrk minrk added the bug label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
2 participants