dev-ros/topic_tools: upstream yaml fixes

Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Alexis Ballier <aballier@gentoo.org>
This commit is contained in:
Alexis Ballier
2019-12-12 14:53:54 +01:00
parent 9379a83fab
commit 7800bccd94
2 changed files with 55 additions and 1 deletions

View File

@@ -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/topic_tools/scripts/relay_field b/tools/topic_tools/scripts/relay_field
index 6630b685d..cc73ac443 100755
--- a/tools/topic_tools/scripts/relay_field
+++ b/tools/topic_tools/scripts/relay_field
@@ -98,7 +98,7 @@ class RelayField(object):
if self.input_fn is not None:
m = self.input_fn(m)
- msg_generation = yaml.load(self.expression)
+ msg_generation = yaml.safe_load(self.expression)
pub_args = _eval_in_dict_impl(msg_generation, None, {'m': m})
now = rospy.get_rostime()

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
@@ -31,3 +31,4 @@ DEPEND="${RDEPEND}
dev-cpp/gtest
dev-python/nose[${PYTHON_USEDEP}]
)"
PATCHES=( "${FILESDIR}/yaml.patch" )