On Wed, 2003-08-20 at 22:27, Javier Ruere wrote:
> > On Wednesday, August 13, 2003, at 08:56 PM, Javier Ruere wrote:
> >
> >> When storing strings, the characters in them are escaped but they are
> >> not unescaped when retrieving the string from the database. Is this a
> >> bug or the intended behaviour?
> >>
> > That's odd... that shouldn't be the behavior, but it's the
> > responsibility of the database driver (psycopg, MySQLdb, etc) to do
> > anything related to converting data that comes from the database.
> >
> > Ian
>
> Ian,
> Welcome back!
> But IIRC SQLObject converts the scaped characters
> (for ex. '\n' -> '\\n') so shouldn't it convert the characters back?
> I got the problem while trying to store th result from a pickle.
No, SQLObject creates SQL queries, and to include \n in a string in a
SQL query, of course you have to quote it. When SQLObject fetches data
from the database, it does not receive SQL literals, but rather receives
raw data, so no unquoting is necessary.
It is possible that SQLObject is not quoting some characters properly
(maybe the low control characters), and that could cause a problem.
Ian
|