[issue13676] sqlite3: Zero byte truncates string contents

2012-02-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2e13011b3719 by Petri Lehtinen in branch '3.2': sqlite3: Handle strings with embedded zeros correctly http://hg.python.org/cpython/rev/2e13011b3719 New changeset 93ac4b12a750 by Petri Lehtinen in branch '2.7': sqlite3: Handle strings with embedded

[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Attached an updated patch. The custom text_factory case is now fixed, > and bytes, bytearray and custom factory are all tested. Thanks, looks good to me. > Antoine: Do you happen to know what's the status of the > OptimizeUnicode thingie? Has it been changed

[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Petri Lehtinen
Petri Lehtinen added the comment: (Whoops, I didn't mean to change the magic source coding comment. Updating the patch once again.) -- Added file: http://bugs.python.org/file24123/sqlite3_zero_byte_v3.patch ___ Python tracker

[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Petri Lehtinen
Changes by Petri Lehtinen : Removed file: http://bugs.python.org/file24122/sqlite3_zero_byte_v3.patch ___ Python tracker ___ ___ Python-bugs-l

[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Petri Lehtinen
Petri Lehtinen added the comment: Attached an updated patch. The custom text_factory case is now fixed, and bytes, bytearray and custom factory are all tested. I also added back the pysqlite_unicode_from_string() function, as this makes the patch a bit smaller. It also seems to me (only by lo

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-31 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: It would be nice to also have tests for the bytes and bytearray cases. It also seems the generic case hasn't been fixed ("""PyObject_CallFunction(self->connection->text_factory, "y", val_str)"""). -- ___ Python trac

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-30 Thread Petri Lehtinen
Petri Lehtinen added the comment: What? Don't you SEE that it works correctly? :) Attached an updated patch with a test case. FTR, I also tried to make it possible to have the SQL statement include a zero byte, but it seems that sqlite3_prepare() (and also the newer sqlite3_prepare_v2()) alw

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Where are the tests? :) -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-29 Thread Petri Lehtinen
New submission from Petri Lehtinen : Inserting a string with embedded zero byte only inserts the string up to the first zero byte: import sqlite3 connection = sqlite3.connect(':memory:') cursor = connection.cursor() cursor.execute('CREATE TABLE test (value TEXT)') cursor.execute('INSERT INTO