Bug 772121

Summary: Exception raised if wrong value passed to some options such as '-o' when running rst2{html,odt,...}
Product: [Fedora] Fedora Reporter: Satoru SATOH <ssato>
Component: python-docutilsAssignee: Toshio Ernie Kuratomi <a.badger>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: a.badger
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-docutils-0.8.1-1.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-23 21:53:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
The patch fixes "NameError: global name 'ErrorString' is not defined" in python-docutils none

Description Satoru SATOH 2012-01-06 04:17:39 UTC
Created attachment 551072 [details]
The patch fixes "NameError: global name 'ErrorString' is not defined" in python-docutils

Description of problem:
/usr/lib/python2.7/site-packages/docutils/frontend.py in python-docutils
refer ErrorString() defined in docutils.error_reporting but not imported it.

This causes rst2* not worked in some specific situations such if wrong
values passed to options.

Here is a sample session log:

ssato@localhost% rst2odt foo.rst -o foo.odt
Traceback (most recent call last):
  File "/usr/bin/rst2odt", line 29, in <module>
    description=description)
  File "/usr/lib/python2.7/site-packages/docutils/core.py", line 538, in publish_cmdline_to_binary
    config_section=config_section, enable_exit_status=enable_exit_status)
  File "/usr/lib/python2.7/site-packages/docutils/core.py", line 208, in publish
    **(settings_overrides or {}))
  File "/usr/lib/python2.7/site-packages/docutils/core.py", line 162, in process_command_line
    self.settings = option_parser.parse_args(argv)
  File "/usr/lib64/python2.7/optparse.py", line 1399, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib64/python2.7/optparse.py", line 1443, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib64/python2.7/optparse.py", line 1550, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/lib/python2.7/site-packages/docutils/frontend.py", line 280, in process
    % (opt, ErrorString(error))),
NameError: global name 'ErrorString' is not defined
ssato@localhost% rpm -q python-docutils
python-docutils-0.8-2.fc16.noarch
ssato@localhost%


Version-Release number of selected component (if applicable): 0.8-2


How reproducible: always in some specific situations.

Steps to Reproduce:
run 'rst2xyz /dev/null -o dummy_wrong_opt_val'
  where xyz = html | odt | ...


Actual results: 
Exception raised.

Expected results:
just help or usage or some messages are out.


Additional info: The fix for this problem is trivial and
looks applied in upstream svn head.

I'll attach the patch also just in case.

Comment 1 Fedora Update System 2012-01-06 05:53:03 UTC
python-docutils-0.8.1-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/python-docutils-0.8.1-1.fc16

Comment 2 Fedora Update System 2012-01-06 05:53:11 UTC
python-docutils-0.8.1-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/python-docutils-0.8.1-1.fc15

Comment 3 Toshio Ernie Kuratomi 2012-01-06 05:54:39 UTC
Thanks for the report and patch!  Please test the update.  And report if it working in bodhi.  Thanks!

Comment 4 Satoru SATOH 2012-01-06 06:20:41 UTC
Thanks a lot for your quick response!

I confirmed the problem was fixed by the newer updated rpm,
0.8.1-1.fc16 gotten from koji directly.

Comment 5 Fedora Update System 2012-01-07 22:54:12 UTC
Package python-docutils-0.8.1-1.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-docutils-0.8.1-1.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-0155/python-docutils-0.8.1-1.fc15
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-01-23 21:53:24 UTC
python-docutils-0.8.1-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2012-01-23 22:06:23 UTC
python-docutils-0.8.1-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.