-
Notifications
You must be signed in to change notification settings - Fork 367
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
config.py uses imp.load_source which is deprecated in Python 3 #214
Comments
That's unfortunate, it's always worked fine under 3.3 and 3.4 on POSIX platforms for me. The discussion thread linked implies the following could be the "correct" replacement for importing arbitrary files, and it works for me in a Python 3.4 shell: from importlib.machinery import SourceFileLoader
mymodule = SourceFileLoader('modname', '/path/to/file.py').load_module() So if that functions on your end I'd be +1 to a |
I'll give that a go - I must admit I was getting a bit befuddled at that point and couldn't quite follow what the suggested alternative was meant to be... |
Looks like |
OK, the big issue seems to be that if you try to use any of the load functions on Windows under Python 3.2, it breaks if the file doesn't exist. I'm trying to avoid the error by checking for file existence first. This is so messy, but I'm not sure we can do anything better as it's a Python bug. Unless you feel like dropping support for Python 3.2 ;-) |
Yay! Working on Appveyor and Travis |
PR #215 created for this |
Yaaay |
In Python 3,
imp.load_source
is undocumented (apparently it was deprecated and removed via http://bugs.python.org/issue14551 with some discussion of how it is "fundamentally broken" in https://mail.python.org/pipermail/python-ideas/2014-December/030265.html).On Windows under Python 3.3, the
invoke
tests fail somewhere in the compatibility implementation ofimp.load_source
.An alternative approach to loading config from Python files should be implemented for Python 3. Would something like the following work?
The text was updated successfully, but these errors were encountered: