With Python 3 there are definitely issues with the error traces.
Sometimes is difficult to find what is failing.
Greetings.
El 19/04/18 a las 13:50, Antonio Salazar escribió:
Is anyone running into this issue? It's happening both in Windows and
Linux.
Should I postpone migrating to python3?
On Wednesday, April 18, 2018 at 4:04:57 PM UTC-5, Antonio Salazar wrote:
The bug is very easy to reproduce:
* Clone the repository from GitHub
* Run python3 web2py.py
* Browse to http://127.0.0.1:8000/welcome/favicon.ico
<http://127.0.0.1:8000/welcome/favicon.ico>
It seems only *base/streamer.py* and *contrib/gateways/fcgi.py*
handle exceptions in this way.
On Wednesday, April 18, 2018 at 12:00:43 PM UTC-5, Antonio Salazar
wrote:
Now that web2py supports python 3, I just went on and migrated
my website. All works fine, except for a crash which I'm not
sure how to handle.
I get this when the browser looks for /favicon.ico (a
non-existent file because it's in /images/favicon.ico)
|
Traceback(most recent call last):
File"R:\Website Extranet\Fuentes\web2py\gluon\main.py",line
329,inwsgibase
response.stream(static_file,request=request)
File"R:\Website Extranet\Fuentes\web2py\gluon\globals.py",line
617,instream
status=self.status)
File"R:\Website
Extranet\Fuentes\web2py\gluon\streamer.py",line
66,instream_file_or_304_or_206
ife[0]==errno.EISDIR:
TypeError:'FileNotFoundError'objectisnotsubscriptable
|
The problem is the handling of exceptions in base/streamer.py
|
exceptIOErrorase:
ife[0]==errno.EISDIR:
raiseHTTP(403,error_message,web2py_error='file is a directory')
elife[0]==errno.EACCES:
raiseHTTP(403,error_message,web2py_error='inaccessible file')
else:
raiseHTTP(404,error_message,web2py_error='invalid file')
|
e[0] crashes because e is not indexable, it expects e.errno
instead.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.