mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
Fix encoding error when creating tools (#2876)
This commit fixes a `UnicodeDecodeError` when creating tools. This was caused when reading template files.
This commit is contained in:
@@ -161,7 +161,7 @@ def tree_find_and_replace(directory, find, replace):
|
|||||||
for filename in files:
|
for filename in files:
|
||||||
filepath = os.path.join(path, filename)
|
filepath = os.path.join(path, filename)
|
||||||
|
|
||||||
with open(filepath, "r") as file:
|
with open(filepath, "r", encoding="utf-8", errors="ignore") as file:
|
||||||
contents = file.read()
|
contents = file.read()
|
||||||
with open(filepath, "w") as file:
|
with open(filepath, "w") as file:
|
||||||
file.write(contents.replace(find, replace))
|
file.write(contents.replace(find, replace))
|
||||||
|
|||||||
Reference in New Issue
Block a user