mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 14:44:29 -04:00
add comment
This commit is contained in:
parent
bd6d9c165b
commit
56c6b11b14
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ def atomic_write(path: Union[Path, str], contents: Union[dict, str, bytes], over
|
||||||
"""Safe atomic write to filesystem by writing to temp file + atomic rename"""
|
"""Safe atomic write to filesystem by writing to temp file + atomic rename"""
|
||||||
|
|
||||||
mode = 'wb+' if isinstance(contents, bytes) else 'w'
|
mode = 'wb+' if isinstance(contents, bytes) else 'w'
|
||||||
encoding = None if isinstance(contents, bytes) else 'utf-8'
|
encoding = None if isinstance(contents, bytes) else 'utf-8' # enforce utf-8 on all text writes
|
||||||
|
|
||||||
# print('\n> Atomic Write:', mode, path, len(contents), f'overwrite={overwrite}')
|
# print('\n> Atomic Write:', mode, path, len(contents), f'overwrite={overwrite}')
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue