Bug 772121 - Exception raised if wrong value passed to some options such as '-o' when running rst2{html,odt,...}
Summary: Exception raised if wrong value passed to some options such as '-o' when runn...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-docutils
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Toshio Ernie Kuratomi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-06 04:17 UTC by Satoru SATOH
Modified: 2012-01-23 22:06 UTC (History)
1 user (show)

Fixed In Version: python-docutils-0.8.1-1.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-23 21:53:24 UTC
Type: ---


Attachments (Terms of Use)
The patch fixes "NameError: global name 'ErrorString' is not defined" in python-docutils (490 bytes, patch)
2012-01-06 04:17 UTC, Satoru SATOH
no flags Details | Diff

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.


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