X-Git-Url: https://plomlompom.com/repos/?p=url-catcher;a=blobdiff_plain;f=url_catcher.py;h=0121896e997924f14e55d5dab3af7531df1b2e15;hp=ca0974fc70c118127626a768b4c9889abcf017fb;hb=53f2a78496fe73750f729b3c5e4949e528745b65;hpb=50dac05d76e36020536ac7c75325f54d1caba3dd 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)