Bug 997575 - [pylint] E:685,56:_convert_to_outputformat: Undefined variable 'opt'
Summary: [pylint] E:685,56:_convert_to_outputformat: Undefined variable 'opt'
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: python-bugzilla
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Will Woods
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-15 16:13 UTC by Steve Tyler
Modified: 2013-08-15 17:32 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-15 17:17:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Steve Tyler 2013-08-15 16:13:31 UTC
Description of problem:
pylint reports several errors. This one is a definite positive:
E:685,56:_convert_to_outputformat: Undefined variable 'opt'

$ pylint -E /usr/bin/bugzilla
No config file found, using default configuration
************* Module bugzilla
E: 83,47:setup_parser: Module 'bugzilla' has no '__version__' member
E: 92,50:setup_parser: Module 'bugzilla' has no 'classlist' member
E:435,16:generate_man_page: Module 'bugzilla' has no '__version__' member
E:685,56:_convert_to_outputformat: Undefined variable 'opt'
E:1019,18:main: Module 'bugzilla' has no 'Bugzilla' member
E:1020,30:main: Module 'bugzilla' has no 'classlist' member
E:1024,55:main: Module 'bugzilla' has no 'classlist' member

Version-Release number of selected component (if applicable):
python-bugzilla-0.9.0-1.fc19.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Steve Tyler 2013-08-15 16:17:11 UTC
In line 685, "opt.output" should be "output":

$ less -N /usr/bin/bugzilla 
...
    657 def _convert_to_outputformat(output):
    658     fmt = ""
    659 
    660     if output == "normal":
...
    684     else:
    685         raise RuntimeError("Unknown output type '%s'" % opt.output)
    686 
    687     return fmt
...

Comment 2 Cole Robinson 2013-08-15 16:26:10 UTC
Huh, I wonder why our upstream pylint infrastructure didn't catch this? Thanks for noticing

Comment 3 Cole Robinson 2013-08-15 17:17:45 UTC
Fixed upstream now:

https://git.fedorahosted.org/cgit/python-bugzilla.git/commit/?id=c9b2b06ec0bce9a41109193fa3b50a3130910434

Given that the code path can't be hit in practice (it's to prevent against future coding errors), just closing as UPSTREAM since it isn't worth a backport.

Comment 4 Steve Tyler 2013-08-15 17:32:06 UTC
Thanks. That's way more than I would have known to do ... :-)


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