Closed lilmike closed 1 year ago
That stack trace looks like it was created by an older version of toot. Could you git pull the new code and try again? I'm suspecting it may crash again though. Don't have a pleroma subcription to try out.
Here you go, traceback from latest git:
Traceback (most recent call last):
File "/home/vlilmike/.pyenv/versions/toot/bin/toot", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/console.py", line 961, in main
run_command(app, user, command_name, args)
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/console.py", line 943, in run_command
return fn(app, user, parsed_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/commands.py", line 60, in timeline
statuses = [from_dict(Status, item) for item in items]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/commands.py", line 60, in <listcomp>
statuses = [from_dict(Status, item) for item in items]
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/entities.py", line 394, in from_dict
return cls(**dict(_fields()))
^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/entities.py", line 392, in _fields
yield field.name, _convert(field_type, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/entities.py", line 415, in _convert
return datetime.strptime(value, "%Y-%m-%dT%H:%M:%S.%f%z")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/lib/python3.11/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/lib/python3.11/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'
-Michael.
I tried to reproduce, even signed up for a pleroma instance, but without luck. I added some code which should produce a better error message. Could you pull latest from master
and tell me what error you get now?
Here's the new output:
Traceback (most recent call last):
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/entities.py", line 430, in _convert_with_error_handling
return _convert(field_type, field_value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/entities.py", line 445, in _convert
return datetime.strptime(value, "%Y-%m-%dT%H:%M:%S.%f%z").astimezone()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/lib/python3.11/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/lib/python3.11/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/vlilmike/.pyenv/versions/toot/bin/toot", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/console.py", line 961, in main
run_command(app, user, command_name, args)
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/console.py", line 943, in run_command
return fn(app, user, parsed_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/commands.py", line 60, in timeline
statuses = [from_dict(Status, item) for item in items]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/commands.py", line 60, in <listcomp>
statuses = [from_dict(Status, item) for item in items]
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/entities.py", line 410, in from_dict
return cls(**dict(_fields()))
^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/entities.py", line 407, in _fields
converted = _convert_with_error_handling(cls, field.name, field_type, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vlilmike/.pyenv/versions/3.11.6/envs/toot/lib/python3.11/site-packages/toot/entities.py", line 434, in _convert_with_error_handling
raise ConversionError(data_class, field_name, field_type, field_value)
toot.entities.ConversionError: Failed converting field `Status.created_at` of type `datetime` from value ''
For reference, the channel I am following is mwtab_main@peertube.fedihost.website
-Michael.
This is a bug in pleroma, they return an empty string for created_at
(not even null) which should always be populated. I'll create a workaround for this.
Possibly related to https://git.pleroma.social/pleroma/pleroma/-/issues/2851
I added a hack for now, it will display current datetime instead. Please pull and test.
It definitely doesn't crash now.
-Michael.
-- Sorry about the test, it's just a me thing. Michael Taboada, Creator of Games. Does that make me a god, well, sorta. My pgp key: 79BC390E8864CD71305D4DD606CD2197A6EE5ED7 My website: https://michaels.world 2MB website: https://2mb.games Don't believe everything you read on the internet. I might not be real, you might not be real, and this email certainly isn't real. Sent from my christmas spirited... stationary bicycle
Hiya,
If you follow a peertube channel, whenever a video is posted, the status will cause toot to traceback as such:
Thanks,
-Michael.
P.S. I'm using pleroma, and toot from latest git.