-
Notifications
You must be signed in to change notification settings - Fork 28
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
examples/flask_demo.mochi failed with AttributeError: 'NoneType' object has no attribute 'loader' #24
Comments
Yes, that may have broken something (was a WIP PR, forgot we don't have the same repo rules and didn't think it would get merged). My later PRs should fix whatever problems may have been introduced. |
Ok. New status: Likely closed with pending PR. ;) |
I run the examples/flask_demo.mochi after merging the PR to master branch, seemed to have no problem. Then I pushed it to remote repo. |
Looks like I have the problem and you guys don't ! Does that sounds familiar with "it works on my machine and not yours". This is exactly the problem Docker was created to address. I currently have this commit checked out: commit 1a36837ed6615cad4837eba21c96951e62dc042c
Merge: 9fcd0d1 9abd341
Author: i2y <[email protected]>
Date: Fri Apr 17 07:16:05 2015 +0900
Merge branch 'tlvu-docker-support' And I run the test this way (documented on the Docker hub page of the image): cd <the checkout root of your mochi>
docker run -i -t --rm -v `pwd`:/files:ro -v `pwd`/mochi:/venv/mochi/lib/python3.4/si
te-packages/mochi tlvu/mochi /files/examples/flask_demo.mochi And I still have the problem. Don't believe that it is running the exact code from that commit? Change something in the code purposely to make it break and see if it breaks where you expect it. The goal of the exercise is to show you guys that Docker really provide a reproducible runtime environment. If it fails on my machine and you use the same Docker image as me, I should also fail for you, no excuse. I think the Docker image is missing something but I have no clues right now. I think you guys are all running on Mac and I am the only one on Linux so it's hard to compare. |
@tlvu Thank you. You are right. |
I got the results of running the following on Ubuntu (without Docker). > uname -a
Linux ubuntu 3.13.0-34-generic #60-Ubuntu SMP Wed Aug 13 15:45:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
> python3 —version
Python 3.4.0
> pip3 install mochi
> pip3 install flask
> cat examples/flask_demo.py
from flask import Flask
app = Flask('demo')
@app.route('/')
def hello():
return 'Hello World!'
app.run()
> python3 examples/flask_demo.py
Traceback (most recent call last):
File "examples/flask_demo.py", line 3, in <module>
app = Flask('demo')
File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 319, in __init__
template_folder=template_folder)
File "/usr/local/lib/python3.4/dist-packages/flask/helpers.py", line 741, in __init__
self.root_path = get_root_path(self.import_name)
File "/usr/local/lib/python3.4/dist-packages/flask/helpers.py", line 631, in get_root_path
loader = pkgutil.get_loader(import_name)
File "/usr/lib/python3.4/pkgutil.py", line 467, in get_loader
return find_loader(fullname)
File "/usr/lib/python3.4/pkgutil.py", line 488, in find_loader
return spec.loader
AttributeError: 'NoneType' object has no attribute 'loader' |
I think that we have not the problem on Python 3.4.1+. |
I've actually tried now on Python 3.4.1, 3.4.2 and 3.4.3. |
Ah good to know that the Docker image is doing its job properly: reproducible runtime environment (that image has Python 3.4.0) When I have time I'll build a new Docker image with a newer Python so we have a working image for any newcomers to quickly try mochi out. |
That sounds good! |
Seems like a testing granularity based on minor versions is not enough. Having tests runs for different revisions that are in common use might be needed. Python 3.4.0 through 3.4.3 are the first candidates here. |
Traceback (most recent call last):
File "/root/venv/mochi/bin/mochi", line 9, in
load_entry_point('mochi==0.2.1', 'console_scripts', 'mochi')()
File "/root/venv/mochi/lib/python3.4/site-packages/mochi-0.2.1-py3.4.egg/mochi/core/main.py", line 192, in main
load_file(args.file, global_env)
File "/root/venv/mochi/lib/python3.4/site-packages/mochi-0.2.1-py3.4.egg/mochi/core/main.py", line 49, in load_file
return exec(compile_file(path), env)
File "flask_demo.mochi", line 3, in
app = Flask('demo')
File "/root/venv/mochi/lib/python3.4/site-packages/flask/app.py", line 319, in init
template_folder=template_folder)
File "/root/venv/mochi/lib/python3.4/site-packages/flask/helpers.py", line 741, in init
self.root_path = get_root_path(self.import_name)
File "/root/venv/mochi/lib/python3.4/site-packages/flask/helpers.py", line 631, in get_root_path
loader = pkgutil.get_loader(import_name)
File "/usr/lib/python3.4/pkgutil.py", line 467, in get_loader
return find_loader(fullname)
File "/usr/lib/python3.4/pkgutil.py", line 488, in find_loader
return spec.loader
AttributeError: 'NoneType' object has no attribute 'loader'
The text was updated successfully, but these errors were encountered: