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

Remove use of test.py in cdms2 ! #377

Open
jypeter opened this issue Dec 5, 2019 · 0 comments
Open

Remove use of test.py in cdms2 ! #377

jypeter opened this issue Dec 5, 2019 · 0 comments
Labels
py2 Python 2.x specific issue.

Comments

@jypeter
Copy link
Member

jypeter commented Dec 5, 2019

@jamesorr and I have found an interesting side effect in cdms2 yesterday

We could not import cdms2 because of a weird error, and we were lucky to find out that James had a buggy test.py file in the directory where we were executing his script. For some reason, cdms2 or something imports test.py, except that it was not getting it from the right place, or something like that

Example below

(cdatm_py2) jypeter@obelix4 - ...jypeter - 51 >cat test.py
#!/usr/bin/env python

print "You are in test.py"
stop_right_now


(cdatm_py2) jypeter@obelix4 - ...jypeter - 52 >python
Python 2.7.15 | packaged by conda-forge | (default, Feb 28 2019, 04:00:11)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/home/users/jypeter/CDAT/Progs/Devel', '/home/users/jypeter/CDAT/Progs', '/home/share/unix_files/cdat/climaf', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python27.zip', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/plat-linux2', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/lib-tk', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/lib-old', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/lib-dynload', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages/DV3D-8.1-py3.7.egg', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages/WK-8.1-py3.7.egg', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages/cdat_info-8.0-py3.7.egg', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages/cdutil-8.0-py3.7.egg', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages/thermo-8.1-py3.7.egg', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages/vcs-8.1-py3.7.egg', '/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages/vcsaddons-8.1-py2.7-linux-x86_64.egg']
>>> import cdms2
You are in test.py
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages/cdms2/__init__.py", line 25, in <module>
    from .axis import AbstractAxis, axisMatches, axisMatchAxis, axisMatchIndex  # noqa
  File "/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages/cdms2/axis.py", line 23, in <module>
    standard_library.install_aliases()
  File "/home/share/unix_files/cdat/miniconda3/envs/cdatm_py2/lib/python2.7/site-packages/future/standard_library/__init__.py", line 485, in install_aliases
    import test
  File "test.py", line 4, in <module>
    stop_right_now
NameError: name 'stop_right_now' is not defined
>>>
@jasonb5 jasonb5 added the py2 Python 2.x specific issue. label Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
py2 Python 2.x specific issue.
Projects
None yet
Development

No branches or pull requests

2 participants