whois stack trace KeyError: 'verified_at'

Bug #2009636 reported by themusicgod1
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
toot (Ubuntu)
New
Undecided
Unassigned

Bug Description

some users, when you use 'whois' result in their profile (this is expected) and then an error stack trace(this is something wrong)

example:

z@michelson:~$ toot whois @<email address hidden>

@<email address hidden> acile :archlinux:

Nur dabei statt mittendrin! #nieauftwitter

Ghost in the shell #zsh #tmux #vim
Works on desktop :archlinux: server :debian:
Works with #hpc #python #rust #foss
Loves #hardrock #classic

ID: AQI3jHT9wURADb3tMu
Since: 2022-12-05

Followers: 0
Following: 0
Statuses: 2

Web:
https://t6l.de
Traceback (most recent call last):
  File "/usr/bin/toot", line 33, in <module>
    sys.exit(load_entry_point('toot==0.34.1', 'console_scripts', 'toot')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/toot/console.py", line 694, in main
    run_command(app, user, command_name, args)
  File "/usr/lib/python3/dist-packages/toot/console.py", line 675, in run_command
    return fn(app, user, parsed_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/toot/commands.py", line 378, in whois
    print_account(account)
  File "/usr/lib/python3/dist-packages/toot/output.py", line 186, in print_account
    if field["verified_at"]:
       ~~~~~^^^^^^^^^^^^^^^
KeyError: 'verified_at'

ProblemType: Bug
DistroRelease: Ubuntu 23.04
Package: toot 0.34.1-1
Uname: Linux 6.0.7-gnulibre x86_64
ApportVersion: 2.26.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Tue Mar 7 22:57:37 2023
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: toot
UpgradeStatus: Upgraded to lunar on 2023-02-27 (8 days ago)

Revision history for this message
themusicgod1 (themusicgod1) wrote :
Revision history for this message
themusicgod1 (themusicgod1) wrote :

this should do :

in toot/output.py:

def print_account(account):
...
    if account["fields"]:
        for field in account["fields"]:
            name = field["name"].title()
            print_out(f'\n<yellow>{name}</yellow>:')
            print_html(field["value"])
            try:
               if field["verified_at"]:
                   print_out("<green>✓ Verified</green>")
            except KeyError as e:
                print_out("<red>not verified: verified_at missing</red>")

    print_out("")
    print_out(account["url"])

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.