These are chat archives for cherrypy/cherrypy

10th
Jan 2017
Jason R. Coombs
@jaraco
Jan 10 2017 01:00
@webknjaz I’ve force-pushed 80f384b0f05a5 over your recent commits to master which were failing tests in Travis. They’re still ancestral to your pull request, so I expect will now become part of that PR.
Sviatoslav Sydorenko
@webknjaz
Jan 10 2017 06:36
ARAIR they were not in PR
Sviatoslav Sydorenko
@webknjaz
Jan 10 2017 09:39
@jaraco I would've merged it to make test pass, but wasn't sure whether it's okay to remove that chdir. Would you plz share your opinion?
Jason R. Coombs
@jaraco
Jan 10 2017 14:29
@webknjaz Yes, I’m happy to review. I’ve taken a quick look, and I neither understand why that chdir is there nor why the presence of it is creating ImportErrors.
But I’d like to know and I’ll certainly help with it.
Sviatoslav Sydorenko
@webknjaz
Jan 10 2017 14:31
It looks like neither correct PYTHONPATH, nor PATH values set in runtime fix imports. But chdir to cherrypy’s folder fixes them.
I don’t understand it either. But it looks it’s due to an old way import looked up modules in the fs.
altering sys.path directly is not helping as well
it’s only reproducible in case of -m module invocation and works via cherryd
Jason R. Coombs
@jaraco
Jan 10 2017 14:34
That’s interesting. I know Python sets sys.path[0] based on how the entry was reached, so that’s probably relevant.
I don’t have time to work on this right now, but I’ll revisit later.
Sviatoslav Sydorenko
@webknjaz
Jan 10 2017 14:37
Okay
it may be related to the fact it’s an import of the _protected module. import cherrypy works. I’ve tested this using remote debugger
Sviatoslav Sydorenko
@webknjaz
Jan 10 2017 14:45
I have a theory that it tries to grab objects to import from __init__.py. Relative import from . import _cpwsgi_server also doesn’t work
Jason R. Coombs
@jaraco
Jan 10 2017 15:27
I’d be interested to see the values of cherrypy.__path__ and cherrpy.__file__ when those other imports fail. The _protected name should have no effect.