temp = tempfile.NamedTemporaryFile()
lock_file = os.path.join(os.path.dirname(temp.name), ".salome_PortManager.lock")
try:
+ oldmask = os.umask(0)
with open(lock_file, 'wb'):
pass
except IOError:
pass
+ finally:
+ os.umask(oldmask)
temp.close()
return (portmanager_config, lock_file)
def getBusyPorts():
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)