diff options
| author | Michael Merickel <michael@merickel.org> | 2013-10-05 03:59:07 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2013-10-05 03:59:07 -0500 |
| commit | 61e938dbbb75849f70e7d426b717bdf03d9f3ff4 (patch) | |
| tree | a492a2724c2705aef5ace2f88d1d5501583eaa37 | |
| parent | 4fade654a42b88ea1f042af974f76b97d326c455 (diff) | |
| download | pyramid-61e938dbbb75849f70e7d426b717bdf03d9f3ff4.tar.gz pyramid-61e938dbbb75849f70e7d426b717bdf03d9f3ff4.tar.bz2 pyramid-61e938dbbb75849f70e7d426b717bdf03d9f3ff4.zip | |
fix py3
| -rw-r--r-- | pyramid/session.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pyramid/session.py b/pyramid/session.py index e6635ca1b..3c493a561 100644 --- a/pyramid/session.py +++ b/pyramid/session.py @@ -522,9 +522,11 @@ def SignedCookieSessionFactory( ``serializer`` An object with 2 methods, ``loads`` and ``dumps``, which will be used - to perform serialization and deserialization. The value generated from - serialization will be cryptographically signed to prevent tampering. - A ``ValueError`` should be raised if deserialization fails. + to perform serialization and deserialization. + - ``dumps(value)`` should accept a Python object and return a + bytestring which can later be deserialized with ``loads``. + - ``loads(value)`` should expect to receive a bytestring, generated by + ``dumps`` and return a Python object. .. versionadded: 1.5a3 """ @@ -563,7 +565,7 @@ class _SignedSerializer(object): self.serializer = serializer def derive_key(self, salt): - return hmac.new(self.secret, salt, self.digestmod).digest() + return hmac.new(bytes_(self.secret), salt, self.digestmod).digest() def dumps(self, appstruct): salt = os.urandom(self.salt_size) |
