diff options
authorPau Espin Pedrol <pespin@sysmocom.de>2017-09-13 17:01:55 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-09-13 23:43:01 +0200
commit1c7439570f2d03e096f3c495382ea461d2794695 (patch)
parenta8647f304cd84301c9b3163a9aecd55ad52e783b (diff)
bts_osmotrx: Fix mkdtemp use inf python < 3.5neels/pespin_fix-mkdtemp
We are currently seeing this issues in prod setup, which uses python 3.4: File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/bts_osmotrx.py", line 44, in __init__ self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None) File "/usr/lib/python3.4/tempfile.py", line 432, in mkdtemp file = _os.path.join(dir, prefix + name + suffix) TypeError: Can't convert 'NoneType' object to str implicitly Acording to mkdtemp man in python3: "Changed in version 3.5: suffix, prefix, and dir may now be supplied in bytes in order to obtain a bytes return value. Prior to this, only str was allowed. suffix and prefix now accept and default to None to cause an appropriate default value to be used." This issue went unnoticed because the RnD env is running debian 9, which probably has python version >= 3.5. Change-Id: If3226183fe21b4820149b1d03207193dc6f139e2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py
index 3077b0f..6130ca9 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -41,7 +41,7 @@ class OsmoBtsTrx(log.Origin):
self.suite_run = suite_run
self.conf = conf
self.env = {}
- self.pcu_sk_tmp_dir = tempfile.mkdtemp(None, 'ogtpcusk', None)
+ self.pcu_sk_tmp_dir = tempfile.mkdtemp('', 'ogtpcusk')
if len(self.pcu_socket_path().encode()) > 107:
raise log.Error('Path for pcu socket is longer than max allowed len for unix socket path (107):', self.pcu_socket_path())