You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from __future__ import unicode_literals
...
response.headers['Cache-Control'] = 'max-age=0'
...
Results in:
Traceback (most recent call last):
File "bottle.py", line 1134, in wsgi
start_response(response._wsgi_status_line(), response.headerlist, exc_info)
File "/usr/lib/python2.7/wsgiref/handlers.py", line 179, in start_response
assert type(name) is StringType,"Header names must be strings"
AssertionError: Header names must be strings
This is similar to issue #923, including the fix, but applies to the header key, as opposed to the value.
The simple fix previously used for header value:
def _hval(value):
+ value = tonat(value)
...
could also be used for the header key:
def _hkey(key):
+ key = tonat(key)
...
The text was updated successfully, but these errors were encountered:
It's hard enough to have Python 2 and 3 compatibility from a single source file. Not sure if we really want to support a third option (Python 2 with __future__ imports). Most public Bottle APIs expect and return 'native' strings (bytes in Python2 and unicode in Python 3). All those APIs would have to be checked and fixed.
Example:
Results in:
This is similar to issue #923, including the fix, but applies to the header key, as opposed to the value.
The simple fix previously used for header value:
could also be used for the header key:
The text was updated successfully, but these errors were encountered: