nbclient icon indicating copy to clipboard operation
nbclient copied to clipboard

Importing nbclient in Python 3.13 raises a DeprecationWarning

Open Andy-Grigg opened this issue 1 year ago • 1 comments

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 avatar Oct 10 '24 18:10 Andy-Grigg

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

Andy-Grigg avatar Oct 10 '24 19:10 Andy-Grigg