From b1de6737f07463cd07541e597a3caab60446c6d6 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 3 Oct 2020 13:19:22 +0200 Subject: [PATCH] Skip creation if exists and definitely log PANICs --- etherpump/commands/pull.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etherpump/commands/pull.py b/etherpump/commands/pull.py index e4547db..26e7c55 100644 --- a/etherpump/commands/pull.py +++ b/etherpump/commands/pull.py @@ -288,9 +288,10 @@ async def handle_pad(args, padid, data, info, session): if args.all or (args.meta or args.text or args.html or args.dhtml): try: path = trio.Path(os.path.split(metapath)[0]) - await path.mkdir() - except OSError: - print("PANIC: unable to create {}".format(str(path))) + if not os.path.exists(path): + await path.mkdir() + except OSError as exception: + print("PANIC: {}".format(exception)) if args.all or args.text: url = info["localapiurl"] + "getText?" + urlencode(data)