Re: Fun with 'str' and 'bytes'

2011-03-06 Thread Nicholas Devenish
On 04/03/2011 16:40, nn wrote: As far as I know, that is pretty much it. Also see: http://bugs.python.org/issue3982 That is a depressing bug report, and really comes across as people who don't use networking commenting on the requirements of people who write networking code. It's good to

Re: Fun with 'str' and 'bytes'

2011-03-06 Thread Terry Reedy
On 3/6/2011 4:55 PM, Nicholas Devenish wrote: On 04/03/2011 16:40, nn wrote: As far as I know, that is pretty much it. Also see: http://bugs.python.org/issue3982 That is a depressing bug report, and really comes across as people who don't use networking commenting on the requirements of

Re: Fun with 'str' and 'bytes'

2011-03-05 Thread Frank Millman
On Mar 4, 6:40 pm, nn prueba...@latinmail.com wrote: On Mar 4, 7:32 am, Frank Millman fr...@chagford.com wrote: Hi all I want to create a cookie containing a session id. In python 2.6 I had the following - from __future__ import unicode_literals session_id = b64encode(urandom(20))

Fun with 'str' and 'bytes'

2011-03-04 Thread Frank Millman
Hi all I want to create a cookie containing a session id. In python 2.6 I had the following - from __future__ import unicode_literals session_id = b64encode(urandom(20)) response_headers.append( (b'Set-Cookie', b'sid={0}'.format(session_id))) After upgrading to 3.2, the above lines

Re: Fun with 'str' and 'bytes'

2011-03-04 Thread nn
On Mar 4, 7:32 am, Frank Millman fr...@chagford.com wrote: Hi all I want to create a cookie containing a session id. In python 2.6 I had the following - from __future__ import unicode_literals session_id = b64encode(urandom(20)) response_headers.append(     (b'Set-Cookie',