reloading broken in 0.21
Bug #118683 reported by
Aaron Swartz
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
web.py |
Fix Released
|
High
|
Anand Chitipothu |
Changed in webpy: | |
importance: | Undecided → High |
Changed in webpy: | |
status: | New → In Progress |
assignee: | nobody → anandology |
Changed in webpy: | |
status: | In Progress → Fix Committed |
Changed in webpy: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Hello, using webpy with the revision 181 where this bug is supossedly fixed I get this error:
======= ======= ======= ======= ======= ======= ======= === tapicer/ eclipse_ workspace/ py_test/ src/test/ main.py" , line 27, in <module> tapicer/ eclipse_ workspace/ py_test/ src/web/ request. py", line 154, in run webapi. wsgifunc( webpyfunc( inp, fvars, autoreload), *middleware)) tapicer/ eclipse_ workspace/ py_test/ src/web/ request. py", line 127, in webpyfunc _(modname( ), None, None, [""]) eclipse_ workspace/ py_test/ src/test/ main ======= ======= ======= ======= ======= ======= ===
Traceback (most recent call last):
File "/home/
if __name__ == "__main__": web.run(urls, globals(), web.reloader)
File "/home/
return wsgi.runwsgi(
File "/home/
mod = __import_
ImportError: No module named /home/tapicer/
=======
The code I use looks like this:
======= ======= ======= ======= ======= ======= ======= ===
import web
class hello:
def GET(self):
print 'Hello'
urls = (
'/', 'hello'
)
web.webapi. internalerror = web.debugerror ======= ======= ======= ======= ======= ======= ===
if __name__ == "__main__": web.run(urls, globals(), web.reloader)
=======
I've found that the reloader only fails with the main file, if I change the function webpyfunc on request.py to return the name of my main module in the inner function modname (instead of a way that tries to guess it but fails), I think it is because the function (modname) is returning the full path of the module instead of the name. I'm running it on linux and eclipse with pydev if it that helps.
I fixed it replacing this line of request.py:
name = os.path. splitext( file)[0] #(line 123)
with this:
name = os.path. splitext( file)[0] .split( os.path. sep)[-1]
Is this problem related with a bad usage of the reloader or is it really a bug?
Thanks.