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.
Fix raw string regex patterns and update
converting.py
encodingThis PR addresses #693 which is generating a fair amount of logging spam when I'm using Pony.
Context
Python 3.12 changed the way escape sequences in strings work with regular expressions. From the Python 3.12 changelog:
Changes
Added 'r' prefix to regex patterns in:
pony/orm/dbproviders/oracle.py
:json_item_re
pony/orm/dbapiprovider.py
:version_re
pony/thirdparty/decorator.py
:DEF
pony/converting.py
:date_re_list
,time_re
,datetime_re_list
Note:
email_re
andrfc2822_email_re
inconverting.py
already had the 'r' prefix.Additionally,
converting.py
was converted from cp1251 to UTF-8 encoding using:iconv -f cp1251 -t utf-8 pony/converting.py > pony/converting.py.utf8 mv pony/converting.py.utf8 pony/converting.py
This encoding change aligns with a similar change made in #669.
Why
Using raw strings for regex patterns is a Python best practice because:
This PR was generated with https://www.all-hands.dev/ (an open source agent) but I have reviewed the code changes prior to submitting, noted potential areas for review, and adjusted this description to include additional context.