jupyter / nbclient

A client library for executing notebooks. Formally nbconvert's ExecutePreprocessor
https://nbclient.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
152 stars 55 forks source link

Importing nbclient in Python 3.13 raises a DeprecationWarning #318

Open Andy-Grigg opened 1 month ago

Andy-Grigg commented 1 month ago

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 https://github.com/jupyter/jupyter_client/pull/1027 for the equivalent issue and fix in jupyter_client.

Andy-Grigg commented 1 month ago

I believe this will be fixed by https://github.com/jupyter/nbclient/pull/315