We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ce0417 commit b4fb32dCopy full SHA for b4fb32d
jupyter_client/jsonutil.py
@@ -4,8 +4,9 @@
4
# Copyright (c) Jupyter Development Team.
5
# Distributed under the terms of the Modified BSD License.
6
7
-import re
8
from datetime import datetime
+import re
9
+import warnings
10
11
from dateutil.parser import parse as _dateutil_parse
12
from dateutil.tz import tzlocal
@@ -37,6 +38,9 @@ def _ensure_tzinfo(dt):
37
38
"""
39
if not dt.tzinfo:
40
# No more naïve datetime objects!
41
+ warnings.warn(u"Interpreting naïve datetime as local %s. Please add timezone info to timestamps." % dt,
42
+ DeprecationWarning,
43
+ stacklevel=4)
44
dt = dt.replace(tzinfo=tzlocal())
45
return dt
46
0 commit comments