Skip to content

Commit 350771d

Browse files
committed
test: use yaml.safe_load() instead of yaml.load()
It eliminates warnings about using unsafe yaml.load(), which was added to a recent versions of pyyaml. We don't construct Python classes directly according to yaml tags, so safe_load() fit our needs. There is even more serious reason to replace yaml.load() usages. In Gentoo Linux (on recent pyyaml) a call to yaml.load() w/o an explicit loader causes RuntimeError; see [1]. [1]: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79ba924d94cb0cf8559565178414c2a1d687b90c
1 parent a6b6d56 commit 350771d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/cluster-py/multi.test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def check_connection(con):
4242
# Make a list of servers
4343
sources = []
4444
for server in cluster[1:]:
45-
sources.append(yaml.load(server.admin('box.cfg.listen', silent=True))[0])
45+
sources.append(yaml.safe_load(server.admin('box.cfg.listen', silent=True))[0])
4646

4747
addrs = []
4848
for addr in sources:

unit/suites/lib/tarantool_admin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ def execute(self, command):
6161
if (res.rfind("\n...\n") >= 0 or res.rfind("\r\n...\r\n") >= 0):
6262
break
6363

64-
return yaml.load(res)
64+
return yaml.safe_load(res)

0 commit comments

Comments
 (0)