From a01949cd7bef41c7f43e6334e6989878d47b29b6 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Tue, 5 Aug 2014 12:29:31 -0500 Subject: [PATCH] Adjust atomically_replaced_file documentation. Signed-off-by: Rob Browning --- lib/bup/helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bup/helpers.py b/lib/bup/helpers.py index 3477236..300e67e 100644 --- a/lib/bup/helpers.py +++ b/lib/bup/helpers.py @@ -631,15 +631,15 @@ def chunkyreader(f, count = None): @contextmanager def atomically_replaced_file(name, mode='w', buffering=-1): - """Write to file which will atomically become name when finished. + """Yield a file that will be atomically renamed name when leaving the block. This contextmanager yields an open file object that is backed by a temporary file which will be renamed (atomically) to the target name if everything succeeds. The mode and buffering arguments are handled exactly as with open, - and upon success the resulting file will have very restrictive - permissions, as per mkstemp. + and the yielded file will have have very restrictive permissions, + as per mkstemp. E.g.:: -- 2.39.2