The Python Oracle

Python 2.7, sqlite3, ValueError: could not convert BLOB to buffer

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Flying Over Ancient Lands

--

Chapters
00:00 Python 2.7, Sqlite3, Valueerror: Could Not Convert Blob To Buffer
00:56 Accepted Answer Score 2
01:19 Thank you

--

Full question
https://stackoverflow.com/questions/3983...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #sqlite

#avk47



ACCEPTED ANSWER

Score 2


Cristian Ciupitu's note about the bug is correct, but bytes(ar) will give you the __str__ representation instead of a serialized output. Therefore, use ar.tostring().

Use array.fromstring to unserialize the array again - you have to create an array object with the same type and then call .fromstring(...).