On Jan 17, 1:14 am, gert <gert.cuyk...@gmail.com> wrote: > On Jan 16, 7:08 am, "Martin v. Löwis" <mar...@v.loewis.de> 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. > > ???
db.execute('SELECT sid FROM sessions WHERE sid=?',(s,)) This works ? Is this the new way to create a list in Python3.0 ? s=('test',) -- http://mail.python.org/mailman/listinfo/python-list