Commit 82a9a7d8 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[web] Do not try to rmtree symlinks in rmtreecontent()

There is a symlink in data directory (created by generate_static_dir() method)
and trying to rmtree() it will fail with an OSError. So we unlink() it

branch : 3.25
parent 241bb09c67f7
...@@ -44,7 +44,7 @@ def rmtreecontent(dst): ...@@ -44,7 +44,7 @@ def rmtreecontent(dst):
itself)""" itself)"""
for fname in os.listdir(dst): for fname in os.listdir(dst):
fpath = osp.join(dst, fname) fpath = osp.join(dst, fname)
if osp.isfile(fpath): if osp.isfile(fpath) or osp.islink(fpath):
os.unlink(fpath) os.unlink(fpath)
else: else:
rmtree(fpath) rmtree(fpath)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment