You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 16, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 16, 2021. It is now read-only.
======================================================================
ERROR: Failure: RuntimeError ('list' must be None or a list, not <class 'str'>)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/travis/build/MacPython/matplotlib-wheels/venv/lib/python3.5/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/Users/travis/build/MacPython/matplotlib-wheels/venv/lib/python3.5/site-packages/nose/loader.py", line 285, in generate
for test in g():
File "/Users/travis/build/MacPython/matplotlib-wheels/venv/lib/python3.5/site-packages/matplotlib/testing/decorators.py", line 216, in test
baseline_dir, result_dir = _image_directories(self._func)
File "/Users/travis/build/MacPython/matplotlib-wheels/venv/lib/python3.5/site-packages/matplotlib/testing/decorators.py", line 399, in _image_directories
mod_file = find_dotted_module(func.__module__)[1]
File "/Users/travis/build/MacPython/matplotlib-wheels/venv/lib/python3.5/site-packages/matplotlib/testing/decorators.py", line 389, in find_dotted_module
res = file, path, _ = imp.find_module(sub_mod, path)
File "/Users/travis/build/MacPython/matplotlib-wheels/venv/lib/python3.5/imp.py", line 270, in find_module
"not {}".format(type(name)))
RuntimeError: 'list' must be None or a list, not <class 'str'>
I couldn't reproduce the error on my local desktop, running OSX 10.11.
Thoughts:
travis recently replaced its OSX default runtime; need to replicate OSX / xcode version for last successful build, to see if it could be an infrastructure change;
investigate dependencies. TC mentioned namespace packages - @tacaswell - was that from some further investigation you did?
Moving the debug print statement finds the problem:
Trying import mpl_toolkits path None
Trying import tests path _NamespacePath(['/Users/travis/build/MacPython/matplotlib-wheels/venv/lib/python3.5/site-packages/mpl_toolkits'])
Failure: RuntimeError ('list' must be None or a list, not <class 'str'>) ... ERROR
I guess what is happening is that import mpl_toolkits is generating an ImportError, triggering the except ImportError clause in find_dotted:
def find_dotted_module(module_name, path=None):
"""A version of imp which can handle dots in the module name.
As for imp.find_module(), the return value is a 3-element
tuple (file, pathname, description)."""
res = None
for sub_mod in module_name.split('.'):
try:
print('Trying import', sub_mod, 'path', path)
res = file, path, _ = imp.find_module(sub_mod, path)
path = [path]
if file is not None:
file.close()
except ImportError:
# assume namespace package
path = sys.modules[sub_mod].__path__
res = None, path, None
return res
This sets path to be a _NamespacePath object, which causes an error in the next iteration of the loop, because path must be a list or None.
@tacaswell - I don't understand the namespace stuff - any insight here? I can't explain the difference between the travis-ci machine and my local machine - I guess it could be something to do with setuptools - or anything else. Can you suggest anything to try to debug further?
The explicit test on isinstance(path, (type(None), list)) was added in 2012 when find_module was re-implemented (python/cpython@b1772e6).
The source of the _NamespacePath comes from python/cpython@8c71522 and was last touched in may of last year which makes me think that this may be due to a micro-version change in python.
Activity
matthew-brett commentedon Dec 29, 2016
Attempt to replicate previous successful build also fails : https://travis-ci.org/MacPython/matplotlib-wheels/builds/187466773 - with same errors as more recent builds.
Worker is : instance: 764e7791-10cc-4cea-a514-44971a427b99:travis-ci-osx10.9-xcode6.1-1472151920
This compared to successful build : instance: 195a0977-591b-4bc7-93a0-c1a164f57944:travis-osx10.9-sauce-xcode61-20150528
So - not exactly the same worker. At least this excludes changes in matplotlib code.
matthew-brett commentedon Dec 29, 2016
Can't replicate failure with latest Python 3.5 on OSX 10.11 on desktop. Pip freeze output:
matthew-brett commentedon Dec 29, 2016
Trying to replicate the dependencies in the failed travis run doesn't replicate the error:
matthew-brett commentedon Dec 29, 2016
Errors occurring for:
although though these pass in the midst of all the errors:
https://api.travis-ci.org/jobs/187483606/log.txt?deansi=true
matthew-brett commentedon Dec 29, 2016
Moving the debug print statement finds the problem:
https://api.travis-ci.org/jobs/187501264/log.txt?deansi=true
I guess what is happening is that
import mpl_toolkitsis generating anImportError, triggering theexcept ImportErrorclause infind_dotted:This sets
pathto be a_NamespacePathobject, which causes an error in the next iteration of the loop, becausepathmust be a list or None.@tacaswell - I don't understand the namespace stuff - any insight here? I can't explain the difference between the travis-ci machine and my local machine - I guess it could be something to do with setuptools - or anything else. Can you suggest anything to try to debug further?
tacaswell commentedon Dec 29, 2016
I also do not understand the namespace stuff. I think this is a bug in what ever is setting
__path__. Tracking through the python docs:__path__must be an iterable of strings and that it must follow theThe explicit test on
isinstance(path, (type(None), list))was added in 2012 when find_module was re-implemented (python/cpython@b1772e6).The source of the
_NamespacePathcomes from python/cpython@8c71522 and was last touched in may of last year which makes me think that this may be due to a micro-version change in python.Relevant upstream bugs look like https://bugs.python.org/issue24192 and https://bugs.python.org/issue23911
BF: Convert namespace path to list
matthew-brett commentedon Dec 29, 2016
How confusing - I am using the latest latest Python.org Python on my desktop.
Anyway - this seems to fix it - is it the right patch?
matplotlib/matplotlib#7703
Run showing more ordinary test failures with this patch applied:
https://travis-ci.org/MacPython/matplotlib-wheels/builds/187519568
matthew-brett commentedon Dec 29, 2016
Well - that was an ugly few hours of debugging ... at least a good rest from the code of conduct discussion.
tacaswell commentedon Dec 29, 2016
This should probably get escalated to core python? Not sure I understand it well enough to make a sensible bug report....
matthew-brett commentedon Dec 29, 2016
Oh dear - I don't understand it either. Anyone on the team better informed on namespaces that can advise me?