Allow using Windows path in archive.extracted name attribute, including drive letter colon and backslashes.

This commit is contained in:
Mike Pagel 2016-02-09 15:28:33 +01:00
parent 2b8f7a12e7
commit 9dcc617a53

View file

@ -7,6 +7,7 @@ Extract an archive
# Import Python libs
from __future__ import absolute_import
import re
import os
import logging
import tarfile
@ -168,7 +169,7 @@ def extracted(name,
filename = os.path.join(__opts__['cachedir'],
'files',
__env__,
'{0}.{1}'.format(if_missing.replace('/', '_'),
'{0}.{1}'.format(re.sub('[:/\\\\]', '_', if_missing),
archive_format))
if not os.path.exists(filename):
if __opts__['test']: