You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for newline and encoding in tempfile module #45374
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2007-08-28.03:30:24.434>created_at=<Date2007-08-27.00:10:44.421>labels= ['type-feature', 'library']
title='Support for newline and encoding in tempfile module'updated_at=<Date2007-08-28.03:30:24.379>user='https://bugs.python.org/hupp'
It would be useful for tempfile.TemporaryFile and friends to pass
newline and encoding arguments to the underlying io.open call. For
example, several tests in test_csv use TemporaryFile and need to handle
unicode file output or preserve exact newlines. This is simpler with
direct support in TemporaryFile.
The attached patch makes the following changes:
tempfile.TemporaryFile, NamedTemporaryFile, and SpooledTemporaryFile
now pass newline and encoding to the underlying io.open call.
One change I forgot to mention that may need discussion. I've changed
the 'bufsize' arguments in tempfile to 'buffering', since that is
consistent with the same change in os.fdopen.
Activity
hupp commentedon Aug 27, 2007
It would be useful for tempfile.TemporaryFile and friends to pass
newline and encoding arguments to the underlying io.open call. For
example, several tests in test_csv use TemporaryFile and need to handle
unicode file output or preserve exact newlines. This is simpler with
direct support in TemporaryFile.
The attached patch makes the following changes:
now pass newline and encoding to the underlying io.open call.
hupp commentedon Aug 27, 2007
One change I forgot to mention that may need discussion. I've changed
the 'bufsize' arguments in tempfile to 'buffering', since that is
consistent with the same change in os.fdopen.
gvanrossum commentedon Aug 28, 2007
Thanks!
Committed revision 57594.
General note: please run Tools/scripts/reindent.py over your files after
editing so I won't have to.