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

Errors on Python 3.7 it autoreloader when namespace packages are present #1697

Closed
jaraco opened this Issue Mar 8, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@jaraco
Member

jaraco commented Mar 8, 2018

Running CherryPy on Python 3.7, I see these errors:

[07/Mar/2018:20:38:54] ENGINE Error in background task thread function <bound method Autoreloader.run of <cherrypy.process.plugins.Autoreloader object at 0x10bd37710>>.
Traceback (most recent call last):
  File "/Users/jaraco/Dropbox/code/main/jaraco.site/.tox/python/lib/python3.7/site-packages/cherrypy/process/plugins.py", line 636, in sysfiles
    f = m.__loader__.archive
AttributeError: '_NamespaceLoader' object has no attribute 'archive'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jaraco/Dropbox/code/main/jaraco.site/.tox/python/lib/python3.7/site-packages/cherrypy/process/plugins.py", line 518, in run
    self.function(*self.args, **self.kwargs)
  File "/Users/jaraco/Dropbox/code/main/jaraco.site/.tox/python/lib/python3.7/site-packages/cherrypy/process/plugins.py", line 653, in run
    for filename in self.sysfiles() | self.files:
  File "/Users/jaraco/Dropbox/code/main/jaraco.site/.tox/python/lib/python3.7/site-packages/cherrypy/process/plugins.py", line 640, in sysfiles
    if not os.path.isabs(f):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/posixpath.py", line 66, in isabs
    s = os.fspath(s)
TypeError: expected str, bytes or os.PathLike object, not NoneType

This issue is likely related to the change that namespace packages now have a __file__ of None.

@jaraco jaraco changed the title from Errors on Python 3.7 to Errors on Python 3.7 it autoreloader when namespace packages are present Mar 8, 2018

@webknjaz

This comment has been minimized.

Member

webknjaz commented Mar 12, 2018

I guess, we could catch TypeError as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment