diff frontends/roundup.cgi @ 5418:55f09ca366c4

Python 3 preparation: StringIO. This generally arranges for StringIO and cStringIO references to use io.StringIO for Python 3 but io.BytesIO for Python 2, consistent with the string representations generally used in Roundup. A special FasterStringIO in the TAL code, which referenced internals of the old Python 2 StringIO module, is cut down so it doesn't actually do anything beyond the StringIO class it inherits from (it would also be reasonable to remove FasterStringIO completely). One place in roundup_server.py clearly needing binary I/O is made to use io.BytesIO unconditionally.
author Joseph Myers <jsm@polyomino.org.uk>
date Wed, 25 Jul 2018 09:08:29 +0000
parents c75defc1c2f0
children 86b6cea7a975
line wrap: on
line diff
--- a/frontends/roundup.cgi	Wed Jul 25 09:07:03 2018 +0000
+++ b/frontends/roundup.cgi	Wed Jul 25 09:08:29 2018 +0000
@@ -71,12 +71,13 @@
 # Set up the error handler
 # 
 try:
-    import traceback, StringIO, cgi
+    import traceback, cgi
+    from roundup.anypy.strings import StringIO
     from roundup.cgi import cgitb
 except:
     print("Content-Type: text/plain\n")
     print(_("Failed to import cgitb!\n\n"))
-    s = StringIO.StringIO()
+    s = StringIO()
     traceback.print_exc(None, s)
     print(s.getvalue())
 

Roundup Issue Tracker: http://roundup-tracker.org/