| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
The docs promise property and value names are matched loosely (whitespace not significant), but _normalize() only removed spaces. Now tab/newline/cr/formfeed/vertical-tab are ignored as well.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Problem
The docs (and the _normalize comment) promise that \p{...} property and value names are matched loosely — case, whitespace, hyphens and underscores are not significant (UAX #44, LM3). In practice only spaces were removed, so \p{L\tu} or \p{G\nC=Lu} raised re.error: unknown property "L\ntu" while the space form worked. (3.16-only feature, so no compatibility concern.)
Solution
_normalize() in Lib/re/_properties.py now drops all ASCII whitespace ( \t\n\r\f\v), not just space; comment updated to match.
Result
Added a regression loop over all six whitespace characters in test_re.py::test_property_escapes; full test_re passes (169 tests) on a debug build, and the new assertions fail on the unpatched code. NEWS entry added.