diff options
| author | Chris McDonough <chrism@plope.com> | 2011-09-28 04:55:24 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-09-28 04:55:24 -0400 |
| commit | 9f2d38c1cf8b88658c3600afab195cb3686300b8 (patch) | |
| tree | a04d9fa22d2f221d9129ac551c8d547de5d9b9e7 | |
| parent | 311a894e32936a1087cb44543183da67d8c7fdec (diff) | |
| download | pyramid-9f2d38c1cf8b88658c3600afab195cb3686300b8.tar.gz pyramid-9f2d38c1cf8b88658c3600afab195cb3686300b8.tar.bz2 pyramid-9f2d38c1cf8b88658c3600afab195cb3686300b8.zip | |
fix for py32, avoid setup.py conflict
| -rw-r--r-- | pyramid/authentication.py | 3 | ||||
| -rw-r--r-- | pyramid/tests/test_authentication.py | 2 | ||||
| -rw-r--r-- | setup.py | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/pyramid/authentication.py b/pyramid/authentication.py index ed422b044..245a9692f 100644 --- a/pyramid/authentication.py +++ b/pyramid/authentication.py @@ -14,6 +14,7 @@ from pyramid.compat import binary_type from pyramid.compat import url_unquote from pyramid.compat import url_quote from pyramid.compat import bytes_ +from pyramid.compat import ascii_native_ from pyramid.interfaces import IAuthenticationPolicy from pyramid.interfaces import IDebugLogger @@ -729,7 +730,7 @@ class AuthTktCookieHelper(object): for token in tokens: if isinstance(token, text_type): try: - token = token.encode('ascii') + token = ascii_native_(token) except UnicodeEncodeError: raise ValueError("Invalid token %r" % (token,)) if not (isinstance(token, str) and VALID_TOKEN.match(token)): diff --git a/pyramid/tests/test_authentication.py b/pyramid/tests/test_authentication.py index 6b8393fc2..6bf14e76c 100644 --- a/pyramid/tests/test_authentication.py +++ b/pyramid/tests/test_authentication.py @@ -616,7 +616,7 @@ class TestAuthTktCookieHelper(unittest.TestCase): now = time.time() helper.auth_tkt.timestamp = now helper.now = now + 1 - helper.auth_tkt.tokens = (u'a', ) + helper.auth_tkt.tokens = (text_('a'), ) request = self._makeRequest('bogus') result = helper.identify(request) self.assertTrue(result) @@ -62,7 +62,7 @@ if not PY3: ]) setup(name='pyramid', - version='1.2', + version='1.3dev', description=('The Pyramid web application development framework, a ' 'Pylons project'), long_description=README + '\n\n' + CHANGES, |
