Skip to content

Commit

Permalink
Remove iso8601 dependency from simple metadata api
Browse files Browse the repository at this point in the history
Use builtin datetime instead of external iso6801 for simple
datetime string parsing. Also see
#1065

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
  • Loading branch information
lukpueh committed Sep 10, 2020
1 parent 228a4c7 commit f106435
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tuf/api/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from securesystemslib.storage import StorageBackendInterface
from securesystemslib.keys import create_signature, verify_signature

import iso8601
import tuf.formats
import tuf.exceptions

Expand Down Expand Up @@ -295,8 +294,9 @@ def from_dict(cls, signed_dict: JsonDict) -> 'Signed':
# Convert 'expires' TUF metadata string to a datetime object, which is
# what the constructor expects and what we store. The inverse operation
# is implemented in 'to_dict'.
signed_dict['expires'] = iso8601.parse_date(
signed_dict['expires']).replace(tzinfo=None)
signed_dict['expires'] = datetime.strptime(
signed_dict['expires'],
"%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=None)
# NOTE: We write the converted 'expires' back into 'signed_dict' above
# so that we can pass it to the constructor as '**signed_dict' below,
# along with other fields that belong to Signed subclasses.
Expand Down

0 comments on commit f106435

Please sign in to comment.