]> arthur.barton.de Git - bup.git/commitdiff
Adjust atomically_replaced_file documentation.
authorRob Browning <rlb@defaultvalue.org>
Tue, 5 Aug 2014 17:29:31 +0000 (12:29 -0500)
committerRob Browning <rlb@defaultvalue.org>
Tue, 5 Aug 2014 17:29:31 +0000 (12:29 -0500)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/helpers.py

index 34772368966ccf633aaf70b22fe47a02368fbee5..300e67eee25dd9123537b73a1b4fc1a3fc72075c 100644 (file)
@@ -631,15 +631,15 @@ def chunkyreader(f, count = None):
 
 @contextmanager
 def atomically_replaced_file(name, mode='w', buffering=-1):
 
 @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,
 
     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.::
 
 
     E.g.::