Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AgentConvo.py #191

Merged
merged 1 commit into from
Oct 20, 2023
Merged

Conversation

isthatpratik
Copy link
Contributor

Issue #134
Fix - Escape \U in file paths to prevent KeyError in regular expressions

This pull request addresses a bug in the replace_file_content method of the AgentConvo class. The bug was causing a KeyError when a file path containing the \U sequence was used in a regular expression. The fix involves escaping the \U sequence in the file path before it's used in the regular expression. This prevents the KeyError from being raised and allows the replace_file_content method to function as expected.

@nalbion nalbion linked an issue Oct 13, 2023 that may be closed by this pull request
@nalbion
Copy link
Contributor

nalbion commented Oct 13, 2023

That's great @Iampd2002 , it should resolve #134. Could you please add a unit test to catch regressions in the future?

Don't worry about the other failing tests, they'll be fixed on another branch

@LeonOstrez LeonOstrez merged commit bcc289e into Pythagora-io:main Oct 20, 2023
1 of 12 checks passed
@heijligers
Copy link

Thanks for fixing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyError: '\\U'
4 participants