parsers: Inherit the sandbox option when creating additional parsers
This commit is contained in:
parent
e6564509e1
commit
7405955ab5
@ -161,6 +161,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
|
|||||||
|
|
||||||
member_parser, _ = parser_factory.get_parser(full_path) # type: ignore
|
member_parser, _ = parser_factory.get_parser(full_path) # type: ignore
|
||||||
if member_parser:
|
if member_parser:
|
||||||
|
member_parser.sandbox = self.sandbox
|
||||||
local_meta = {**local_meta, **member_parser.get_meta()}
|
local_meta = {**local_meta, **member_parser.get_meta()}
|
||||||
|
|
||||||
if local_meta:
|
if local_meta:
|
||||||
@ -248,6 +249,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
|
|||||||
abort = True
|
abort = True
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
member_parser.sandbox = self.sandbox
|
||||||
if member_parser.remove_all() is False:
|
if member_parser.remove_all() is False:
|
||||||
logging.warning("In file %s, something went wrong \
|
logging.warning("In file %s, something went wrong \
|
||||||
with the cleaning of %s \
|
with the cleaning of %s \
|
||||||
|
@ -82,6 +82,7 @@ class FLACParser(MutagenParser):
|
|||||||
with open(fname, 'wb') as f:
|
with open(fname, 'wb') as f:
|
||||||
f.write(picture.data)
|
f.write(picture.data)
|
||||||
p, _ = parser_factory.get_parser(fname) # type: ignore
|
p, _ = parser_factory.get_parser(fname) # type: ignore
|
||||||
|
p.sandbox = self.sandbox
|
||||||
# Mypy chokes on ternaries :/
|
# Mypy chokes on ternaries :/
|
||||||
meta[name] = p.get_meta() if p else 'harmful data' # type: ignore
|
meta[name] = p.get_meta() if p else 'harmful data' # type: ignore
|
||||||
os.remove(fname)
|
os.remove(fname)
|
||||||
|
Loading…
Reference in New Issue
Block a user