This commit is contained in:
Your Name
2024-04-27 03:14:01 -05:00
parent f5ba304cd6
commit f23e5441b5
56 changed files with 3319 additions and 36416 deletions

View File

@@ -1,7 +1,6 @@
import os
import tempfile
import contextlib
from typing import Optional
class CallbackReader:
@@ -24,7 +23,7 @@ class CallbackReader:
@contextlib.contextmanager
def atomic_write_in_dir(path: str, mode: str = 'w', buffering: int = -1, encoding: Optional[str] = None, newline: Optional[str] = None,
def atomic_write_in_dir(path: str, mode: str = 'w', buffering: int = -1, encoding: str = None, newline: str = None,
overwrite: bool = False):
"""Write to a file atomically using a temporary file in the same directory as the destination file."""
dir_name = os.path.dirname(path)