From d9f25e5d71980d1738174cbda3f1c126f7efdde1 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 27 Apr 2022 23:31:40 -0300 Subject: [PATCH] Add hostname to ArchiveExtractor temporary file prefix --- biostools/extractors.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/biostools/extractors.py b/biostools/extractors.py index 19440ab..cd2c19b 100644 --- a/biostools/extractors.py +++ b/biostools/extractors.py @@ -15,7 +15,7 @@ # # Copyright 2021 RichardG. # -import array, codecs, datetime, io, itertools, math, os, re, shutil, struct, subprocess, sys, time +import array, codecs, datetime, io, itertools, math, os, re, shutil, socket, struct, subprocess, sys, time try: import PIL.Image except ImportError: @@ -162,9 +162,9 @@ class ArchiveExtractor(Extractor): # Remove duplicates and sort by total children count. dirs = list(set(dirs)) dirs.sort(key=lambda x: (x[1], x[0])) - + # See where we can create a symlink. - temp_file_name = 'biostools_{0}_{1}'.format(hex(os.getpid())[2:], hex(id(self))[2:]) + temp_file_name = 'biostools_{0}_{1}_{2}'.format(socket.gethostname(), hex(os.getpid())[2:], hex(id(self))[2:]) self._temp_paths = [] for dir_path, dir_children in dirs: # Test symlink creation.