Skip to content
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

Have webob define a URLDecodeError (a subclass of UnicodeDecodeError): #115

Open
mcdonc opened this issue Aug 10, 2013 · 2 comments
Open

Comments

@mcdonc
Copy link
Member

mcdonc commented Aug 10, 2013

See issue #114.

@jinty
Copy link

jinty commented Aug 21, 2013

I have a branch which does something similar which I've been using in production a while:

https://github.com/jinty/webob/compare/convert_unicode_decode_error

However, it raises the error in more situations than just decoding the URL. For example when decoding a JSON body. It also calls the exception RequestDecodeError as opposed to URLDecodeError. Would it make sense to have URLDecodeError be a sub-class of RequestDecodeError?

seanh added a commit to hypothesis/h that referenced this issue Mar 27, 2018
Due to a bug in WebOb accessing request.path (or request.path_info
etc) will raise UnicodeDecodeError if the requested path doesn't
decode with UTF-8, and this will result in a 500 Server Error from
our app.

Add a tween to detect this situation and send a 400 Bad Request instead.

See Pylons/webob#115

Fixes #4915
@seanh
Copy link

seanh commented Mar 27, 2018

One possible workaround for this in Pyramid apps: hypothesis/h#4916

seanh added a commit to hypothesis/h that referenced this issue Mar 27, 2018
Due to a bug in WebOb accessing request.path (or request.path_info
etc) will raise UnicodeDecodeError if the requested path doesn't
decode with UTF-8, and this will result in a 500 Server Error from
our app.

Add a tween to detect this situation and send a 400 Bad Request instead.

See Pylons/webob#115

Fixes #4915
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants