Merge lp:~brian.curtin/ubuntuone-dev-tools/py3-io into lp:ubuntuone-dev-tools
Proposed by
Brian Curtin
on 2012-08-20
| Status: | Merged |
|---|---|
| Approved by: | Brian Curtin on 2012-08-21 |
| Approved revision: | 83 |
| Merged at revision: | 87 |
| Proposed branch: | lp:~brian.curtin/ubuntuone-dev-tools/py3-io |
| Merge into: | lp:ubuntuone-dev-tools |
| Diff against target: |
32 lines (+4/-4) 1 file modified
ubuntuone/devtools/services/tests/test_squid.py (+4/-4) |
| To merge this branch: | bzr merge lp:~brian.curtin/ubuntuone-dev-tools/py3-io |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Alejandro J. Cura (community) | 2012-08-20 | Approve on 2012-08-21 | |
|
Review via email:
|
|||
Commit Message
- Import StringIO from the io module for Python 3 compatibility
Description of the Change
Python 3 no longer has a StringIO module, instead getting the StringIO class from the io module which was backported to Python 2 as well. We can have 2 and 3 friendly code by importing StringIO from io regardless of version, and by using unicode_literals as well.
To post a comment you must log in.
lp:~brian.curtin/ubuntuone-dev-tools/py3-io
updated
on 2012-08-21
- 83. By Brian Curtin on 2012-08-21
-
Use BytesIO and byte literals

The StringIO derived instance in this code is used as a fake Popen.PIPE.
But those pipes in python 3 still return bytes, so it should be BytesIO in that case.
Also, the literals used by the related testing functions should be changed to bytes literals in this branch.