Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on "blank notifications" #167

Open
nydel opened this issue Jan 23, 2018 · 6 comments
Open

crash on "blank notifications" #167

nydel opened this issue Jan 23, 2018 · 6 comments

Comments

@nydel
Copy link

nydel commented Jan 23, 2018

tootstream crashes when encountering what i have referred to as "blank notifications" ... here is the traceback:

(having called 'notes' from the REPL)

note: 70376
@(user-removed) favorited your status:
♺:0 ♥:1 id:23 vis:🌎 via ◆ Tootdon ◆ 2018-01-23 02:06:41 (19 hours ago)
@(user-removed) you make good points and are clearly thoughtful and think critically. and my further thoughts are - what you say suggests a problem/solution which is better than my simple whinging about progress not being made fast enough. moving from feedlot chicken-nugget tv dinner ft. ambient petroleum byproduct
toward a more harmonious farming is more concrete. but is it more realistic? without leaving omnivorousness behind, can we supply the demand in a more ethical way, or is it too high?

note: 70386
Traceback (most recent call last):
File "/home/nydel/ve/dev/tootstream/bin/tootstream", line 11, in
load_entry_point('tootstream==0.3.1', 'console_scripts', 'tootstream')()
File "/home/nydel/ve/dev/tootstream/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/home/nydel/ve/dev/tootstream/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/nydel/ve/dev/tootstream/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/nydel/ve/dev/tootstream/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/nydel/ve/dev/tootstream/lib/python3.5/site-packages/tootstream-0.3.1-py3.5.egg/tootstream/toot.py", line 1566, in main
File "/home/nydel/ve/dev/tootstream/lib/python3.5/site-packages/tootstream-0.3.1-py3.5.egg/tootstream/toot.py", line 1015, in note
TypeError: 'NoneType' object is not subscriptable
(tootstream) nydel@foresee:~/ve/dev/tootstream$

the very next note that would be displayed is the "blank notification"

@craigmaloney
Copy link
Collaborator

Would you check this with version 0.3.2 of Tootstream? The streaming API changed for Mastodon.py and that may solve the issue.

Thanks!

@nydel
Copy link
Author

nydel commented Jan 23, 2018

new ve & new pip installation -- after calling notes (a few notes are displayed then...)

note: 70386
Traceback (most recent call last):
File "/home/nydel/ve/ts/bin/tootstream", line 11, in
sys.exit(main())
File "/home/nydel/ve/ts/lib/python3.5/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/home/nydel/ve/ts/lib/python3.5/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/nydel/ve/ts/lib/python3.5/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/nydel/ve/ts/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/nydel/ve/ts/lib/python3.5/site-packages/tootstream/toot.py", line 1665, in main
cmd_func(mastodon, rest)
File "/home/nydel/ve/ts/lib/python3.5/site-packages/tootstream/toot.py", line 1114, in note
tz_info = note['status']['created_at'].tzinfo
TypeError: 'NoneType' object is not subscriptable
(ts) nydel@foresee:~/ve/ts$

@craigmaloney
Copy link
Collaborator

So it looks like 'created_at' isn''t getting set for that notification. Hurm. That's strange.

Would it be possible to run the following:

python -m pdb `which tootstream` , type "c" to continue, type note and then type p note['status'] to see what is getting returned?

@nydel
Copy link
Author

nydel commented Jan 23, 2018

note: 70386
Traceback (most recent call last):
File "/usr/lib/python3.5/pdb.py", line 1661, in main
pdb._runscript(mainpyfile)
File "/usr/lib/python3.5/pdb.py", line 1542, in _runscript
self.run(statement)
File "/usr/lib/python3.5/bdb.py", line 431, in run
exec(cmd, globals, locals)
File "", line 1, in
File "/home/nydel/ve/ts/bin/tootstream", line 4, in
import re
File "/home/nydel/ve/ts/lib/python3.5/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/home/nydel/ve/ts/lib/python3.5/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/nydel/ve/ts/lib/python3.5/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/nydel/ve/ts/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/nydel/ve/ts/lib/python3.5/site-packages/tootstream/toot.py", line 1665, in main
cmd_func(mastodon, rest)
File "/home/nydel/ve/ts/lib/python3.5/site-packages/tootstream/toot.py", line 1114, in note
tz_info = note['status']['created_at'].tzinfo
TypeError: 'NoneType' object is not subscriptable
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program

/home/nydel/ve/ts/lib/python3.5/site-packages/tootstream/toot.py(1114)note()
-> tz_info = note['status']['created_at'].tzinfo
(Pdb) p note['status']
None
(Pdb) p note['created_at']
datetime.datetime(2018, 1, 23, 3, 11, 36, 214000, tzinfo=tzutc())
(Pdb)

@craigmaloney
Copy link
Collaborator

0977330 adds a generic exception handling routine for crashes like this. It's not the best solution but it should prevent it from crashing. I'll still give this a peek for future versions.

@magicalraccoon
Copy link
Owner

Are we still having errors with this? I haven't seen anything on my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants