forked from orbit-oss/flask
Make DebugFilesKeyError.__str__ return str on 3.x
This commit is contained in:
parent
3f80b0fd6c
commit
4bea6bbe6d
1 changed files with 3 additions and 1 deletions
|
|
@ -8,6 +8,7 @@
|
|||
:copyright: (c) 2011 by Armin Ronacher.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
from flask._compat import implements_to_string
|
||||
|
||||
|
||||
class UnexpectedUnicodeError(AssertionError, UnicodeError):
|
||||
|
|
@ -16,6 +17,7 @@ class UnexpectedUnicodeError(AssertionError, UnicodeError):
|
|||
"""
|
||||
|
||||
|
||||
@implements_to_string
|
||||
class DebugFilesKeyError(KeyError, AssertionError):
|
||||
"""Raised from request.files during debugging. The idea is that it can
|
||||
provide a better error message than just a generic KeyError/BadRequest.
|
||||
|
|
@ -33,7 +35,7 @@ class DebugFilesKeyError(KeyError, AssertionError):
|
|||
buf.append('\n\nThe browser instead transmitted some file names. '
|
||||
'This was submitted: %s' % ', '.join('"%s"' % x
|
||||
for x in form_matches))
|
||||
self.msg = ''.join(buf).encode('utf-8')
|
||||
self.msg = ''.join(buf)
|
||||
|
||||
def __str__(self):
|
||||
return self.msg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue