diff scripts/roundup-reminder @ 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 3fa026621f69
children e124d76311e0
line wrap: on
line diff
--- a/scripts/roundup-reminder	Wed Jul 25 09:07:03 2018 +0000
+++ b/scripts/roundup-reminder	Wed Jul 25 09:08:29 2018 +0000
@@ -28,9 +28,10 @@
 '''
 
 from __future__ import print_function
-import sys, cStringIO, MimeWriter, smtplib
+import sys, MimeWriter, smtplib
 from roundup import instance, date
 from roundup.mailer import SMTPConnection
+from roundup.anypy.strings import StringIO
 
 # open the instance
 if len(sys.argv) != 2:
@@ -71,7 +72,7 @@
         continue
 
     # generate the email message
-    message = cStringIO.StringIO()
+    message = StringIO()
     writer = MimeWriter.MimeWriter(message)
     writer.addheader('Subject', 'Your active %s issues'%db.config.TRACKER_NAME)
     writer.addheader('To', address)

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