Skip to content

Conversation

@jkowalleck
Copy link

a much simpler fix, don't you think?

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
# latest spec rev: https://discuss.python.org/t/pep-639-round-3-improving-license-clarity-with-better-package-metadata/53020 # noqa: E501
content = None
for mlpath in _LICENSE_LOCATIONS:
try:
Copy link
Author

Choose a reason for hiding this comment

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

the following 9 lines are the actual fix,

Copy link
Owner

Choose a reason for hiding this comment

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

Ah, indeed. Did not consider the fact that the UnicodeDecodeException has the original bytes. Yes, that is much simpler and robust.

<name>declared license file: my_licenses/richtext.rtf</name>
<text content-type="application/rtf" encoding="base64">e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZGVmZjBcbm91aWNvbXBhdFxkZWZsYW5nMTAzMXtcZm9udHRibHtcZjBcZm5pbFxmY2hhcnNldDAgQ2FsaWJyaTt9fQp7XCpcZ2VuZXJhdG9yIFJpY2hlZDIwIDEwLjAuMTkwNDF9XHZpZXdraW5kNFx1YzEgClxwYXJkXHNhMjAwXHNsMjc2XHNsbXVsdDFcZjBcZnMyMlxsYW5nNyBSVEYgTGljZW5zZSBGaWxlXHBhcgp9CgA=</text>
</license>
<license acknowledgement="declared">
Copy link
Author

Choose a reason for hiding this comment

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

the simpler implementation actually manages to detect the UTF16 files.

@schlenk schlenk merged commit 4982a64 into schlenk:issue_868 Apr 24, 2025
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