Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning in json/encoder.py #253

Closed
durack1 opened this issue Apr 14, 2017 · 5 comments
Closed

DeprecationWarning in json/encoder.py #253

durack1 opened this issue Apr 14, 2017 · 5 comments

Comments

@durack1
Copy link

durack1 commented Apr 14, 2017

While using spyder 3.1.3 (jupyter_client: 5.0.1-py27_0; jupyter_core: 4.3.0-py27_0; ipython-5.3.0-py27_0; ipython_genutils-0.2.0-py27_0) I'm getting a DeprecationWarning when importing the vcs package:

In [2]: import warnings
   ...: warnings.filterwarnings('ignore', category=DeprecationWarning)
In [3]: import vcs
/home/user/anaconda2/envs/cdatcmornclnco/lib/python2.7/json/encoder.py:207: DeprecationWarning: Interpreting naive datetime as local 2017-04-12 19:45:31.251897. Please add timezone info to timestamps.
  chunks = self.iterencode(o, _one_shot=True)

Has anyone seen this issue before, and can suggest a way to solve this? It's making using iPython/jupyter effectively, incredibly challenging..

@doutriaux1
jupyter/help#157
spyder-ide/spyder#4196
CDAT/vcs#170
wireservice/agate#672
http://bugs.python.org/issue30063

@doutriaux1
Copy link

@durack1 I think this gave me the answer. We have the following line in vcs:
https://github.com/UV-CDAT/vcs/blob/master/vcs/Canvas.py#L65
If I comment it out warnings disappear, please try it on your side as well. In the mean time i will investigate as of why we put this in.

@doutriaux1
Copy link

@aashish24 a quick git blame shows you introduced this a while back (see CDAT/vcs@5f8524f). It worked after this i still think the warnings are triggered by our new doc strings (@embrown do you know what we did that could cause this). @aashish24 can you remember why this was in, will it break anything if I comment it out?

@doutriaux1
Copy link

@durack1 try to play with:

warnings.filterwarnings("default", "", DeprecationWarning, "", 0)

to fix your issue

@durack1
Copy link
Author

durack1 commented Apr 14, 2017

It seems my usability issue was solved by commenting out a warnings call vcs/Canvas.py#L65

63
64 # Python < 3 DeprecationWarning ignored by default
65 #warnings.simplefilter('default')
66

This leads to an iPython/jupyter session now looking like:

Python 2.7.13 | packaged by conda-forge | (default, Mar 20 2017, 14:04:17)
Type "copyright", "credits" or "license" for more information.
IPython 5.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
import vcs
In [2]:

Not sure this will solve the other issues highlighted above (jupyter/help#157, spyder-ide/spyder#4196, CDAT/vcs#170, wireservice/agate#672), but it's got me back to working

If no one else on the jupyter team has anything to add or enlighten with this issue feel free to close

@ivanov
Copy link
Member

ivanov commented Nov 19, 2023

Hey there, I'm going through old issues and it seems to me that it makes sense to close this one.

Thanks everyone and happy hacking! :bowtie:

@ivanov ivanov closed this as completed Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants