From 8e13e88d05d970cc47659054136f16aa0361b2fc Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 21 Oct 2019 11:04:03 +0300 Subject: [PATCH] #17872 [CEA] /tmp/.salome_PortManager.lock permission denied --- bin/PortManager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/PortManager.py b/bin/PortManager.py index 0b8dd94c1..e0584ac81 100644 --- a/bin/PortManager.py +++ b/bin/PortManager.py @@ -83,6 +83,11 @@ def _getConfigurationFilename(): import tempfile temp = tempfile.NamedTemporaryFile() lock_file = os.path.join(os.path.dirname(temp.name), ".salome_PortManager.lock") + try: + with open(lock_file, 'wb'): + pass + except IOError: + pass temp.close() return (portmanager_config, lock_file) @@ -137,7 +142,7 @@ def getPort(preferredPort=None): config_file, lock_file = _getConfigurationFilename() oldmask = os.umask(0) - with open(lock_file, 'wb') as lock: + with open(lock_file, 'rb') as lock: # acquire lock __acquire_lock(lock) @@ -196,7 +201,7 @@ def releasePort(port): config_file, lock_file = _getConfigurationFilename() oldmask = os.umask(0) - with open(lock_file, 'wb') as lock: + with open(lock_file, 'rb') as lock: # acquire lock __acquire_lock(lock) -- 2.39.2