Skip to content

twarc2 timelines command throws exception on nonexistent users #633

@lxcode

Description

@lxcode

The timelines command appears to fail on the first username in a file that doesn't resolve — the regular timeline command in a for loop works fine, and that command gracefully just prints "⚡ No such user someuser".


 0%|                                  | Processed 98/61295 lines of input file [00:44<7:39:06,  2.22it/s]
Traceback (most recent call last):
  File "/opt/homebrew/bin/twarc2", line 8, in <module>
    sys.exit(twarc2())
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/twarc/command2.py", line 1489, in timelines
    tweets = _timeline_tweets(
  File "/opt/homebrew/lib/python3.9/site-packages/twarc/command2.py", line 1536, in _timeline_tweets
    tweets = T.timeline(
  File "/opt/homebrew/lib/python3.9/site-packages/twarc/client2.py", line 1290, in timeline
    user_id = self._ensure_user_id(user)
  File "/opt/homebrew/lib/python3.9/site-packages/twarc/client2.py", line 1874, in _ensure_user_id
    raise ValueError(f"No such user {user}")
ValueError: No such user LuXValVal1```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions