Atomic save should use the target of symlinks
This commit is contained in:
@@ -36,6 +36,7 @@ def build_ansi_color_table(opts: Optional[Options] = None) -> int:
|
||||
|
||||
def atomic_save(data: bytes, path: str) -> None:
|
||||
import tempfile
|
||||
path = os.path.realpath(path)
|
||||
fd, p = tempfile.mkstemp(dir=os.path.dirname(path), suffix='.tmp')
|
||||
try:
|
||||
with os.fdopen(fd, 'wb') as f:
|
||||
|
||||
Reference in New Issue
Block a user