summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-ros/rosgraph')
-rw-r--r--dev-ros/rosgraph/files/py3-2.patch52
-rw-r--r--dev-ros/rosgraph/files/py3.patch47
-rw-r--r--dev-ros/rosgraph/files/yaml.patch53
-rw-r--r--dev-ros/rosgraph/rosgraph-1.14.3-r1.ebuild (renamed from dev-ros/rosgraph/rosgraph-1.14.3.ebuild)1
4 files changed, 153 insertions, 0 deletions
diff --git a/dev-ros/rosgraph/files/py3-2.patch b/dev-ros/rosgraph/files/py3-2.patch
new file mode 100644
index 000000000000..b83b349576bd
--- /dev/null
+++ b/dev-ros/rosgraph/files/py3-2.patch
@@ -0,0 +1,52 @@
+From 1933acfa8107a164ec825d3223d14589fefd1b5b Mon Sep 17 00:00:00 2001
+From: Dirk Thomas <dirk-thomas@users.noreply.github.com>
+Date: Tue, 6 Aug 2019 16:06:51 -0700
+Subject: [PATCH] more Python 3 compatibility (#1783)
+
+---
+ test/test_rospy/test/unit/test_genmsg_py.py | 6 +--
+ tools/rosgraph/src/rosgraph/roslogging.py | 2 +-
+ .../test/test_roslogging_user_logger.py | 8 +++-
+ tools/roslaunch/test/unit/test_xmlloader.py | 2 +-
+ tools/rosmsg/src/rosmsg/__init__.py | 2 +-
+ tools/rosmsg/test/test_rosmsg_command_line.py | 46 +++++++++----------
+ .../test/test_rosmsgproto_command_line.py | 20 ++++----
+ .../test_rostopic_command_line_offline.py | 44 +++++++++---------
+ 8 files changed, 67 insertions(+), 63 deletions(-)
+
+diff --git a/tools/rosgraph/src/rosgraph/roslogging.py b/tools/rosgraph/src/rosgraph/roslogging.py
+index bbf1d9f49..51c39becd 100644
+--- a/tools/rosgraph/src/rosgraph/roslogging.py
++++ b/tools/rosgraph/src/rosgraph/roslogging.py
+@@ -49,7 +49,7 @@
+ class LoggingException(Exception): pass
+
+ class RospyLogger(logging.getLoggerClass()):
+- def findCaller(self, dummy=False): # Dummy second arg to match Python3 function declaration
++ def findCaller(self, stack_info=False):
+ """
+ Find the stack frame of the caller so that we can note the source
+ file name, line number, and function name with class name if possible.
+diff --git a/tools/rosgraph/test/test_roslogging_user_logger.py b/tools/rosgraph/test/test_roslogging_user_logger.py
+index 4ac4f8291..1c3cb5df5 100644
+--- a/tools/rosgraph/test/test_roslogging_user_logger.py
++++ b/tools/rosgraph/test/test_roslogging_user_logger.py
+@@ -51,12 +51,16 @@
+
+ # set user defined custom logger
+ class UserCustomLogger(logging.Logger):
+- def findCaller(self):
++ def findCaller(self, stack_info=False):
+ """Returns static caller.
+
+ This method is being overwritten in rosgraph.roslogging.
+ """
+- return '<filename>', '<lineno>', '<func_name>'
++ if sys.version_info > (3, 2):
++ # Dummy last argument to match Python3 return type
++ return '<filename>', '<lineno>', '<func_name>', None
++ else:
++ return '<filename>', '<lineno>', '<func_name>'
+
+ def _log(self, level, msg, args, exc_info=None, extra=None):
+ """Write log with ROS_IP.
diff --git a/dev-ros/rosgraph/files/py3.patch b/dev-ros/rosgraph/files/py3.patch
new file mode 100644
index 000000000000..45798c1d618e
--- /dev/null
+++ b/dev-ros/rosgraph/files/py3.patch
@@ -0,0 +1,47 @@
+From 8f22c20e418abe4abe23e789eef517a16a50604d Mon Sep 17 00:00:00 2001
+From: Dirk Thomas <dirk-thomas@users.noreply.github.com>
+Date: Tue, 6 Aug 2019 12:50:24 -0700
+Subject: [PATCH] more Python 3 compatibility (#1782)
+
+---
+ test/test_rosmaster/test/nodes/testAllCommonFlows | 2 +-
+ test/test_rosmaster/test/nodes/testMaster | 2 +-
+ test/test_rosmaster/test/nodes/testSlave | 2 +-
+ test/test_rospy/test/unit/test_genmsg_py.py | 8 +++++++-
+ tools/rosgraph/test/test_roslogging.py | 5 ++++-
+ tools/rosgraph/test/test_roslogging_user_logger.py | 5 ++++-
+ tools/roslaunch/src/roslaunch/depends.py | 8 ++++----
+ 7 files changed, 22 insertions(+), 10 deletions(-)
+
+diff --git a/tools/rosgraph/test/test_roslogging.py b/tools/rosgraph/test/test_roslogging.py
+index f9e618f87..ca38c80e8 100644
+--- a/tools/rosgraph/test/test_roslogging.py
++++ b/tools/rosgraph/test/test_roslogging.py
+@@ -32,7 +32,10 @@
+
+ import logging
+ import os
+-from StringIO import StringIO
++try:
++ from cStringIO import StringIO
++except ImportError:
++ from io import StringIO
+ import sys
+
+ import re
+diff --git a/tools/rosgraph/test/test_roslogging_user_logger.py b/tools/rosgraph/test/test_roslogging_user_logger.py
+index 62051638a..4ac4f8291 100644
+--- a/tools/rosgraph/test/test_roslogging_user_logger.py
++++ b/tools/rosgraph/test/test_roslogging_user_logger.py
+@@ -38,7 +38,10 @@
+
+ import logging
+ import os
+-from StringIO import StringIO
++try:
++ from cStringIO import StringIO
++except ImportError:
++ from io import StringIO
+ import sys
+
+ from nose.tools import assert_regexp_matches
diff --git a/dev-ros/rosgraph/files/yaml.patch b/dev-ros/rosgraph/files/yaml.patch
new file mode 100644
index 000000000000..32ea589c8e49
--- /dev/null
+++ b/dev-ros/rosgraph/files/yaml.patch
@@ -0,0 +1,53 @@
+From 29053c4832229efa7160fb944c05e3bc82e11540 Mon Sep 17 00:00:00 2001
+From: Martijn Buijs <Martijn.buijs@gmail.com>
+Date: Tue, 23 Apr 2019 18:20:12 +0200
+Subject: [PATCH] Switch to yaml.safe_load(_all) to prevent YAMLLoadWarning
+ (#1688)
+
+* Switch to yaml.safe_load(_all) to prevent YAMLLoadWarning
+
+* Change all usages of yaml.load to yaml.safe_load
+
+* Extend PyYAML's SafeLoader and use it with `yaml.load`
+
+Also added convenience functions for using this loader for reuse in
+`roslaunch`
+
+* fix typo in rosparam.yaml_load_all
+
+* Modify Loader and SafeLoader in yaml module directly
+
+* Revert whitespace change
+
+* Revert unrelated change to import through global variable construction
+---
+ clients/rospy/src/rospy/client.py | 2 +-
+ .../test/test_roslib_message.py | 2 +-
+ .../client_verification/test_slave_api.py | 2 +-
+ test/test_rosparam/test/check_rosparam.py | 8 ++---
+ .../check_rosparam_command_line_online.py | 2 +-
+ .../check_rosservice_command_line_online.py | 4 +--
+ test/test_rostopic/test/test_rostopic_unit.py | 30 +++++++++----------
+ tools/rosbag/src/rosbag/bag.py | 2 +-
+ tools/rosgraph/src/rosgraph/roslogging.py | 2 +-
+ tools/roslaunch/src/roslaunch/loader.py | 4 +--
+ .../test/unit/test_roslaunch_dump_params.py | 4 +--
+ tools/rosparam/src/rosparam/__init__.py | 7 ++++-
+ tools/rosservice/src/rosservice/__init__.py | 4 +--
+ tools/rostopic/src/rostopic/__init__.py | 6 ++--
+ tools/topic_tools/scripts/relay_field | 2 +-
+ 15 files changed, 43 insertions(+), 38 deletions(-)
+
+diff --git a/tools/rosgraph/src/rosgraph/roslogging.py b/tools/rosgraph/src/rosgraph/roslogging.py
+index ffe975dab..bbf1d9f49 100644
+--- a/tools/rosgraph/src/rosgraph/roslogging.py
++++ b/tools/rosgraph/src/rosgraph/roslogging.py
+@@ -178,7 +178,7 @@ def configure_logging(logname, level=logging.INFO, filename=None, env=None):
+ os.environ['ROS_LOG_FILENAME'] = log_filename
+ if config_file.endswith(('.yaml', '.yml')):
+ with open(config_file) as f:
+- dict_conf = yaml.load(f)
++ dict_conf = yaml.safe_load(f)
+ dict_conf.setdefault('version', 1)
+ logging.config.dictConfig(dict_conf)
+ else:
diff --git a/dev-ros/rosgraph/rosgraph-1.14.3.ebuild b/dev-ros/rosgraph/rosgraph-1.14.3-r1.ebuild
index 4922358a7091..4a463741c8fc 100644
--- a/dev-ros/rosgraph/rosgraph-1.14.3.ebuild
+++ b/dev-ros/rosgraph/rosgraph-1.14.3-r1.ebuild
@@ -20,3 +20,4 @@ RDEPEND="
dev-python/rospkg[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
test? ( dev-python/mock[${PYTHON_USEDEP}] dev-python/nose[${PYTHON_USEDEP}] )"
+PATCHES=( "${FILESDIR}/yaml.patch" "${FILESDIR}/py3.patch" "${FILESDIR}/py3-2.patch" )