lp:~cjwatson/storm/py3-strings

Created by Colin Watson and last modified
Get this branch:
bzr branch lp:~cjwatson/storm/py3-strings
Only Colin Watson can upload to this branch. If you are Colin Watson please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Colin Watson
Project:
Storm
Status:
Merged

Recent revisions

514. By Colin Watson

Simplify type-checking conditions in Compile.__call__.

513. By Colin Watson

Update string handling for Python 3.

This is inspired by work done by Thiago Bellini. I've taken a different
approach in a few areas which are useful to discuss briefly here (and some
of this should end up in release notes):

 * I generally wrote "bytes" rather than "six.binary_type", since it's
   shorter and works in all supported versions of Python.

 * In the SQLite backend, there's no need to use memoryview, because the
   sqlite3 module in Python 3 automatically converts between the SQLite BLOB
   type and bytes.

 * Some exception messages have changed slightly for clarity.

 * On Python 3, raw=True and token=True in storm.expr.Compile.__call__ only
   treats str specially, not bytes and str, because ultimately the compiler
   is assembling a text string to send to the database.

 * On Python 3, storm.tracer.BaseStatementTracer.connection_raw_execute
   renders text parameters using ascii() rather than by encoding to bytes
   and then calling repr(). While this does result in slightly different
   output from Python 2, it's normally more useful since the encoding is in
   terms of Unicode codepoints rather than UTF-8.

 * storm.sqlobject.AutoUnicodeVariable (and hence StringCol) explicitly
   documents that it only accepts text on Python 3, since native strings are
   already Unicode there so there's much less need for the porting
   affordance.

512. By Colin Watson

Remove special case for unicode query parameters to PostgreSQL.

These have been supported natively by psycopg2 since 1.99.3 or thereabouts,
so we don't need to handle them ourselves any more.

511. By Colin Watson

Be more explicit about string types in tests.

The distinction between '...' and b'...' matters in Python 3, so be explicit
where it matters in tests, in preparation for corresponding changes to Storm
itself.

510. By Thiago Bellini

Use Python 3-compatible raise syntax. [r=simpoir]

509. By Colin Watson

Wrap DB-API exceptions rather than injecting virtual base classes. [r=simpoir]

508. By Colin Watson

Rename double-underscore identifiers in C extensions. [r=simpoir]

507. By Colin Watson

Import from six.moves where appropriate. [r=simpoir]

506. By Thiago Bellini

Use Python 3-compatible exec functions. [r=cjwatson]

505. By Martin v. Löwis

Make cextensions module build with 3.x. [r=cjwatson]

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:storm
This branch contains Public information 
Everyone can see this information.

Subscribers