Skip to content

Importing nbclient in Python 3.13 raises a DeprecationWarning #318

@Andy-Grigg

Description

@Andy-Grigg

Simple reproduction: Run python -X dev -c "import nbclient" and see the following printed:

C:\venv\Lib\site-packages\nbclient\jsonutil.py:29: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
and fails to parse leap day. The default behavior will change in Python 3.15
to either always raise an exception or to use a different default year (TBD).
To avoid trouble, add a specific year to the input & format.
See https://github.com/python/cpython/issues/70647.
  datetime.strptime("1", "%d")

Looking at the code, the actual date being parsed in the line datetime.strptime("1", "%d") doesn't seem to matter, so the fix is probably as simple as replacing "1" with a real date.

See jupyter/jupyter_client#1027 for the equivalent issue and fix in jupyter_client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions