[ python-Feature Requests-1390197 ] tempfile misses usecase which requirs renaming

SourceForge.net noreply at sourceforge.net
Sun Dec 25 21:41:19 CET 2005


Feature Requests item #1390197, was opened at 2005-12-25 20:41
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1390197&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Dennis Allison (dallison)
Assigned to: Nobody/Anonymous (nobody)
Summary: tempfile misses usecase which requirs renaming

Initial Comment:
tempfile provides a very convenient API but it seems to
miss one important use case.  For example, suppose the
program is stream editing the file.  Typically one reads 
the source file, edits the data, and writes it to a
temporary file.  Upon successful completion of the edit,
the program renames the temporary to be the original
source file, which is atomic in most operating systems,
 There does not appear to be any neat way to do this with 
the current API without the program throwing an
exception because of the deletion wrapper.  Perhaps a
"rename" method needs to be added to manage the delete
seamlessly.  I am not especially fond of that solution
as it adds new functionality to file descriptors.

.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1390197&group_id=5470


More information about the Python-bugs-list mailing list