Skip to content

Commit 8155fc6

Browse files
fix read yaml on win (#3458)
1 parent 94d9150 commit 8155fc6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddlex/utils/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import yaml
1919
from . import logging
2020
from .errors import raise_key_not_found_error
21+
from .file_interface import custom_open
2122

2223
__all__ = ["get_config"]
2324

@@ -61,7 +62,7 @@ def create_attr_dict(yaml_config):
6162

6263
def parse_config(cfg_file):
6364
"""Load a config file into AttrDict"""
64-
with open(cfg_file, "r") as fopen:
65+
with custom_open(cfg_file, "r") as fopen:
6566
yaml_config = AttrDict(yaml.load(fopen, Loader=yaml.SafeLoader))
6667
create_attr_dict(yaml_config)
6768
return yaml_config

0 commit comments

Comments
 (0)