Issue1340
Created on 2007-10-26 23:28 by amaury.forgeotdarc, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Messages (6) | |||
|---|---|---|---|
| msg56830 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * ![]() |
Date: 2007-10-26 23:28 | |
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, |
|||
| msg56861 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2007-10-27 21:02 | |
The patch is fine but you should add a short comment to avoid future trouble. On the first glance it's not obvious why the StringIO instance mustn't have a newline argument. |
|||
| msg56881 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2007-10-28 15:12 | |
Committed revision 58699. (My own interpretation of the patch, with comment :-) I expect this will fix a bunch Windows failures; I've seen complaints inmplicating doubled newlines in a few places, and this mught just be the cause. Thanks! |
|||
| msg56883 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2007-10-28 15:33 | |
D'oh, I submitted to the wrong branch. The py3k branch will have to wait until after my son's birthday party. ;-) |
|||
| msg56884 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2007-10-28 15:53 | |
Guido van Rossum wrote: > Guido van Rossum added the comment: > > D'oh, I submitted to the wrong branch. The py3k branch will have to > wait until after my son's birthday party. ;-) Have a nice party! How old is he? IIRC he was about 4 on the pictures you showed us at EuroPython 2005 in Göteborg. |
|||
| msg56911 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2007-10-29 17:16 | |
New Revision: 58701. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:27 | admin | set | github: 45681 |
| 2007-10-29 17:16:42 | gvanrossum | set | status: open -> closed messages: + msg56911 |
| 2007-10-28 15:53:54 | christian.heimes | set | messages: + msg56884 |
| 2007-10-28 15:33:22 | gvanrossum | set | status: closed -> open messages: + msg56883 |
| 2007-10-28 15:12:51 | gvanrossum | set | status: open -> closed resolution: accepted messages: + msg56881 |
| 2007-10-28 14:59:14 | gvanrossum | set | assignee: gvanrossum |
| 2007-10-27 21:02:32 | christian.heimes | set | nosy:
+ christian.heimes, gvanrossum messages: + msg56861 |
| 2007-10-26 23:28:09 | amaury.forgeotdarc | create | |
