chore: add encoding= to open() calls and raw regex in src/agent/session.py and src/repl/core.py#11
Open
mangodxd wants to merge 1 commit intoGPT-AGI:mainfrom
Open
Conversation
…on.py and src/repl/core.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
I noticed a few areas where the code could be slightly improved. This PR focuses on minor housekeeping tasks and does not change any of the existing runtime logic:
Explicit encoding for file operations
src/agent/session.py: addedencoding="utf-8"to 2open()call(s)I added explicit encoding here because Python's default behavior depends on the OS. This change ensures consistent cross-platform behavior.
Regex syntax cleanup
src/repl/core.py: converted 2 regex string(s) to raw stringsUsing standard strings for regex patterns with backslashes triggers a SyntaxWarning in Python 3.12+. Converted to raw strings (
r"...") to follow modern best practices.Examples of changes
Example change in
src/agent/session.py:Example change in
src/repl/core.py:Verification
ast.parse()to ensure no syntax errors were introduced.__init__.pyfiles.If anything looks incorrect, please feel free to adjust it or close the PR entirely. Thank you for maintaining this project!