Issue #1319 new

Autoreloader fails if six present and tkinter missing

Jason R. Coombs
created an issue

If six is imported, it creates a number of compatibility modules that are loaded on demand, including six.moves.tkinter. CherryPy's autoreload code triggers the demand to actually import those modules. On a system where tkinter isn't present, the autoreloader will crash when it tries to access that module.

The following is a partial traceback:

 File "/app/.heroku/venv/local/lib/python3.4/dist-packages/cherrypy/process/plugins.py", line 595, in sysfiles
  if hasattr(m, '__loader__') and hasattr(m.__loader__, 'archive'):
File "/app/.heroku/venv/local/lib/python3.4/dist-packages/six.py", line 116, in __getattr__
  _module = self._resolve()
File "/app/.heroku/venv/local/lib/python3.4/dist-packages/six.py", line 105, in _resolve
  return _import_module(self.mod)
File "/app/.heroku/venv/local/lib/python3.4/dist-packages/six.py", line 76, in _import_module
  __import__(name)
File "/usr/lib/python3.4/tkinter/__init__.py", line 43, in <module>
  raise ImportError(str(msg) + ', please install the python%s.%s-tk package' % sys.version_info[:2])
ImportError: No module named '_tkinter', please install the python3.4-tk package

Comments (1)

  1. Log in to comment