Skip to content

Have mkstringprep.py download the RFC if it's missing - #2

Merged
sethmlarson merged 1 commit into
sethmlarson:unicode-stringprepfrom
encukou:unicode-stringprep
Aug 12, 2026
Merged

Have mkstringprep.py download the RFC if it's missing#2
sethmlarson merged 1 commit into
sethmlarson:unicode-stringprepfrom
encukou:unicode-stringprep

Conversation

@encukou

@encukou encukou commented Aug 12, 2026

Copy link
Copy Markdown

Hi,
python#155293 adds a mkstringprep.py run to make regen-unicodedata. The existing script will download its data if a local copy is missing; mkstringprep should do the same.

with open("rfc3454.txt") as f:
data = f.readlines()
try:
data_file = open(FILENAME, encoding='utf-8')

@encukou encukou Aug 12, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encoding='utf-8' might be cargo-culting (reportedly, non-ASCII-compatible encodings exist, but aren't really tested), but it's what makeunicodedata uses, and old Pythons don't use UTF-8 by default.

@sethmlarson sethmlarson left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Petr! 🙏

@sethmlarson
sethmlarson merged commit 35a0beb into sethmlarson:unicode-stringprep Aug 12, 2026
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