home
·
contact
·
privacy
projects
/
url-catcher
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50dac05
)
Fix bug occuring when trying to append to non-existant file.
author
Christian Heller
<c.heller@plomlompom.de>
Thu, 26 Jan 2017 00:33:48 +0000
(
01:33
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Thu, 26 Jan 2017 00:33:48 +0000
(
01:33
+0100)
url_catcher.py
patch
|
blob
|
history
diff --git
a/url_catcher.py
b/url_catcher.py
index ca0974fc70c118127626a768b4c9889abcf017fb..0121896e997924f14e55d5dab3af7531df1b2e15 100755
(executable)
--- 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)