Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/commoncode/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def extract_tar(location, target_dir, verbatim=False, filter=None, *args, **kwar
if py314 and filter:
tar.extractall(target_dir, members=to_extract, filter=filter)
else:
tar.extractall(target_dir, members=to_extract)
try:
tar.extractall(target_dir, members=to_extract, filter='data')
except TypeError:
tar.extractall(target_dir, members=to_extract)
finally:
if tar:
tar.close()
Expand Down
3 changes: 2 additions & 1 deletion src/commoncode/timeutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#

from datetime import datetime
from datetime import timezone
from datetime import tzinfo
from functools import update_wrapper
from functools import wraps
Expand Down Expand Up @@ -58,7 +59,7 @@ def time2tstamp(dt=None, path_safe=True):
to convert back to a datetime object.
"""
# TODO: check that the dt is effectively in UTC
datim = dt or datetime.utcnow()
datim = dt or datetime.now(timezone.utc).replace(tzinfo=None)
iso = datim.isoformat()
if path_safe:
iso = iso.replace(":", "").replace("/", "_")
Expand Down
Loading