Skip to content

Avoid a DeprecationWarning on Python 3.13+ - #1248

Merged
blink1073 merged 1 commit into
ipython:mainfrom
hroncok:python3.13
Jul 1, 2024
Merged

blink1073 merged 1 commit into
ipython:mainfrom
hroncok:python3.13

Conversation

@hroncok

@hroncok hroncok commented Jun 10, 2024

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

See also https://github.com/jupyter/jupyter_client/issues/1020

@blink1073 blink1073 left a comment

Copy link
Copy Markdown
Contributor

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
@blink1073

Copy link
Copy Markdown
Contributor

@meeseeksdev please backport to 6.x

@pllim

pllim commented Oct 10, 2024

Copy link
Copy Markdown

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 pllim mentioned this pull request Oct 10, 2024
9 tasks done
@pllim

pllim commented Nov 4, 2024

Copy link
Copy Markdown

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