Bug 997575

Summary: [pylint] E:685,56:_convert_to_outputformat: Undefined variable 'opt'
Product: [Fedora] Fedora Reporter: Steve Tyler <stephent98>
Component: python-bugzillaAssignee: Will Woods <wwoods>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: bugs.michael, crobinso, dzickus, jskarvad, stephent98, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-15 17:17:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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 ... :-)