internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: ros/ros_comm

Issue:
Multiple core using 127.* address can't run
Ros should not handle 127.0.0.0/255.0.0.0 as a unique ip: 127.0.0.1. It makes sence on specific environment to bind on 127.1.2.3 and not on 127.0.0.1 like in openshift gears.

It looks like this might be because adress starting with 127. are converted to 127.0.0.1



Discussion:
+1
One bad hack is located here:
https://github.com/ros/ros_comm/blob/d6b62d35d827cb2e5e5c22c5449f04603f3c1766/tools/rosgraph/src/rosgraph/network.py#L253


Resolving patch:
diff --git a/tools/rosgraph/src/rosgraph/network.py b/tools/rosgraph/src/rosgraph/network.py
--- a/tools/rosgraph/src/rosgraph/network.py
+++ b/tools/rosgraph/src/rosgraph/network.py
@@ -254,6 +254,8 @@ def get_bind_address(address=None):
         #localhost or 127/8
         if use_ipv6():
             return '::1'
+        elif address.startswith('127.'):
+            return address
         else:
             return '127.0.0.1' #loopback
     else:


Test patch:
Repository: ros/ros_comm

Issue:
Wrong time when exporting to csv with rostopic echo -p
The field "time" (of the input from rostopic -p) should contain the time when the message was received, not the timestamp of the message as it is already in the csv-file.



Discussion:

