Hello, using webpy with the revision 181 where this bug is supossedly fixed I get this error:
====================================================
Traceback (most recent call last):
File "/home/tapicer/eclipse_workspace/py_test/src/test/main.py", line 27, in <module>
if __name__ == "__main__": web.run(urls, globals(), web.reloader)
File "/home/tapicer/eclipse_workspace/py_test/src/web/request.py", line 154, in run
return wsgi.runwsgi(webapi.wsgifunc(webpyfunc(inp, fvars, autoreload), *middleware))
File "/home/tapicer/eclipse_workspace/py_test/src/web/request.py", line 127, in webpyfunc
mod = __import__(modname(), None, None, [""])
ImportError: No module named /home/tapicer/eclipse_workspace/py_test/src/test/main
====================================================
The code I use looks like this:
====================================================
import web
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?
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.