New submission from Antoine Pitrou: It is sometimes useful to create a temporary file as a copy of an existing file (especially e.g. in tests, when you want to mutate the temp file but not the original). I would suggest adding a `copy_from` argument to TemporaryFile and NamedTemporaryFile, which is either the path to an existing file or a file-like object. Then the contents of that source file are copied to the tempfile before it is yielded.
---------- components: Library (Lib) messages: 186392 nosy: ncoghlan, pitrou priority: normal severity: normal status: open title: add `copy_from` argument to temporaryfile type: enhancement versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17673> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com