diff --git a/webgui.py b/webgui.py index 75ffdca..2ebd345 100644 --- a/webgui.py +++ b/webgui.py @@ -1447,7 +1447,7 @@ def set_genders_file(input_gender_file:gr.File): ##----------------start-of-clear_genders_file()--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - def clear_genders_file(temp_file) -> None: + def clear_genders_file(temp_file:gr.File) -> None: """ @@ -1460,7 +1460,7 @@ def clear_genders_file(temp_file) -> None: with open(FileEnsurer.config_translation_genders_path, "w", encoding="utf-8") as f: json.dump(FileEnsurer.DEFAULT_GENDER_SETTINGS, f, indent=4) - with open(temp_file, "w", encoding="utf-8") as f: + with open(temp_file.name, "w", encoding="utf-8") as f: # type: ignore json.dump(FileEnsurer.DEFAULT_GENDER_SETTINGS, f, indent=4) except: