From: Christian Heller Date: Thu, 26 Jan 2017 00:34:13 +0000 (+0100) Subject: Merge branch 'master' of github.com:plomlompom/url-catcher X-Git-Url: https://plomlompom.com/repos/?p=url-catcher;a=commitdiff_plain;h=5fbddbcda77d118572a1a1d39415ae54310fee05;hp=280a9f74f3b990696e294db99697acc3d2768b7c Merge branch 'master' of github.com:plomlompom/url-catcher --- diff --git a/url_catcher.py b/url_catcher.py index ca0974f..0121896 100755 --- a/url_catcher.py +++ b/url_catcher.py @@ -49,7 +49,7 @@ os.makedirs(lists_dir, exist_ok=True) def atomic_write(path, content, mode): """Atomic write/append to file.""" _, tmpPath = tempfile.mkstemp() - if 'a' == mode: + if 'a' == mode and os.path.exists(path): shutil.copy2(path, tmpPath) f = open(tmpPath, mode) f.write(content)