Convert unicode tokens to 'str' #314

Merged
merged 1 commit into from Oct 11, 2011

2 participants

@jinty

This was resulting in unicode cookie values (and thus headers) on
Python 2 causing mod_wsgi to complain:
TypeError: expected string object for header value

PEP 3333 also says:
"Native" strings (which are always implemented using the type named
str) that are used for request/response headers and metadata

So mod_wsgi is right to complain about unicode headers and Pyramid is
wrong to send them.

@jinty jinty Convert unicode tokens to 'str'
This was resulting in unicode cookie values (and thus headers) on
Python 2 causing mod_wsgi to complain:
        TypeError: expected string object for header value

PEP 3333 also says:
  "Native" strings (which are always implemented using the type named
  str) that are used for request/response headers and metadata

So mod_wsgi is right to complain about unicode headers and Pyramid is
wrong to send them.
c3c0bea
@mcdonc mcdonc merged commit c3c0bea into Pylons:master Oct 11, 2011
@mcdonc
Pylons Project member

Thank you Brian...

@mcdonc mcdonc added a commit that referenced this pull request Nov 20, 2011
@mcdonc mcdonc - Backport from master: The AuthTktCookieHelper could potentially gen…
…erate

  Unicode headers inappropriately when the ``tokens`` argument to remember
  was used.  See #314.

References issue #314.
4791d7b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment