Fix failing windows (#33436)

* Encoding

* style
This commit is contained in:
Lysandre Debut 2024-09-11 14:06:16 +02:00 committed by GitHub
parent e719b65c31
commit 91f19a5b18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1924,7 +1924,7 @@ def create_import_structure_from_path(module_path):
if not module_name.endswith(".py"):
continue
with open(os.path.join(directory, module_name)) as f:
with open(os.path.join(directory, module_name), encoding="utf-8") as f:
file_content = f.read()
# Remove the .py suffix