If I read rfc3339 correctly, offsets from UTC can be specified with +0X:00. However, if I manually create a pages.jsonl with such timezone suffices, I receive an error when I run wacz create --pages pages.jsonl -f mywarc.warc.gz:
Traceback (most recent call last):
File "/usr/bin/wacz", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/lib/python3.12/site-packages/wacz/main.py", line 123, in main
value = cmd.func(cmd)
^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/wacz/main.py", line 211, in create_wacz
passed_pages_dict = construct_passed_pages_dict(passed_content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/wacz/util.py", line 90, in construct_passed_pages_dict
key = iso_date_to_timestamp(page_dict.pop("ts")) + "/" + url
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/warcio/timeutils.py", line 155, in iso_date_to_timestamp
return datetime_to_timestamp(iso_date_to_datetime(string))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/warcio/timeutils.py", line 60, in iso_date_to_datetime
the_datetime = datetime.datetime(*(int(num) for num in nums))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/warcio/timeutils.py", line 60, in <genexpr>
the_datetime = datetime.datetime(*(int(num) for num in nums))
^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
pages.jsonl
{"url":"http://example.archive/example.html","title":"Example","ts":"2013-05-07T00:00:00+01:00","mime":"text/html"}
Seems like the case where the timezone suffix is simply Z is handled correctly, though.
If I read rfc3339 correctly, offsets from UTC can be specified with
+0X:00. However, if I manually create apages.jsonlwith such timezone suffices, I receive an error when I runwacz create --pages pages.jsonl -f mywarc.warc.gz:pages.jsonl
{"url":"http://example.archive/example.html","title":"Example","ts":"2013-05-07T00:00:00+01:00","mime":"text/html"}Seems like the case where the timezone suffix is simply
Zis handled correctly, though.