This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc
Date 2007-10-26.23:28:09
SpamBayes Score 0.019837134
Marked as misclassified No
Message-id <1193441289.92.0.979777798118.issue1340@psf.upfronthosting.co.za>
In-reply-to
Content
This tiny patch correct a failure in test_tempfile on Windows: in
SpooledTemporaryFile, avoid translating the newlines twice.
Otherwise, in "universal" text mode, \n gets transformed to \r\n, then
to \r\r\n, which is read as \n\n.
Passing the encoding is OK, since the round-trip gives the same result,
and it allow encoding errors to occur at the right place.

Index: Lib/tempfile.py
===================================================================
--- Lib/tempfile.py     (revision 58680)
+++ Lib/tempfile.py     (working copy)
@@ -495,7 +495,7 @@
         if 'b' in mode:
             self._file = _io.BytesIO()
         else:
-            self._file = _io.StringIO(encoding=encoding, newline=newline)
+            self._file = _io.StringIO(encoding=encoding)
         self._max_size = max_size
         self._rolled = False
         self._TemporaryFileArgs = {'mode': mode, 'buffering': buffering,
History
Date User Action Args
2007-10-26 23:28:10amaury.forgeotdarcsetspambayes_score: 0.0198371 -> 0.019837134
recipients: + amaury.forgeotdarc
2007-10-26 23:28:09amaury.forgeotdarcsetspambayes_score: 0.0198371 -> 0.0198371
messageid: <1193441289.92.0.979777798118.issue1340@psf.upfronthosting.co.za>
2007-10-26 23:28:09amaury.forgeotdarclinkissue1340 messages
2007-10-26 23:28:09amaury.forgeotdarccreate