Skip to content

AttributeError: 'bool' object has no attribute 'get' #268

@fabston

Description

@fabston

I found this bug just now:

Traceback (most recent call last):
  File "bot/x_handler.py", line 127, in _execute_with_session_rotation
    result = await api_call(client)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "bot/x_handler.py", line 168, in fetch_tweet
    data = await client.tweet_detail(f"https://twitter.com/{username}/status/{status_id}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "bot/site-packages/tweety/bot.py", line 874, in tweet_detail
    tweet = Tweet(self, entry, response)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "bot/site-packages/tweety/types/twDataTypes.py", line 29, in new_init
    init(self, *_args, **_kwargs) # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "bot/site-packages/tweety/types/twDataTypes.py", line 215, in __init__
    self._format_tweet()
  File "bot/site-packages/tweety/types/twDataTypes.py", line 319, in _format_tweet
    self._check_if_protected()
  File "bot/site-packages/tweety/types/twDataTypes.py", line 305, in _check_if_protected
    if is_protected and is_protected.get('reason') == "Protected":
                        ^^^^^^^^^^^^^^^^
AttributeError: 'bool' object has no attribute 'get'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions