Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 588888 - dev-python/libzilla-1.2: bug lookup crashes on bad alias lookup or bug ID
Summary: dev-python/libzilla-1.2: bug lookup crashes on bad alias lookup or bug ID
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrice Clement
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-15 14:28 UTC by nvinson234
Modified: 2016-07-15 23:26 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nvinson234 2016-07-15 14:28:48 UTC
If you give libzilla a bad bug alias it crashes due to an uncaught libzilla.exceptions.LibZillaException.  The same also happens with a bad bug ID.

$ lzilla bug shell
[2016-07-15 06:56:40,647][libzilla.configmanager][INFO]: File "/home/nvinson/.libzillarc" found!
[2016-07-15 06:56:40,648][libzilla.validator][INFO]: Validated URL: https://bugs.gentoo.org/rest
[2016-07-15 06:56:40,648][libzilla.connection][INFO]: Logging in ...
[2016-07-15 06:56:40,651][requests.packages.urllib3.connectionpool][INFO]: Starting new HTTPS connection (1): bugs.gentoo.org
[2016-07-15 06:56:41,978][libzilla.connection][INFO]: Logged in!
[2016-07-15 06:56:41,978][libzilla.connection][INFO]: Querying Bugzilla for bug #shell ...
[2016-07-15 06:56:41,978][requests.packages.urllib3.connectionpool][INFO]: Starting new HTTPS connection (1): bugs.gentoo.org
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/lzilla", line 9, in <module>
    load_entry_point('libzilla==1.0', 'console_scripts', 'lzilla')()
  File "/usr/lib64/python3.4/site-packages/libzilla/__main__.py", line 6, in main
    libzilla.basecommand.BaseCommand()
  File "/usr/lib64/python3.4/site-packages/libzilla/basecommand.py", line 43, in __init__
    runner[args['<command>']]()
  File "/usr/lib64/python3.4/site-packages/libzilla/basecommand.py", line 50, in run_bug_command
    BugCommand(docopt(BugCommand.__doc__))
  File "/usr/lib64/python3.4/site-packages/libzilla/cli/bug.py", line 31, in __init__
    session.process_bug_numbers()
  File "/usr/lib64/python3.4/site-packages/libzilla/session.py", line 110, in process_bug_numbers
    self.get_bug_info(bug_number)
  File "/usr/lib64/python3.4/site-packages/libzilla/session.py", line 50, in get_bug_info
    return self.conn.get_bug_info(bug_number)
  File "/usr/lib64/python3.4/site-packages/libzilla/connection.py", line 79, in get_bug_info
    response = self.send_request('GET', url)
  File "/usr/lib64/python3.4/site-packages/libzilla/connection.py", line 52, in send_request
    raise LibZillaException(response.reason)
libzilla.exceptions.LibZillaException: Bad Request
Comment 1 Patrice Clement gentoo-dev 2016-07-15 23:26:39 UTC
commit ab702b6aef935603459e76384ba71f20d2872be6 (HEAD -> master, origin/master)
Author:     Patrice Clement <monsieurp@gentoo.org>
AuthorDate: Sat Jul 16 01:13:36 2016 +0200
Commit:     Patrice Clement <monsieurp@gentoo.org>
CommitDate: Sat Jul 16 01:13:36 2016 +0200

Rework how exceptions are thrown.

Basically, I got rid of the LibzillaException class since it turns out to be
useless and replaced it with a warning followed by a program exit afterwards
(exit(1)).

I still don't like some bits especially the design of session.py which is awful
imo but we'll make do for the time being.

Gentoo-Bug: https://bugs.gentoo.org/588888
Gentoo-Bug: https://bugs.gentoo.org/588886

libzilla/connection.py  | 96 ++++++++++++++++++++++++++++++-------------------
libzilla/exceptions.py  |  3 --
libzilla/promptmaker.py |  2 +-
libzilla/session.py     |  5 ---
libzilla/validator.py   |  5 +--
5 files changed, 63 insertions(+), 48 deletions(-)
delete mode 100644 libzilla/exceptions.py