Merge lp:~james-w/udd/unicode-everything into lp:udd
| Status: | Merged |
|---|---|
| Approved by: | Jonathan Lange on 2012-04-04 |
| Approved revision: | 571 |
| Merged at revision: | 569 |
| Proposed branch: | lp:~james-w/udd/unicode-everything |
| Merge into: | lp:udd |
| Diff against target: |
523 lines (+140/-93) 7 files modified
selftest.py (+1/-0) udd/icommon.py (+62/-59) udd/scripts/import_package.py (+33/-33) udd/scripts/requeue_package.py (+1/-0) udd/scripts/show_failure.py (+1/-1) udd/tests/test_history_database.py (+33/-0) udd/tests/test_status_database.py (+9/-0) |
| To merge this branch: | bzr merge lp:~james-w/udd/unicode-everything |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jonathan Lange (community) | 2012-04-04 | Approve on 2012-04-04 | |
|
Review via email:
|
|||
Commit Message
Use unicode everywhere to make storm happy.
Description of the Change
Hi,
Storm loves unicode. It really, really loves it. It loves it so much
that it won't let two strs be equal after round-tripping through the
database.
It's correct in a way, if a little annoying, so this branch changes
to use unicode rather than bytestrings where they may come in to
context with the database.
There are a lot of changes, but they are 99% boring.
There are three places that bytestrings might have come from:
1. Literals. I changed most literals to be unicode. Exceptions were things
related to urls, logging messages, and things that don't get anywhere
near the database.
2. Command line input. There are actually only a couple of places that
a string supplied on the command line may hit the db (e.g. the
package name passed to import-package). Coercing them to unicode was
easy, and package names can only be ascii anyway, so we don't really
have to worry about encodings there.
3. External systems. launchpadlib happily returns unicode everywhere, so
we are mostly safe from this, there were just a few extra spots to
handle.
There are likely some places I missed, but this gets the core functionality
working again.
Thanks,
James
- 572. By James Westby on 2012-04-04
-
One more string literal. Thanks jml.
| Robert Collins (lifeless) wrote : | # |
A better way to do this might be barry's __future__ incantation, which
IIRC will make string literals unicode by default.IMBW.
-Rob

Wow. Thanks. Makes it obvious how many duplicated string literals there are in the code base. As I mentioned on IRC, I think you missed converting one usage of 'release'
<jml> james_w: I think you missed one: NotBranchError: get_branch_ parts(" ubuntu" , ubuntu_ current_ series, get_branch_ parts(u" ubuntu" , ubuntu_ current_ series,
"release" , possible_ transports= possible_ transports)
except errors.
- ubuntu_b = bstore.
+ ubuntu_b = bstore.
"release" → u"release"
Please fix that and land.