[GH-ISSUE #185] TypeError on archive #1639

Closed
opened 2026-03-01 17:52:24 +03:00 by kerem · 7 comments
Owner

Originally created by @diego898 on GitHub (Mar 21, 2019).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/185

Describe the bug

I tried to save this relatively simple blog post, and got a TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'float' error

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to http://www.offconvex.org/2019/03/19/CURL/
  2. Attempt to archive it with echo "http://www.offconvex.org/2019/03/19/CURL/" | ./archive

Screenshots or log output

➜  ArchiveBox git:(master) echo "http://www.offconvex.org/2019/03/19/CURL/" | ./archive
[*] [2019-03-21 09:08:42] Parsing new links from output/sources/stdin-1553177320.txt...
    > Adding 1 new links to index (parsed import as Plain Text)
[*] [2019-03-21 09:08:42] Saving main index files...
    √ output/index.json
    √ output/index.html
[▶] [2019-03-21 09:08:42] Updating content for 3 pages in archive...
[+] [2019-03-21 09:08:42] "http://www.offconvex.org/2019/03/19/CURL/"
    http://www.offconvex.org/2019/03/19/CURL/
    > output/archive/1553177322 (new)
      > title
      > favicon
      > wget
      > pdf
      > screenshot
      > dom
      > media
      > archive_org
[*] [2019-03-21 09:09:08] "Activation Atlas"
    https://distill.pub/2019/activation-atlas/
    > output/archive/1552175337
[*] [2019-03-21 09:09:08] "Example Domain"
    https://example.com
    > output/archive/1552175279
Traceback (most recent call last):
  File "./archive", line 132, in <module>
    main(*sys.argv)
  File "./archive", line 93, in main
    update_archive_data(import_path=import_path, resume=resume)
  File "./archive", line 124, in update_archive_data
    log_archiving_finished(len(links))
  File "/Users/diegomesa/src/ArchiveBox/archivebox/logs.py", line 158, in log_archiving_finished
    seconds = end_ts - _LAST_RUN_STATS['start_ts'].timestamp()
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'float'

Software versions

(please complete the following information)

  • OS: macOS 10.14.,3
  • ArchiveBox version: git rev-parse HEAD | head -c7 : d798117
  • Python version: Python 3.6.8 :: Anaconda custom (64-bit)
  • Chrome version: Version 73.0.3683.75 (Official Build) (64-bit)
Originally created by @diego898 on GitHub (Mar 21, 2019). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/185 ### Describe the bug I tried to save this relatively simple blog post, and got a `TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'float'` error ### Steps to reproduce Steps to reproduce the behavior: 1. Go to http://www.offconvex.org/2019/03/19/CURL/ 2. Attempt to archive it with `echo "http://www.offconvex.org/2019/03/19/CURL/" | ./archive` ### Screenshots or log output ``` ➜ ArchiveBox git:(master) echo "http://www.offconvex.org/2019/03/19/CURL/" | ./archive [*] [2019-03-21 09:08:42] Parsing new links from output/sources/stdin-1553177320.txt... > Adding 1 new links to index (parsed import as Plain Text) [*] [2019-03-21 09:08:42] Saving main index files... √ output/index.json √ output/index.html [▶] [2019-03-21 09:08:42] Updating content for 3 pages in archive... [+] [2019-03-21 09:08:42] "http://www.offconvex.org/2019/03/19/CURL/" http://www.offconvex.org/2019/03/19/CURL/ > output/archive/1553177322 (new) > title > favicon > wget > pdf > screenshot > dom > media > archive_org [*] [2019-03-21 09:09:08] "Activation Atlas" https://distill.pub/2019/activation-atlas/ > output/archive/1552175337 [*] [2019-03-21 09:09:08] "Example Domain" https://example.com > output/archive/1552175279 Traceback (most recent call last): File "./archive", line 132, in <module> main(*sys.argv) File "./archive", line 93, in main update_archive_data(import_path=import_path, resume=resume) File "./archive", line 124, in update_archive_data log_archiving_finished(len(links)) File "/Users/diegomesa/src/ArchiveBox/archivebox/logs.py", line 158, in log_archiving_finished seconds = end_ts - _LAST_RUN_STATS['start_ts'].timestamp() TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'float' ``` ### Software versions (please complete the following information) - OS: macOS 10.14.,3 - ArchiveBox version: `git rev-parse HEAD | head -c7` : d798117 - Python version: Python 3.6.8 :: Anaconda custom (64-bit) - Chrome version: Version 73.0.3683.75 (Official Build) (64-bit)
kerem closed this issue 2026-03-01 17:52:24 +03:00
Author
Owner

@pirate commented on GitHub (Mar 21, 2019):

Yeah sorry about this, pushed a refactor too fast last night without testing thoroughly. I'll have this fixed today.

<!-- gh-comment-id:475368684 --> @pirate commented on GitHub (Mar 21, 2019): Yeah sorry about this, pushed a refactor too fast last night without testing thoroughly. I'll have this fixed today.
Author
Owner

@hyfen commented on GitHub (Mar 21, 2019):

I also encountered this one just now.

<!-- gh-comment-id:475396612 --> @hyfen commented on GitHub (Mar 21, 2019): I also encountered this one just now.
Author
Owner

@pirate commented on GitHub (Mar 22, 2019):

@simon987 beat me to the fix. Try it now.

<!-- gh-comment-id:475461830 --> @pirate commented on GitHub (Mar 22, 2019): @simon987 beat me to the fix. Try it now.
Author
Owner

@NullEnt1ty commented on GitHub (Mar 22, 2019):

It seems to work now. Although the application exits with a non-zero code. This is the last output:

[√] [2019-03-22 08:41:31] Update of 2 pages complete (10.46 sec)
    - 0 entries skipped
Traceback (most recent call last):
  File "./archive", line 132, in <module>
    main(*sys.argv)
  File "./archive", line 93, in main
    update_archive_data(import_path=import_path, resume=resume)
  File "./archive", line 124, in update_archive_data
    log_archiving_finished(len(links))
  File "/home/dominique/Documents/projects/ArchiveBox/archivebox/logs.py", line 172, in log_archiving_finished
    print('    - {} entries updated'.format(_LAST_RUN_STATS['succeded']))
KeyError: 'succeded'
$ echo $?
1

Is this intentional?

<!-- gh-comment-id:475523776 --> @NullEnt1ty commented on GitHub (Mar 22, 2019): It seems to work now. Although the application exits with a non-zero code. This is the last output: ``` [√] [2019-03-22 08:41:31] Update of 2 pages complete (10.46 sec) - 0 entries skipped Traceback (most recent call last): File "./archive", line 132, in <module> main(*sys.argv) File "./archive", line 93, in main update_archive_data(import_path=import_path, resume=resume) File "./archive", line 124, in update_archive_data log_archiving_finished(len(links)) File "/home/dominique/Documents/projects/ArchiveBox/archivebox/logs.py", line 172, in log_archiving_finished print(' - {} entries updated'.format(_LAST_RUN_STATS['succeded'])) KeyError: 'succeded' ``` ``` $ echo $? 1 ``` Is this intentional?
Author
Owner

@simon987 commented on GitHub (Mar 22, 2019):

@NullEnt1ty This is a typo, I made a different PR for that: #187

<!-- gh-comment-id:475605062 --> @simon987 commented on GitHub (Mar 22, 2019): @NullEnt1ty This is a typo, I made a different PR for that: #187
Author
Owner

@n0ncetonic commented on GitHub (Mar 22, 2019):

I recently experienced this but I'm guessing the PR will fix it.

<!-- gh-comment-id:475696894 --> @n0ncetonic commented on GitHub (Mar 22, 2019): I recently experienced this but I'm guessing the PR will fix it.
Author
Owner

@pirate commented on GitHub (Mar 22, 2019):

Just merged @simon987's PR, thanks for reporting @n0ncetonic and @NullEnt1ty! Comment back if you're still having problems and I'll reopen it.

<!-- gh-comment-id:475697103 --> @pirate commented on GitHub (Mar 22, 2019): Just merged @simon987's PR, thanks for reporting @n0ncetonic and @NullEnt1ty! Comment back if you're still having problems and I'll reopen it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#1639
No description provided.