Mercurial > p > roundup > code
comparison roundup/cgi/engine_chameleon.py @ 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 | 56c9bcdea47f |
| children | 4d20d8251bf2 |
comparison
equal
deleted
inserted
replaced
| 5417:c749d6795bc2 | 5418:55f09ca366c4 |
|---|---|
| 3 __docformat__ = 'restructuredtext' | 3 __docformat__ = 'restructuredtext' |
| 4 | 4 |
| 5 import os.path | 5 import os.path |
| 6 import chameleon | 6 import chameleon |
| 7 | 7 |
| 8 from roundup.cgi.templating import StringIO, context, TALLoaderBase | 8 from roundup.cgi.templating import context, TALLoaderBase |
| 9 from roundup.anypy.strings import s2u | 9 from roundup.anypy.strings import s2u |
| 10 | 10 |
| 11 class Loader(TALLoaderBase): | 11 class Loader(TALLoaderBase): |
| 12 def __init__(self, dir): | 12 def __init__(self, dir): |
| 13 self.dir = dir | 13 self.dir = dir |
