Re: [SQLObject] SQLite fails for binaries
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Joshua R. <jos...@mi...> - 2003-09-07 04:22:29
|
On Sat, 06 Sep 2003 22:55:31 -0400 "Ian Bicking" <ia...@co...> wrote: > You should add: > > def _set_content(self, value): > self._SO_set_content(base64.encodestring(value)) > def _get_content(self): > return base64.decodestring(self._SO_get_content()) > > I'm not sure where the problem is, but this will make the whole thing > less error-prone. Well having made that change and tested various things extensively I still have absolutely no clue what's going on, but now when I try to read the img data it tells me "Error: Incorrect padding"... It looks like, among other things, \n's are being turned into \\n's and not being converted back properly (this is from using short strings instead of full images; everything just seems to get garbled with big images).. And it still works properly under PostgreSQL. I have no idea if the problem is with my code, SQLObject's SQLite interface, PySQLite, or SQLite. Although since it *does* work in other database systems its probably one of the latter three. Hasn't anyone had this problem before? Joshua Rothenberg |