Open yofreke opened 8 years ago
Uh, there is no such file as Cookie.py
in beaker, there is a cookie.py
and imports are case sensitive (or at least case preserving). What's your file system? There shouldn't be any Cookie.py
file and it's working as expected for me and on travis
How odd... Looking at the lower case cookie file I am seeing: https://github.com/bbangert/beaker/blob/master/beaker/cookie.py#L2 which seems to be the circular import in question.
I am running on ubuntu. The filesystem is an nfs mount on ubuntu (case sensitive) hosted by an osx machine (case insensitive). Could be some issue there, I suppose.
The line import Cookie as http_cookies
is supposed to be importing the standard library cookie?
Yes, import Cookie
should import the Cookie
module from standard library, not the local cookie.py
.
As you are mounting the NFS from an HFS+ formatted as case insensitive the lookup for the file succeeds on cookie.py
and so the wrong module ends up being imported.
I think I can work that around using from __future__ import absolute_import
but it might still be happening somewhere else and I'm not really able to test it as all my systems are case sensitive.
I saw the same thing working in a vm which is nfs-mounting from a case-insensitive hfs+ host os. cookie.py
is the only place I saw it happen.
I saw this issue when working in a vagrant / virtualbox vm over an OSX host where the git workspace was mounted in the guest from the host fs.
I'm also encountering this issue with a similar setup to @stevelle. This basically means that beaker is no longer compatible with OSX machines or OSX filesystems, as far as I can tell.
@tedivm It's only incompatible when the file system is formatted in case insensitive mode. My primary development machine is an OSX system and beaker works fine there as the system is case sensitive.
https://github.com/bbangert/beaker/commit/3edfd85adce2c32bc7059d64a40a80ef809ec9e8 should fix this for case insensitive systems too, but I couldn't try it as I have no case insensitive system available and Travis currently doesn't support Python on OSX ( https://github.com/travis-ci/travis-ci/issues/4729 ). If anyone can try master
on a system where the error was replicable and confirm it's now fixed it would greatly help to speed up a release.
I use Flask-Beaker, which depends on beaker. Flask-Beaker does not specify a beaker version, and I recently ran in to issues with the beaker it installed. I am also running python v2.7.10.
This lead me to: https://github.com/bbangert/beaker/blob/master/beaker/_compat.py#L65
Which appears to be a circular import.
Temporary fix: add to requirements.txt:
run
pip install -r requirements.txt
again: