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+ #1248

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Jun 10, 2024

...
/usr/lib/python3.13/site-packages/ipykernel/jsonutil.py:29: in <module>
    datetime.strptime("1", "%d")
/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.

See also jupyter/jupyter_client#1020

    ...
    /usr/lib/python3.13/site-packages/ipykernel/jsonutil.py:29: in <module>
        datetime.strptime("1", "%d")
    /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.

See also jupyter/jupyter_client#1020
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@blink1073 blink1073 merged commit b47db6f into ipython:main Jul 1, 2024
16 of 33 checks passed
@blink1073
Copy link
Contributor

@meeseeksdev please backport to 6.x

meeseeksmachine pushed a commit to meeseeksmachine/ipykernel that referenced this pull request Jul 1, 2024
blink1073 pushed a commit that referenced this pull request Jul 7, 2024
… 3.13+) (#1254)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@pllim
Copy link

pllim commented Oct 10, 2024

Hello. I see the DeprecationWarning still in ipykernel 6.29.5 (the latest stable release at the time I typed this). When will this patch (or its backport) be released now that Python 3.13 stable is out? Thanks!

@pllim
Copy link

pllim commented Nov 4, 2024

Looks like 6.29.5 on PyPI does not have this patch even though this PR was merged on the same day the release was made?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants