lp:~cjwatson/storm/py3-strings
- Get this branch:
- bzr branch lp:~cjwatson/storm/py3-strings
Branch merges
- Simon Poirier (community): Approve
-
Diff: 848 lines (+140/-103)20 files modifiedstorm/cextensions.c (+9/-7)
storm/database.py (+3/-1)
storm/databases/postgres.py (+2/-5)
storm/databases/sqlite.py (+13/-9)
storm/expr.py (+26/-24)
storm/info.py (+2/-2)
storm/properties.py (+1/-0)
storm/references.py (+1/-1)
storm/sqlobject.py (+15/-7)
storm/tests/databases/base.py (+2/-1)
storm/tests/databases/postgres.py (+6/-2)
storm/tests/expr.py (+2/-2)
storm/tests/mocker.py (+1/-1)
storm/tests/sqlobject.py (+2/-2)
storm/tests/store/base.py (+4/-4)
storm/tests/tracer.py (+2/-1)
storm/tests/variables.py (+15/-11)
storm/tracer.py (+7/-2)
storm/tz.py (+2/-2)
storm/variables.py (+25/-19)
Branch information
Recent revisions
- 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.
BaseStatementTr acer.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
.AutoUnicodeVar iable (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.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:storm