-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support named Unicode escapes (\N{name}) in re #74873
Comments
The re module specially handles Unicode escapes (\uXXXX and \UXXXXXXXX) so that even raw strings (r'...') have symbolic Unicode characters. But it has not supported named Unicode escapes such as r'\N{EM DASH}', making the escapes for string literals and the escapes for regular expressions asymmetric |
Thank you for your contribution Jonathan! |
Hello This leads to build failures due to circular dependency At generate-posix-vars stage, unicodedata is imported (due to import pprint)but it has not been built due to it being a C module. However, building C modules happen after generate-posix-vars. See full message below. ./python.exe -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
Traceback (most recent call last):
File "/Users/fangyi/cpython/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Users/fangyi/cpython/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/fangyi/cpython/Lib/sysconfig.py", line 700, in <module>
_main()
File "/Users/fangyi/cpython/Lib/sysconfig.py", line 688, in _main
_generate_posix_vars()
File "/Users/fangyi/cpython/Lib/sysconfig.py", line 350, in _generate_posix_vars
import pprint
File "/Users/fangyi/cpython/Lib/pprint.py", line 38, in <module>
import re
File "/Users/fangyi/cpython/Lib/re.py", line 123, in <module>
import sre_compile
File "/Users/fangyi/cpython/Lib/sre_compile.py", line 14, in <module>
import sre_parse
File "/Users/fangyi/cpython/Lib/sre_parse.py", line 16, in <module>
import unicodedata
ModuleNotFoundError: No module named 'unicodedata'
generate-posix-vars failed |
The buidbots are broken by this. Please fix or revert. |
Thank you Fangyi Zhou for your report and fix. Changes are trivial and didn't require to sign CLA. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: