On Jan 16, 7:08 am, "Martin v. Löwis" <[email protected]> wrote:
> > s = urandom(10).encode('hex')
>
> > AttributeError: 'bytes' object has no attribute 'encode'
>
> py> binascii.hexlify(os.urandom(10))
> b'92b91d5734a9fe562f23'
>
sqlite3
s = hexlify(urandom(10))
db.execute('SELECT sid FROM sessions WHERE sid=?',(s))
('SELECT sid FROM sessions WHERE sid=?', b'c916f03d441a0b2b5a9d')
[error] Incorrect number of bindings supplied. The current statement
uses 1, and there are 20 supplied.
???
--
http://mail.python.org/mailman/listinfo/python-list