diff --git a/viewer/target_loader.py b/viewer/target_loader.py index 037d63c2..167ed825 100644 --- a/viewer/target_loader.py +++ b/viewer/target_loader.py @@ -2059,17 +2059,15 @@ def process_bundle(self): ) # import compound identifier file, if present - if ( - Path(upload_dir) - .joinpath("extra_files") - .joinpath(CUSTOM_IDENTIFIER_FILE) - .exists() - ): - self.import_compound_identifiers() + alias_file_path = ( + Path(upload_dir).joinpath("extra_files").joinpath(CUSTOM_IDENTIFIER_FILE) + ) + if alias_file_path.exists(): + self.import_compound_identifiers(alias_file_path) - def import_compound_identifiers(self): + def import_compound_identifiers(self, alias_file_path): try: - df = pd.read_csv(CUSTOM_IDENTIFIER_FILE) + df = pd.read_csv(alias_file_path) except UnicodeDecodeError: self.report.log( logging.ERROR,