UnicodeEncodeError: 'latin-1' codec can't encode character u'\u03c7' in position 66: ordinal not in range(256) UnicodeEncodeError: 'latin-1' codec can't encode character u'\u03c7' in position 66: ordinal not in range(256) flask flask

UnicodeEncodeError: 'latin-1' codec can't encode character u'\u03c7' in position 66: ordinal not in range(256)


You appear to be trying to set a header that has a character not in the ISO-8859-1 character set. Currently, HTTP headers must only contain characters from that codec. More recent versions of Werkzeug require the Latin-1 codec instead to more closely follow the WSGI spec.

See this Flask issue for a message about this from the maintainer. It mentions that the correct way to use characters outside the range is described in RFC 5987, which may be implemented in the future.


Put a:

import pdb; pdb.set_trace()

in:File "/bin/user_wsgi_wrapper.py", line 130, in call

Restart the app and check vars values in your terminal.Press "n" for "next".Use "print var_name" to see a value for a variable.Read more here: https://docs.python.org/2/library/pdb.html