Hi Anto, On Sun, Aug 14, 2011 at 10:50 AM, Antonio Cuni <anto.c...@gmail.com> wrote: > why is this needed? Does the sqlite API requires that the SQL buffer stays > alive even after the call to sqlite3_prepare?
Yes, because the output argument 'next_value' receives a pointer to the middle of the same buffer that was passed in as 'sql'. So passing 'sql' as a Python string doesn't work: it gets converted to a C string when passed to the function, and discarded after the call. It works anyway on CPython because the C string pointer is actually inside the PyStringObject, which happens to stay alive. A bientôt, Armin. _______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev