[ros-users] rosmake Exception when usage is displayed

William Woodall wjwwood at gmail.com
Thu Sep 9 01:34:09 UTC 2010


I have noticed that when using rosmake if you enter anything that exits
through optparse ( rosmake --help for example ) then you get an undesired
traceback.  I looked at the way it is being used and I cannot figure why the
traceback is being generated.  transcript:

$ rosmake --asdf
Usage: rosmake [options] [PACKAGE]...

rosmake: error: no such option: --asdf
Traceback (most recent call last):
  File "/opt/ros/cturtle/ros/bin/rosmake", line 65, in <module>
    if rma.main():
  File "/opt/ros/cturtle/ros/tools/rosmake/src/rosmake/rosmake.py", line
706, in main
    options, args = parser.parse_args()
  File "/usr/lib/python2.6/optparse.py", line 1396, in parse_args
    self.error(str(err))
  File "/usr/lib/python2.6/optparse.py", line 1578, in error
    self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg))
  File "/usr/lib/python2.6/optparse.py", line 1568, in exit
    sys.exit(status)
SystemExit: 2

OR

$ rosmake --help
Usage: rosmake [options] [PACKAGE]...

Options:
  -h, --help            show this help message and exit
...
  --status-rate=STATUS_UPDATE_RATE
                        How fast to update the status bar in Hz.  Default:
5Hz
Traceback (most recent call last):
  File "/opt/ros/cturtle/ros/bin/rosmake", line 65, in <module>
    if rma.main():
  File "/opt/ros/cturtle/ros/tools/rosmake/src/rosmake/rosmake.py", line
706, in main
    options, args = parser.parse_args()
  File "/usr/lib/python2.6/optparse.py", line 1394, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.6/optparse.py", line 1434, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python2.6/optparse.py", line 1509, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python2.6/optparse.py", line 788, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.6/optparse.py", line 811, in take_action
    parser.exit()
  File "/usr/lib/python2.6/optparse.py", line 1568, in exit
    sys.exit(status)
SystemExit: 0

The common case is that optparse.py is used to exit the script rather then
letting the rosmake script finish normally.

My setup:
Linux sakaru 2.6.32-24-generic #42-Ubuntu SMP Fri Aug 20 14:21:58 UTC 2010
x86_64 GNU/Linux
Desktop running Ubuntu Lucid Lynx 10.04
CTurtle binary 1.2.x

Steps to reproduce:
1. execute any rosmake with a passive execution, ie 'rosmake --help' or
'rosmake --asdffj'
2. Expect rosmake to perform normally except for a cosmetic traceback on the
sys.exit(status)

Thanks,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
William Woodall
Graduate Software Engineering
Auburn University
w at auburn.edu
wjwwood at gmail.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100908/693c8aab/attachment-0002.html>


More information about the ros-users mailing list