defnull/bottle — pull request #241 by JaimieMurdock (2011-10-20 02:52:48+00:00)
Title: Python3 Cookie Encode/Decode Error

After running 2to3, bottle.py would fail to encode secure cookies, raising the following type error and issuing an HTTP 500:
```
TypeError: expected bytes, but got 'str'
```

To fix this, I simply encoded the key in both cookie_encode and cookie_decode. The bug has been marked as "wontfix" in the Python Standard Library, per issue 5285: http://bugs.python.org/issue5285

Also fixes the same issue in Python 2.6 and is backwards compatible with 2.5, as noted above.