Bug 884343 - --help-commands broken in koji client
Summary: --help-commands broken in koji client
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: koji
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dennis Gilmore
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-06 01:20 UTC by T.C. Hollingsworth
Modified: 2012-12-10 17:05 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-12-10 17:05:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
add some debug statements to koji (660 bytes, patch)
2012-12-06 23:53 UTC, Mike McLean
no flags Details | Diff

Description T.C. Hollingsworth 2012-12-06 01:20:34 UTC
% rpm -q koji
koji-1.7.0-2.fc17.noarch
% koji --help-commands
Available commands:
Traceback (most recent call last):
  File "/usr/bin/koji", line 5793, in <module>
    options, command, args = get_options()
  File "/usr/bin/koji", line 149, in get_options
    list_commands()
  File "/usr/bin/koji", line 5732, in list_commands
    if desc.startswith('[admin] '):
AttributeError: 'NoneType' object has no attribute 'startswith'

Comment 1 Mike McLean 2012-12-06 19:26:01 UTC
I cannot replicate this. Can you verify your installation? (rpm -V koji)

Comment 2 Michael Schwendt 2012-12-06 19:41:05 UTC
And if that verifies fine, also run "rpm -V python-libs", because of

        desc = handler.__doc__
        if desc.startswith('[admin] '):

and __doc__ may be none if there's a problem with the handler object (logging.StreamHandler).

Comment 3 Michael Schwendt 2012-12-06 19:53:36 UTC
Oops, sorry, ignore previous comment. I've grepped it incorrectly. handler is within koji:

|def list_commands(show_admin=False):
|    handlers = []
|    for name,value in globals().items():
|        if name.startswith('handle_'):
|            alias = name.replace('handle_','')
|            alias = alias.replace('_','-')
|            handlers.append((alias,value))
|        elif name.startswith('anon_handle_'):
|            alias = name.replace('anon_handle_','')
|            alias = alias.replace('_','-')
|            handlers.append((alias,value))
|    handlers.sort()
|    print _("Available commands:")
|    for alias,handler in handlers:
|        desc = handler.__doc__
|        if desc.startswith('[admin] '):
| ...

Comment 4 Mike McLean 2012-12-06 23:53:58 UTC
Created attachment 659106 [details]
add some debug statements to koji

All the handlers in koji have docstrings. I'm lost as to how this can fail on your system but not in my f17 test env.

Can you do the following?
# cp /usr/bin/koji /tmp
# patch /tmp/koji <koji-debug.patch   #attached
# /tmp/koji list-commands

Also, what version of python are you running?

Comment 5 T.C. Hollingsworth 2012-12-08 11:16:38 UTC
Oh, it's because the OLPC folks set $PYTHONOPTIMIZE=2 by default, which strips out docstrings.

This is probably WONTFIX, then. Sorry for the noise.

Comment 6 Mike McLean 2012-12-10 17:05:43 UTC
Ah, ok then.


Note You need to log in before you can comment on or make changes to this bug.