-
Notifications
You must be signed in to change notification settings - Fork 52
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
Error in unicode entry scripts #252
Comments
This would be quite problematic since a major feature of this package was that it has no dependencies and can run purely based on the stdlib, making it suitable as the very bottom package in an ecosystem bootstrap. It would also prevent being vendored into |
Do we even need a regex engine though? The spec basically just requires splitting on the first equal sign, and checking some leading and trailing special characters. It can be hand-rolled. |
Interesting...would something using the following functions to check for valid identifiers be useful? def isalnum(x):
if len(x) != 1:
return all(isalnum(y) for y in x)
return unicodedata.category(x) in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', 'Mn', 'Mc', 'Nd', 'Pc']
def isalpha(x):
if len(x) != 1:
return all(isalpha(y) for y in x)
return unicodedata.category(x) in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Mn', 'Mc', 'Pc'] |
Valid identifiers can be determined via |
Reproduced here (pull request with failing tests): https://github.com/pypa/installer/actions/runs/12326732550?pr=254 |
...and now fixed with PR: https://github.com/pypa/installer/actions/runs/12326868467/job/34408216136?pr=254 |
In utils.py, the _ENTRYPOINT_REGEX regex does not recognise valid unicode Python identifiers (https://peps.python.org/pep-3131/), preventing the use of non-ascii file paths as entry points. Using the
regex
module as a drop-in replacement forre
would solve this issue; please let me know if you would like me to submit a pull request.The text was updated successfully, but these errors were encountered: