safer 4.6.1__py3-none-any.whl → 4.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: safer
3
- Version: 4.6.1
3
+ Version: 4.7.0
4
4
  Summary: 🧿 A safer writer for files and streams 🧿
5
5
  License: MIT
6
6
  Author: Tom Ritchford
@@ -0,0 +1,5 @@
1
+ safer.py,sha256=TphbmidXUkig_zXyOpJaWwhLdS6VxsjBUrHtVVVXB1M,21475
2
+ safer-4.7.0.dist-info/LICENSE,sha256=YrPqlE_MughiZSHUT2iVoduqlqmStMop9EEwCTdlzBw,1067
3
+ safer-4.7.0.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
4
+ safer-4.7.0.dist-info/METADATA,sha256=6C3oDd6MQQpETg5KnME82hhQXFUhdlabopB8iXYYKrU,5303
5
+ safer-4.7.0.dist-info/RECORD,,
safer.py CHANGED
@@ -63,7 +63,7 @@ or `io.BytesIO`.
63
63
 
64
64
  For very large files, `safer.open()` has a `temp_file` argument which
65
65
  writes the data to a temporary file on disk, which is moved over using
66
- `os.rename` if the operation completes successfully. This functionality
66
+ `os.replace` if the operation completes successfully. This functionality
67
67
  does not work on Windows. (In fact, it's unclear if any of this works on
68
68
  Windows, but that certainly won't. Windows developer solicted!)
69
69
 
@@ -201,7 +201,7 @@ def writer(
201
201
  closes
202
202
 
203
203
  temp_file: If `temp_file` is truthy, write to a disk file and use
204
- os.rename() at the end, otherwise cache the writes in memory.
204
+ os.replace() at the end, otherwise cache the writes in memory.
205
205
 
206
206
  If `temp_file` is a string, use it as the name of the temporary
207
207
  file, otherwise select one in the same directory as the target
@@ -323,7 +323,7 @@ def open(
323
323
  if there is an exception.
324
324
 
325
325
  temp_file: If `temp_file` is truthy, write to a disk file and use
326
- os.rename() at the end, otherwise cache the writes in memory.
326
+ os.replace() at the end, otherwise cache the writes in memory.
327
327
 
328
328
  If `temp_file` is a string, use it as the name of the temporary
329
329
  file, otherwise select one in the same directory as the target
@@ -643,7 +643,7 @@ class _FileRenameCloser(_FileCloser):
643
643
  shutil.copymode(self.target_file, self.temp_file)
644
644
  else:
645
645
  os.chmod(self.temp_file, 0o100644)
646
- os.rename(self.temp_file, self.target_file)
646
+ os.replace(self.temp_file, self.target_file)
647
647
 
648
648
 
649
649
  class _StreamCloser(_Closer):
@@ -1,5 +0,0 @@
1
- safer.py,sha256=t3VZ9_UuARwVDobhODFTHYc5ggjm7ax_mLCI3PPs1Pw,21471
2
- safer-4.6.1.dist-info/LICENSE,sha256=YrPqlE_MughiZSHUT2iVoduqlqmStMop9EEwCTdlzBw,1067
3
- safer-4.6.1.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
4
- safer-4.6.1.dist-info/METADATA,sha256=8_hvkHqfB0oABM1o8UU1f6Vhka3UgdximQ_otWdwu2E,5303
5
- safer-4.6.1.dist-info/RECORD,,
File without changes
File without changes