Resolving patch:
diff --git a/tools/rostopic/src/rostopic/__init__.py b/tools/rostopic/src/rostopic/__init__.py
--- a/tools/rostopic/src/rostopic/__init__.py
+++ b/tools/rostopic/src/rostopic/__init__.py
@@ -426,10 +426,11 @@ def _str_plot(val, time_offset=None, current_time=None, field_filter=None, type_
         time_offset = time_offset.to_nsec()
     else:
         time_offset = 0            
-    if getattr(val, "_has_header", False):
-        return "%s,%s"%(val.header.stamp.to_nsec()-time_offset, s)
-    elif current_time is not None:
+        
+    if current_time is not None:
         return "%s,%s"%(current_time.to_nsec()-time_offset, s)
+    elif getattr(val, "_has_header", False):
+        return "%s,%s"%(val.header.stamp.to_nsec()-time_offset, s)
     else:
         return "%s,%s"%(rospy.get_rostime().to_nsec()-time_offset, s)
     


Test patch:
Repository: ros/ros_comm

Issue:
traffic of statistics is wrong
The entry traffic in statistics seems to get calculated wrong.

**Example setup:**

```
$ rosparam set enable_statistics true
```

```
$ rostopic pub /table std_msgs/String "data: '1234' " -r 100
```

```
$ rostopic bw /table
subscribed to [/table]
average: 805.20B/s
    mean: 8.00B min: 8.00B max: 8.00B window: 99
```

```
$ rostopic echo /statistics
topic: /table
node_pub: /rostopic_3963_1411225760462
node_sub: /rostopic_4239_1411226004615
window_start: 
  secs: 1411226011
  nsecs: 883635044
window_stop: 
  secs: 1411226019
  nsecs: 886126995
delivered_msgs: 800
dropped_msgs: 0
traffic: 12
[...]
```

Whereas traffic in this example should be ~ 8\* 800Byte = **1600 Byte** but is **12 Byte**.

Changing the publish frequency does not lead in a change in traffic. 



Discussion:

Resolving patch:
diff --git a/clients/rospy/src/rospy/impl/statistics.py b/clients/rospy/src/rospy/impl/statistics.py
--- a/clients/rospy/src/rospy/impl/statistics.py
+++ b/clients/rospy/src/rospy/impl/statistics.py
@@ -175,7 +175,8 @@ def sendStatistics(self, subscriber_statistics_logger):
         msg.window_start = self.window_start
         msg.window_stop = curtime
 
-        msg.traffic = self.stat_bytes_window_
+        # Calculate bytes since last message
+        msg.traffic = self.stat_bytes_window_ - self.stat_bytes_last_
 
         msg.delivered_msgs = len(self.arrival_time_list_)
         msg.dropped_msgs = self.dropped_msgs_
@@ -218,6 +219,8 @@ def sendStatistics(self, subscriber_statistics_logger):
 
         self.window_start = curtime
 
+        self.stat_bytes_last_ = self.stat_bytes_window_
+
     def callback(self, subscriber_statistics_logger, msg, stat_bytes):
         """
         This method is called for every message, that is received on this
@@ -240,9 +243,7 @@ def callback(self, subscriber_statistics_logger, msg, stat_bytes):
 
         self.arrival_time_list_.append(arrival_time)
 
-        # Calculate how many bytes of traffic did this message need?
-        self.stat_bytes_window_ = stat_bytes - self.stat_bytes_last_
-        self.stat_bytes_last_ = stat_bytes
+        self.stat_bytes_window_ = stat_bytes
 
         # rospy has the feature to subscribe a topic with AnyMsg which aren't deserialized.
         # Those subscribers won't have a header. But as these subscribers are rather rare


Test patch:
Repository: ros/ros_comm

Issue:
roscpp: param.h closing namespace comment should be ros instead of param
This might be trivial.
While browsing this repository, I found that line 601 in file
ros_comm / clients / roscpp / include / ros / param.h
should be:
} // namespace ros
instead of 
} // namespace param



Discussion:

Resolving patch:
diff --git a/tools/rosgraph/src/rosgraph/roslogging.py b/tools/rosgraph/src/rosgraph/roslogging.py
--- a/tools/rosgraph/src/rosgraph/roslogging.py
+++ b/tools/rosgraph/src/rosgraph/roslogging.py
@@ -152,11 +152,33 @@ def __init__(self, colorize=True):
 
     def emit(self, record):
         level, color = _logging_to_rospy_names[record.levelname]
-        msg = '[%s] [WallTime: %f]' % (level, time.time())
-        if self._get_time is not None and not self._is_wallclock():
-            msg += ' [%f]' % self._get_time()
-        msg += ' %s\n' % record.getMessage()
-
+        if 'ROSCONSOLE_FORMAT' in os.environ.keys():
+            msg = os.environ['ROSCONSOLE_FORMAT']
+            msg = msg.replace('${severity}', level)
+            msg = msg.replace('${message}', str(record.getMessage()))
+            msg = msg.replace('${walltime}', '%f' % time.time())
+            msg = msg.replace('${thread}', str(record.thread))
+            msg = msg.replace('${logger}', str(record.name))
+            msg = msg.replace('${file}', str(record.pathname))
+            msg = msg.replace('${line}', str(record.lineno))
+            msg = msg.replace('${function}', str(record.funcName))
+            try:
+                from rospy import get_name
+                node_name = get_name()
+            except ImportError:
+                node_name = '<unknown_node_name>'
+            msg = msg.replace('${node}', node_name)
+            if self._get_time is not None and not self._is_wallclock():
+                t = self._get_time()
+            else:
+                t = time.time()
+            msg = msg.replace('${time}', '%f' % t)
+            msg += '\n'
+        else:
+            msg = '[%s] [WallTime: %f]' % (level, time.time())
+            if self._get_time is not None and not self._is_wallclock():
+                msg += ' [%f]' % self._get_time()
+            msg += ' %s\n' % record.getMessage()
         if record.levelno < logging.WARNING:
             self._write(sys.stdout, msg, color)
         else:


Test patch:
Repository: ros/ros_comm

Issue:
Docstring for rospy.on_shutdown() is wrong
The docstring claims that the hook should take no arguments, but in the "already shutdown" case the hook gets called with one argument.

The call is here: https://github.com/ros/ros_comm/blob/ace5b9c11af766564441bad2cb08f5fca5b73784/clients/rospy/src/rospy/core.py#L316



Discussion:
I think we can just take out the argument. It is kind of difficult to work around this otherwise.

@opqdonut I do not believe that is true. AFAIKT, those callbacks do take a string argument:
- https://github.com/ros/ros_comm/blob/ace5b9c11af766564441bad2cb08f5fca5b73784/clients/rospy/src/rospy/core.py#L360
- https://github.com/ros/ros_comm/blob/ace5b9c11af766564441bad2cb08f5fca5b73784/clients/rospy/src/rospy/core.py#L374

the docstring for on_shutdown claims otherwise, as I said in my first comment :)

https://github.com/ros/ros_comm/blob/ace5b9c11af766564441bad2cb08f5fca5b73784/clients/rospy/src/rospy/client.py#L109

Probably related to this:
- https://github.com/ros/ros_comm/commit/cdf44f3b103a951dbde25f8b6a4066a4afb40e82
- https://github.com/ros/ros_comm/issues/586


Resolving patch:
diff --git a/clients/rospy/src/rospy/core.py b/clients/rospy/src/rospy/core.py
--- a/clients/rospy/src/rospy/core.py
+++ b/clients/rospy/src/rospy/core.py
@@ -305,7 +305,7 @@ def is_shutdown_requested():
     """
     return _in_shutdown
 
-def _add_shutdown_hook(h, hooks):
+def _add_shutdown_hook(h, hooks, pass_reason_argument=True):
     """
     shared implementation of add_shutdown_hook and add_preshutdown_hook
     """
@@ -313,7 +313,10 @@ def _add_shutdown_hook(h, hooks):
         raise TypeError("shutdown hook [%s] must be a function or callable object: %s"%(h, type(h)))
     if _shutdown_flag:
         _logger.warn("add_shutdown_hook called after shutdown")
-        h("already shutdown")
+        if pass_reason_argument:
+            h("already shutdown")
+        else:
+            h()
         return
     with _shutdown_lock:
         if hooks is None:
@@ -349,7 +352,7 @@ def add_client_shutdown_hook(h):
     @param h: function with zero args
     @type  h: fn()
     """
-    _add_shutdown_hook(h, _client_shutdown_hooks)
+    _add_shutdown_hook(h, _client_shutdown_hooks, pass_reason_argument=False)
 
 def add_preshutdown_hook(h):
     """


Test patch:
Repository: ros/ros_comm

Issue:
unregister() method to message_filter.Subscriber on python
Do you have plan to implement this?
Or there is other way to achieve this?



Discussion:
There is no plan for feature development in this repository (see the status in the rosdistro: https://github.com/ros/rosdistro/blob/00524f6409253449fdba6ee595236cd85f476ab3/jade/distribution.yaml#L3128).

Since the `rospy.Subscriber` is accessible as a member variable `sub` have you tried to call its `unregister()` method?

Yeah, that works. But `message_filters.Subscriber.unregister()` is more natural, isn't it?
message_filter for cpp has that method.

So it's just `message_filters.sub.unregister()` versus `message_filters.Subscriber.unregister()`? If you propose a pull request with what you think is a better API, then we'll consider it, but changes to the public API will likely be delayed until Kinetic.


Resolving patch:
diff --git a/utilities/message_filters/src/message_filters/__init__.py b/utilities/message_filters/src/message_filters/__init__.py
--- a/utilities/message_filters/src/message_filters/__init__.py
+++ b/utilities/message_filters/src/message_filters/__init__.py
@@ -76,6 +76,9 @@ def callback(self, msg):
     def getTopic(self):
         return self.topic
 
+    def unregister(self):
+        self.sub.unregister()
+
 class Cache(SimpleFilter):
 
     """


Test patch:
Repository: ros/ros_comm

Issue:
rosmsg show has no error when message are not found
Observed behavior:

```
$ rosmsg show Quux
$
```

Expected behavior: some kind of error message indicating that the message was not found.

For example:

```
$ rosmsg show Quux
Error: message 'Quux' not found in any package.
ROS_PACKAGE_PATH=...
```

rosmsg show has no error when message are not found
Observed behavior:

```
$ rosmsg show Quux
$
```

Expected behavior: some kind of error message indicating that the message was not found.

For example:

```
$ rosmsg show Quux
Error: message 'Quux' not found in any package.
ROS_PACKAGE_PATH=...
```



Discussion:
Please consider providing a PR to improve `rosmsg show` to print an error message as well as return a non-zero return code.

I'm not sure I'll have time to submit a PR for this.

I filed it because it showed up on ROS answers, and having no error output is poor user experience: http://answers.ros.org/question/219648/

Please consider providing a PR to improve `rosmsg show` to print an error message as well as return a non-zero return code.

I'm not sure I'll have time to submit a PR for this.

I filed it because it showed up on ROS answers, and having no error output is poor user experience: http://answers.ros.org/question/219648/


Resolving patch:
diff --git a/tools/rosmsg/src/rosmsg/__init__.py b/tools/rosmsg/src/rosmsg/__init__.py
--- a/tools/rosmsg/src/rosmsg/__init__.py
+++ b/tools/rosmsg/src/rosmsg/__init__.py
@@ -610,7 +610,11 @@ def rosmsg_cmd_show(mode, full):
         if '/' in arg: #package specified
             rosmsg_debug(rospack, mode, arg, options.raw)
         else:
-            for found in rosmsg_search(rospack, mode, arg):
+            found_msgs = list(rosmsg_search(rospack, mode, arg))
+            if not found_msgs:
+                print("Could not find msg '%s'" % arg, file=sys.stderr)
+                return 1
+            for found in found_msgs:
                 print("[%s]:"%found)
                 rosmsg_debug(rospack, mode, found, options.raw)
 
@@ -738,7 +742,7 @@ def rosmsgmain(mode=MODE_MSG):
 
         command = sys.argv[1]
         if command == 'show':
-            rosmsg_cmd_show(ext, full)
+            sys.exit(rosmsg_cmd_show(ext, full))
         elif command == 'package':
             rosmsg_cmd_package(ext, full)
         elif command == 'packages':


Test patch:
Repository: ros/ros_comm

Issue:
rostopic echo -p no longer works
There seems to be a new bug with rostopic echo, when printing in the csv format.

It looks like the call at https://github.com/ros/ros_comm/blob/kinetic-devel/tools/rostopic/src/rostopic/__init__.py#L936 expects value_transform as the parameter name. Meanwhile, the function defined at https://github.com/ros/ros_comm/blob/kinetic-devel/tools/rostopic/src/rostopic/__init__.py#L725 takes value_transform_fn as a parameter. Changing either seems to work as long as they're consistent, but I'm not sure which is better to change.



Discussion:
Is this related to https://github.com/ros/ros_comm/pull/909?

I don't think so. This error is specific to printing in the CSV format. Printing normally works fine.

It looks related to this commit: https://github.com/ros/ros_comm/commit/e0f63978fe0dd239ba8002a7e79756cdf1a335d0

@wkentaro can you please check if this is a regression and if yes work on a fix?

@geoffviola Could you give me commands how to reproduce the error?

### Window 1
1. source /opt/ros/kinetic/setup.bash
2. roscore

---

### Window 2
1. source /opt/ros/kinetic/setup.bash
2. rosrun roscpp_tutorials talker

---

### Window 3
1. source /opt/ros/kinetic/setup.bash
2. rostopic echo /chatter -p


Resolving patch:
diff --git a/tools/rostopic/src/rostopic/__init__.py b/tools/rostopic/src/rostopic/__init__.py
--- a/tools/rostopic/src/rostopic/__init__.py
+++ b/tools/rostopic/src/rostopic/__init__.py
@@ -722,7 +722,7 @@ def _sub_str_plot_fields(val, f, field_filter):
     return None
 
 
-def _str_plot(val, time_offset=None, current_time=None, field_filter=None, type_information=None, fixed_numeric_width=None, value_transform_fn=None):
+def _str_plot(val, time_offset=None, current_time=None, field_filter=None, type_information=None, fixed_numeric_width=None, value_transform=None):
     """
     Convert value to matlab/octave-friendly CSV string representation.
 
@@ -730,7 +730,7 @@ def _str_plot(val, time_offset=None, current_time=None, field_filter=None, type_
     :param current_time: current :class:`genpy.Time` to use if message does not contain its own timestamp.
     :param time_offset: (optional) for time printed for message, print as offset against this :class:`genpy.Time`
     :param field_filter: filter the fields that are stringified for Messages, ``fn(Message)->iter(str)``
-    :param value_transform_fn: Not used but for same API as CallbackEcho.custom_strify_message
+    :param value_transform: Not used but for same API as CallbackEcho.custom_strify_message
     :returns: comma-separated list of field values in val, ``str``
     """
         


Test patch:
Repository: ros/ros_comm

Issue:
rosmsg: Error when showing message from a bag file
I am trying to show a custom message from a bag file by calling `rosmsg show -b my.bag msg_here`, which fails with the following error message:

```
Traceback (most recent call last):
  File "xxxx/ros_catkin_ws/install_isolated/bin/rosmsg", line 35, in <module>
    rosmsg.rosmsgmain()
  File "xxxx/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rosmsg/__init__.py", line 747, in rosmsgmain
    sys.exit(rosmsg_cmd_show(ext, full, command))
  File "xxxx/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rosmsg/__init__.py", line 607, in rosmsg_cmd_show
    print(get_msg_text(datatype, options.raw, pytype._full_text))
  File "xxxx/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rosmsg/__init__.py", line 425, in get_msg_text
    for p in rospack.list():
AttributeError: 'str' object has no attribute 'list'
```

Looking at the source code, it seems that the [message's full text](https://github.com/ros/ros_comm/blob/kinetic-devel/tools/rosmsg/src/rosmsg/__init__.py#L606) (as a string) is being passed to a [method that expects a rospack object](https://github.com/ros/ros_comm/blob/kinetic-devel/tools/rosmsg/src/rosmsg/__init__.py#L414).


Discussion:

Resolving patch:
diff --git a/tools/rosmsg/src/rosmsg/__init__.py b/tools/rosmsg/src/rosmsg/__init__.py
--- a/tools/rosmsg/src/rosmsg/__init__.py
+++ b/tools/rosmsg/src/rosmsg/__init__.py
@@ -48,6 +48,7 @@
 
 import rospkg
 import genmsg
+from genpy.dynamic import generate_dynamic
 
 import roslib.message
 import rosbag
@@ -603,7 +604,14 @@ def rosmsg_cmd_show(mode, full, alias='show'):
         for topic, msg, t in rosbag.Bag(bag_file).read_messages(raw=True):
             datatype, _, _, _, pytype = msg
             if datatype == arg:
-                print(get_msg_text(datatype, options.raw, pytype._full_text))
+                if options.raw:
+                    print(pytype._full_text)
+                else:
+                    context = genmsg.MsgContext.create_default()
+                    msgs = generate_dynamic(datatype, pytype._full_text)
+                    for t, msg in msgs.items():
+                        context.register(t, msg._spec)
+                    print(spec_to_str(context, msgs[datatype]._spec))
                 break
     else:
         rospack = rospkg.RosPack()


Test patch:
Repository: ros/ros_comm

Issue:
rostopic ignores 64-bit values when printing in plotting friendly format
When running the attached launch file you can see that the 64-bit value isn't printed.
[rostopic64bit.zip](https://github.com/ros/ros_comm/files/1139573/rostopic64bit.zip)



Discussion:

Resolving patch:
diff --git a/tools/rostopic/src/rostopic/__init__.py b/tools/rostopic/src/rostopic/__init__.py
--- a/tools/rostopic/src/rostopic/__init__.py
+++ b/tools/rostopic/src/rostopic/__init__.py
@@ -64,6 +64,12 @@
 #TODO: lazy-import rospy or move rospy-dependent routines to separate location
 import rospy
 
+try:
+    long
+except NameError:
+    long = int
+
+
 class ROSTopicException(Exception):
     """
     Base exception class of rostopic-related errors
@@ -687,7 +693,7 @@ def _sub_str_plot_fields(val, f, field_filter):
     """recursive helper function for _str_plot_fields"""
     # CSV
     type_ = type(val)
-    if type_ in (bool, int, float) or \
+    if type_ in (bool, int, long, float) or \
            isinstance(val, genpy.TVal):
         return f
     # duck-type check for messages
@@ -708,7 +714,7 @@ def _sub_str_plot_fields(val, f, field_filter):
         val0 = val[0]
         type0 = type(val0)
         # no arrays of arrays
-        if type0 in (bool, int, float) or \
+        if type0 in (bool, int, long, float) or \
                isinstance(val0, genpy.TVal):
             return ','.join(["%s%s"%(f,x) for x in range(0,len(val))])
         elif _isstring_type(type0):
@@ -757,7 +763,7 @@ def _sub_str_plot(val, time_offset, field_filter):
     
     if type_ == bool:
         return '1' if val else '0'
-    elif type_ in (int, float) or \
+    elif type_ in (int, long, float) or \
            isinstance(val, genpy.TVal):
         if time_offset is not None and isinstance(val, genpy.Time):
             return str(val-time_offset)
@@ -783,7 +789,7 @@ def _sub_str_plot(val, time_offset, field_filter):
         type0 = type(val0)
         if type0 == bool:
             return ','.join([('1' if v else '0') for v in val])
-        elif type0 in (int, float) or \
+        elif type0 in (int, long, float) or \
                isinstance(val0, genpy.TVal):
             return ','.join([str(v) for v in val])
         elif _isstring_type(type0):


Test patch:
Repository: ros/ros_comm

Issue:
Inconsistent exit codes of tools in error cases
I just noticed that the console tools (`rosnode`, `rostopic`, ...) are inconsistent in their return code in case of errors.

The case I tested was running them without a running roscore (using kinetic):
* `rostopic list` --> exit code 1
* `rosservice list` --> exit code 2
* `rosnode list` --> exit code 0
* `rosparam list` --> exit code 1

Especially the exit code of `rosnode` is problematic if you expect to get an error code like with the other tools.


Discussion:
All tools should indeed return a non-zero exit code in case of errors. Some have specific codes to indicate the exact error though.

Please consider providing a pull request to fix the error code of `rosnode list`.
Alright, I will try to find some time for it in the next days.

Resolving patch:
diff --git a/tools/rosnode/src/rosnode/__init__.py b/tools/rosnode/src/rosnode/__init__.py
--- a/tools/rosnode/src/rosnode/__init__.py
+++ b/tools/rosnode/src/rosnode/__init__.py
@@ -808,9 +808,12 @@ def rosnodemain(argv=None):
             _fullusage()
     except socket.error:
         print("Network communication failed. Most likely failed to communicate with master.", file=sys.stderr)
+        sys.exit(1)
     except rosgraph.MasterError as e:
         print("ERROR: "+str(e), file=sys.stderr)
+        sys.exit(1)
     except ROSNodeException as e:
         print("ERROR: "+str(e), file=sys.stderr)
+        sys.exit(1)
     except KeyboardInterrupt:
         pass


Test patch:
Repository: ros/ros_comm

Issue:
`rosbag info` doesn't return error code
```
phil@host:~$ rosbag info test.bag.active
ERROR bag unindexed: test.bag.active.  Run rosbag reindex.
phil@host:~$ echo $?
0
```

boo


Discussion:

Resolving patch:
diff --git a/tools/rosbag/src/rosbag/rosbag_main.py b/tools/rosbag/src/rosbag/rosbag_main.py
--- a/tools/rosbag/src/rosbag/rosbag_main.py
+++ b/tools/rosbag/src/rosbag/rosbag_main.py
@@ -170,10 +170,13 @@ def info_cmd(argv):
         except ROSBagUnindexedException as ex:
             print('ERROR bag unindexed: %s.  Run rosbag reindex.' % arg,
                   file=sys.stderr)
+            sys.exit(1)
         except ROSBagException as ex:
             print('ERROR reading %s: %s' % (arg, str(ex)), file=sys.stderr)
+            sys.exit(1)
         except IOError as ex:
             print('ERROR reading %s: %s' % (arg, str(ex)), file=sys.stderr)
+            sys.exit(1)
 
 
 def handle_topics(option, opt_str, value, parser):
@@ -334,7 +337,7 @@ def eval_fn(topic, m, t):
         inbag = Bag(inbag_filename)
     except ROSBagUnindexedException as ex:
         print('ERROR bag unindexed: %s.  Run rosbag reindex.' % inbag_filename, file=sys.stderr)
-        return
+        sys.exit(1)
 
     try:
         meter = ProgressMeter(outbag_filename, inbag._uncompressed_size)
@@ -432,7 +435,7 @@ def fix_cmd(argv):
     except ROSBagUnindexedException as ex:
         print('ERROR bag unindexed: %s.  Run rosbag reindex.' % inbag_filename,
               file=sys.stderr)
-        return
+        sys.exit(1)
 
     if len(migrations) == 0:
         os.rename(outname, outbag_filename)
@@ -449,6 +452,7 @@ def fix_cmd(argv):
                     
         print('Try running \'rosbag check\' to create the necessary rule files or run \'rosbag fix\' with the \'--force\' option.')
         os.remove(outname)
+        sys.exit(1)
 
 def check_cmd(argv):
     parser = optparse.OptionParser(usage='rosbag check BAG [-g RULEFILE] [EXTRARULES1 EXTRARULES2 ...]', description='Determine whether a bag is playable in the current system, or if it can be migrated.')
@@ -478,7 +482,7 @@ def check_cmd(argv):
         Bag(args[0])
     except ROSBagUnindexedException as ex:
         print('ERROR bag unindexed: %s.  Run rosbag reindex.' % args[0], file=sys.stderr)
-        return
+        sys.exit(1)
 
     mm = MessageMigrator(args[1:] + append_rule, not options.noplugins)
 


Test patch: