Skip to content

Python 3.12 compatibility: wrap regex in r''.#104

Merged
dreaming-augustin merged 1 commit into
artyom-beilis:masterfrom
dreaming-augustin:upstream
Jul 15, 2024
Merged

Python 3.12 compatibility: wrap regex in r''.#104
dreaming-augustin merged 1 commit into
artyom-beilis:masterfrom
dreaming-augustin:upstream

Conversation

@dreaming-augustin

Copy link
Copy Markdown
Collaborator

Fixes scores of errors like:
SyntaxWarning: invalid escape sequence '*'

Using invalid escape sequences in string literals has been deprecated since Python 3.6. Since then, attempting to use an invalid escape sequence has emitted a DeprecationWarning. Python 3.12 upgraded the DeprecationWarning to a SyntaxWarning.

Fixes scores of errors like:
	SyntaxWarning: invalid escape sequence '\*'

Using invalid escape sequences in string literals has been deprecated since Python 3.6.
Since then, attempting to use an invalid escape sequence has emitted a DeprecationWarning.
Python 3.12 upgraded the DeprecationWarning to a SyntaxWarning.
@dreaming-augustin dreaming-augustin merged commit c4febcc into artyom-beilis:master Jul 15, 2024
@artyom-beilis

Copy link
Copy Markdown
Owner

Just to make sure have you run unit tests?

@dreaming-augustin

Copy link
Copy Markdown
Collaborator Author

Oops. Thank you for the reminder.

98% tests passed, 2 tests failed out of 112
The following tests FAILED:
        104 - test_locale_boundary (Failed)
        105 - test_locale_formatting (Failed)

It does not seem to be related to the present merge.

104/112 Testing: test_locale_boundary
104/112 Test: test_locale_boundary
Command: "/cppcms/build/booster/test_locale_boundary"
Directory: /cppcms/build/booster
"test_locale_boundary" start time: Jul 15 19:46 CST
Output:
----------------------------------------------------------
Testing segment operators
Testing word boundary
 char UTF-8                                                                                                                                                                                  
Error in line:104 p->rule() == unsigned(masks[i])
Error in line:116 p->rule() == unsigned(masks[i])
Error in line:123 p->rule() == unsigned(masks[index])
Error in line:134 p->rule() == unsigned(masks[i])
Error in line:151 p->rule() == unsigned(masks[i])
Error in line:159 p->rule() == unsigned(masks[index])
Error in line:179 p->rule()==unsigned(masks[chunk_ptr])
Error in line:179 p->rule()==unsigned(masks[chunk_ptr])
Error in line:179 p->rule()==unsigned(masks[chunk_ptr])
...
105/112 Testing: test_locale_formatting                                                                                                                                                      
105/112 Test: test_locale_formatting
Command: "/cppcms/build/booster/test_locale_formatting"
Directory: /cppcms/build/booster
"test_locale_formatting" start time: Jul 15 19:46 CST
Output:
----------------------------------------------------------
Testing char, UTF-8
Error in line:296 (ss.str())==(to_correct_string<CharType>("USD1,345.00",loc))
Error in line:297 (ss.str())==(to_correct_string<CharType>("USD1,345.34",loc))
Error in line:327 (ss.str())==(to_correct_string<CharType>("3:33:13 PM",loc))
Error in line:328 (ss.str())==(to_correct_string<CharType>("3:33 PM",loc))
Error in line:329 (ss.str())==(to_correct_string<CharType>("3:33:13 PM",loc))
Error in line:331 (ss.str())==(to_correct_string<CharType>("3:33:13 PM GMT",loc))
Error in line:334 (ss.str())==(to_correct_string<CharType>("3:33:13 PM " "Greenwich Mean Time",loc))
Error in line:343 (ss.str())==(to_correct_string<CharType>("4:33:13 PM",loc))
Error in line:344 (ss.str())==(to_correct_string<CharType>("4:33 PM",loc))
Error in line:345 (ss.str())==(to_correct_string<CharType>("4:33:13 PM",loc))
Error in line:362 (ss.str())==(to_correct_string<CharType>("4:33:13 PM " "GMT+1",loc))
...

@dreaming-augustin

Copy link
Copy Markdown
Collaborator Author

Do those test units test the output of cppcms_tmpl_cc ??

@artyom-beilis

Copy link
Copy Markdown
Owner

No it is ok, probably related to ICU version, Ignore

@dreaming-augustin

Copy link
Copy Markdown
Collaborator Author

Ok, Thank you. :)

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.

2 participants