buckket / twtxt

Decentralised, minimalist microblogging service for hackers.
http://twtxt.readthedocs.org/en/stable/
MIT License
1.94k stars 79 forks source link

`twtxt following` error exception not caught #133

Closed pkillnine closed 2 years ago

pkillnine commented 6 years ago

Running version 1.2.3 with Python3.6 on Slackware.

itsme@slack ~> twtxt following
➤ adiabetic @ https://www.frogorbits.com/twtxt.txt [533 Bytes, 7 months ago] (200)
➤ akraut @ https://akraut.keybase.pub/twtxt.txt [195 Bytes, 11 months ago] (200)
➤ alip @ https://dev.exherbo.org/~alip/twtxt.txt [5.0 kB, 17 days ago] (200)
➤ autoalk @ http://autoalk.tk/twtxt/autoalk.txt [49 Bytes, 1 year, 10 months ago] (200)
➤ benaiah @ https://benaiah.me/twtxt.txt [0 Bytes, 2 months ago] (200)
➤ bhearsum @ http://hearsum.ca/~bhearsum/twtxt.txt [43 Bytes, 11 months ago] (200)
Traceback (most recent call last):
  File "/home/itsme/.local/bin/twtxt", line 11, in <module>
    sys.exit(main())
  File "/home/itsme/.local/lib64/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/itsme/.local/lib64/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/itsme/.local/lib64/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/itsme/.local/lib64/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/itsme/.local/lib64/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/itsme/.local/lib64/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/itsme/.local/lib64/python3.6/site-packages/twtxt/cli.py", line 218, in following
    click.echo(style_source_with_status(source, status, porcelain))
  File "/home/itsme/.local/lib64/python3.6/site-packages/twtxt/helper.py", line 72, in style_source_with_status
    if status.status_code == 200:
AttributeError: 'NoneType' object has no attribute 'status_code'

My guess is it is requesting a url (not sure which one, it's making multiple requests at the same time) and times out, returns None but doesn't skip that one nor show it to have timed out.

flber commented 4 years ago

I'm also having this issue, running version 1.2.3 with python 3.8.5

dR3b commented 3 years ago

Python: 3.9.1

1   ~ » ~/git/env/bin/python ~/git/env/bin/twtxt following
  1 Traceback (most recent call last):
  2   File "/home/user/git/env/bin/twtxt", line 8, in <module>
  3     sys.exit(main())
  4   File "/home/user/git/env/lib/python3.9/site-packages/click/core.py", line 722, in __call__
  5     return self.main(*args, **kwargs)
  6   File "/home/user/git/env/lib/python3.9/site-packages/click/core.py", line 697, in main
  7     rv = self.invoke(ctx)
  8   File "/home/user/git/env/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
  9     return _process_result(sub_ctx.command.invoke(sub_ctx))
 10   File "/home/user/git/env/lib/python3.9/site-packages/click/core.py", line 895, in invoke
 11     return ctx.invoke(self.callback, **ctx.params)
 12   File "/home/user/git/env/lib/python3.9/site-packages/click/core.py", line 535, in invoke
 13     return callback(*args, **kwargs)
 14   File "/home/user/git/env/lib/python3.9/site-packages/click/decorators.py", line 17, in new_func
 15     return f(get_current_context(), *args, **kwargs)
 16   File "/home/user/git/env/lib/python3.9/site-packages/twtxt/cli.py", line 218, in following
 17     click.echo(style_source_with_status(source, status, porcelain))
 18   File "/home/user/git/env/lib/python3.9/site-packages/twtxt/helper.py", line 72, in style_source_with_status
 19     if status.status_code == 200:
 20 AttributeError: 'NoneType' object has no attribute 'status_code'
buckket commented 2 years ago

Fixed!