You can register an exception view for URLDecodeError and react to it as necessary for your situation.
On May 20, 2014 5:43:23 AM EDT, Arndt Droullier <ar...@nive.co> wrote: >Hi, > >from time to time I run into URLDecodeError exceptions caused by >(useless) urls with unknown encoding. > >The exceptions can easily be handled in an exception view but in >general >shouldn't such decoding errors be handled as a HTTP 400 error by >default >and fail silently and not raise a pyramid (server side) exception? >Actually the client failed to send a valid request. > > >e.g. >http:// ... +++Result:+\xd5\xd2\xb2\xbb\xb5\xbdPost ... > >Traceback (most recent call last): > File "/var/opt/pyramid/local/lib/python2.7/site-packages/ >pyramid_exclog-0.7-py2.7.egg/pyramid_exclog/__init__.py", line 111, in >exclog_tween > return handler(request) > File "/var/opt/pyramid/local/lib/python2.7/site-packages/ >pyramid-1.4.2-py2.7.egg/pyramid/router.py", line 82, in handle_request > info = routes_mapper(request) > File "/var/opt/pyramid/local/lib/python2.7/site-packages/ >pyramid-1.4.2-py2.7.egg/pyramid/urldispatch.py", line 79, in __call__ > raise URLDecodeError(e.encoding, e.object, e.start, e.end, e.reason) >URLDecodeError: 'utf8' codec can't decode byte 0xc2 in position 75: >invalid >continuation byte > >Arndt. > >---------------------------------------------------------------------------------------------- >Arndt Droullier, Nive GmbH, Köln, Germany > >-- >You received this message because you are subscribed to the Google >Groups "pylons-discuss" group. >To unsubscribe from this group and stop receiving emails from it, send >an email to pylons-discuss+unsubscr...@googlegroups.com. >To post to this group, send email to pylons-discuss@googlegroups.com. >Visit this group at http://groups.google.com/group/pylons-discuss. >For more options, visit https://groups.google.com/d/optout. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscr...@googlegroups.com. To post to this group, send email to pylons-discuss@googlegroups.com. Visit this group at http://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/d/optout.