|
@@ -19,6 +19,7 @@ import argparse
|
|
|
import datetime
|
|
|
import logging
|
|
|
import os
|
|
|
+import shutil
|
|
|
import pathlib
|
|
|
import sys
|
|
|
import tempfile
|
|
@@ -104,7 +105,8 @@ def _write_event(event: icalendar.cal.Event, path: pathlib.Path) -> None:
|
|
|
os.write(temp_fd, event.to_ical())
|
|
|
os.close(temp_fd)
|
|
|
|
|
|
- os.rename(temp_path, str(path))
|
|
|
+ shutil.copy(temp_path, str(path))
|
|
|
+ os.remove(temp_path)
|
|
|
finally:
|
|
|
if os.path.exists(temp_path):
|
|
|
os.unlink(temp_path)
|