From: vsr Date: Mon, 21 Oct 2019 08:04:03 +0000 (+0300) Subject: #17872 [CEA] /tmp/.salome_PortManager.lock permission denied X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8e13e88d05d970cc47659054136f16aa0361b2fc;p=modules%2Fyacs.git #17872 [CEA] /tmp/.salome_PortManager.lock permission denied --- 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)