artyom-beilis / cppcms

CppCMS Framework
Other
450 stars 111 forks source link

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

Closed dreaming-augustin closed 3 months ago

dreaming-augustin commented 3 months ago

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.

artyom-beilis commented 3 months ago

Just to make sure have you run unit tests?

dreaming-augustin commented 3 months ago

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 commented 3 months ago

Do those test units test the output of cppcms_tmpl_cc ??

artyom-beilis commented 3 months ago

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

dreaming-augustin commented 3 months ago

Ok, Thank you. :)