Merge lp:~gz/testtools/bytes_to_join_bytes_675331 into lp:~testtools-committers/testtools/trunk
Proposed by
Martin Packman
Status: | Merged |
---|---|
Merged at revision: | 131 |
Proposed branch: | lp:~gz/testtools/bytes_to_join_bytes_675331 |
Merge into: | lp:~testtools-committers/testtools/trunk |
Diff against target: |
73 lines (+18/-8) 2 files modified
testtools/content.py (+5/-2) testtools/tests/test_content.py (+13/-6) |
To merge this branch: | bzr merge lp:~gz/testtools/bytes_to_join_bytes_675331 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
testtools developers | Pending | ||
Review via email: mp+40922@code.launchpad.net |
Description of the change
Make some ugly code uglier so it has the right semantics on Python 3. As well as the problem raised in the bug, the __repr__ method had a similar issue.
Noting the obvious:
* Content objects want (but don't really validate that they get) byte strings, which means str for Python 2 and bytes for Python 3.
* A __repr__ method must return the native str type, which is a byte string on Python 2 and a unicode string on Python 3.
To post a comment you must log in.
Just merged this. Thanks heaps!