fix: windows load provider file error (#2463)

This commit is contained in:
wjryours 2024-02-18 15:48:25 +08:00 committed by GitHub
parent c6e2900be7
commit af6a318aae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,7 +28,7 @@ class BuiltinToolProviderController(ToolProviderController):
provider = self.__class__.__module__.split('.')[-1] provider = self.__class__.__module__.split('.')[-1]
yaml_path = path.join(path.dirname(path.realpath(__file__)), 'builtin', provider, f'{provider}.yaml') yaml_path = path.join(path.dirname(path.realpath(__file__)), 'builtin', provider, f'{provider}.yaml')
try: try:
with open(yaml_path) as f: with open(yaml_path, 'rb') as f:
provider_yaml = load(f.read(), FullLoader) provider_yaml = load(f.read(), FullLoader)
except: except:
raise ToolProviderNotFoundError(f'can not load provider yaml for {provider}') raise ToolProviderNotFoundError(f'can not load provider yaml for {provider}')