We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 813e079 commit be4c9c8Copy full SHA for be4c9c8
tableaudocumentapi/containerfile.py
@@ -19,9 +19,10 @@ def temporary_directory(*args, **kwargs):
19
def find_file_in_zip(zip):
20
for filename in zip.namelist():
21
try:
22
- ET.parse(zip.open(filename)).getroot().tag in (
23
- 'workbook', 'datasource')
24
- return filename
+ with zip.open(filename) as xml_candidate:
+ ET.parse(xml_candidate).getroot().tag in (
+ 'workbook', 'datasource')
25
+ return filename
26
except ET.ParseError:
27
# That's not an XML file by gosh
28
pass
0 commit comments