Import StringIO in a Python 2 and 3 friendly way
Bug #1018599 reported by
Brian Curtin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Ubuntu Single Sign On Client | Status tracked in Trunk | |||||
Stable-4-0 |
Fix Released
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
Undecided
|
Brian Curtin | |||
ubuntu-sso-client (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | |||
Quantal |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Python 3 moved the StringIO class from the StringIO module to the io module, so we simply need to try importing from the io module first and fall back to StringIO.
Related branches
lp:~brian.curtin/ubuntu-sso-client/py3-StringIO
- dobey (community): Approve
- Alejandro J. Cura (community): Approve
-
Diff: 54 lines (+6/-5)3 files modifiedubuntu_sso/qt/setup_account_page.py (+2/-2)
ubuntu_sso/utils/tests/test_parse_args.py (+3/-2)
ubuntu_sso/utils/webclient/qtnetwork.py (+1/-1)
To post a comment you must log in.
This bug was fixed in the package ubuntu-sso-client - 3.99.2-0ubuntu1
---------------
ubuntu-sso-client (3.99.2-0ubuntu1) quantal; urgency=low
* New upstream release. ubuntu- sso-client- gtk.install:
- Avoid using /usr/bin/env python in scripts. (LP: #984089)
- Avoid using xrange, which is not in Python 3. (LP: #1016774)
- Handle winreg vs. _winreg for Python 2 and 3. (LP: #1016957)
- Remove the GTK+ UI. (LP: #1017690)
- Handle urllib differences between Python 2 and 3. (LP: #1018587)
- Use io.StringIO everywhere, for Python 2 and 3. (LP: #1018599)
- Use new print syntax for Python 3. (LP: #1018611)
* debian/control:
- Remove the -gtk UI package, and update the deps.
* debian/
- Removed.
-- Rodney Dawes <email address hidden> Fri, 20 Jul 2012 12:49:23 -0400