[issue13676] sqlite3: Zero byte truncates string contents

2012-02-01 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za 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':

[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org 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

[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: Removed file: http://bugs.python.org/file24122/sqlite3_zero_byte_v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13676 ___

[issue13676] sqlite3: Zero byte truncates string contents

2012-01-01 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org 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 Antoine Pitrou
Antoine Pitrou pit...@free.fr 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

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-31 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13676 ___ ___ Python-bugs-list mailing list

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-30 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org 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

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-29 Thread Petri Lehtinen
New submission from Petri Lehtinen pe...@digip.org: 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)')

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-29 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Where are the tests? :) -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13676 ___