Ensure different tmp-file names if os.getpid() is not available
This commit is contained in:
parent
7f0e2627d1
commit
d6ec05193b
1 changed files with 1 additions and 1 deletions
|
|
@ -672,7 +672,7 @@ class LXMessage:
|
||||||
def write_to_directory(self, directory_path):
|
def write_to_directory(self, directory_path):
|
||||||
file_name = RNS.hexrep(self.hash, delimit=False)
|
file_name = RNS.hexrep(self.hash, delimit=False)
|
||||||
file_path = directory_path+"/"+file_name
|
file_path = directory_path+"/"+file_name
|
||||||
tmp_path = file_path+".tmp."+str(os.getpid())
|
tmp_path = file_path+".tmp."+str(os.getpid() or time.time())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(tmp_path, "wb") as file:
|
with open(tmp_path, "wb") as file:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue