| |
@@ -20,10 +20,7 @@
|
| |
from typing import Mapping, Optional
|
| |
import xml
|
| |
|
| |
- try:
|
| |
- from defusedxml import cElementTree as etree
|
| |
- except ImportError:
|
| |
- from defusedxml import ElementTree as etree
|
| |
+ from defusedxml import ElementTree as etree
|
| |
|
| |
from .requests import make_session
|
| |
|
| |
@@ -84,7 +81,7 @@
|
| |
# Let's assume that there is only one file in archive
|
| |
tarinfo = tar.next()
|
| |
if tarinfo:
|
| |
- tar.extract(tarinfo, path=os.path.dirname(location))
|
| |
+ tar.extract(tarinfo, path=os.path.dirname(location), filter="data")
|
| |
os.rename(
|
| |
os.path.join(os.path.dirname(location), tarinfo.name), location
|
| |
)
|
| |
@@ -231,7 +228,7 @@
|
| |
|
| |
# iterate over the rest of the primary.xml tree
|
| |
for event, elem in context:
|
| |
- if not root:
|
| |
+ if root is None:
|
| |
root = elem
|
| |
continue
|
| |
|
| |
See individual commit messages for more details.