Skip to content

Comments

Hash metadata as bytes#9049

Merged
radoering merged 3 commits intopython-poetry:mainfrom
thatch:hash-metadata-as-bytes
Mar 2, 2024
Merged

Hash metadata as bytes#9049
radoering merged 3 commits intopython-poetry:mainfrom
thatch:hash-metadata-as-bytes

Conversation

@thatch
Copy link
Contributor

@thatch thatch commented Feb 27, 2024

Because warehouse doesn't send a charset, this can get decoded as something other than utf-8, which doesn't encode (as utf-8) back to the same bytes. For hash purposes especially, just look at the original bytes.

Pull Request Check List

Resolves: #9048

  • Added tests for changed code.
  • Updated documentation for changed code.

Copy link
Member

@radoering radoering left a comment

Choose a reason for hiding this comment

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

I think we are ok with #9048 (comment)

thatch and others added 3 commits March 2, 2024 06:51
Because warehouse doesn't send a charset, this can get decoded as something
other than utf-8, which doesn't encode (as utf-8) back to the same bytes.  For
hash purposes especially, just look at the original bytes.
This ensures that it remains bytes the whole way through.
@radoering radoering force-pushed the hash-metadata-as-bytes branch from ab8e82e to 4d9b071 Compare March 2, 2024 05:51
@radoering radoering added the backport/1.8 Backport a PR to 1.8 through an automated PR label Mar 2, 2024
@radoering radoering marked this pull request as ready for review March 2, 2024 06:02
@radoering radoering enabled auto-merge (squash) March 2, 2024 06:02
@radoering radoering merged commit 28d5c00 into python-poetry:main Mar 2, 2024
poetry-bot bot pushed a commit that referenced this pull request Mar 2, 2024
Because warehouse doesn't send a charset, this can get decoded as something
other than utf-8, which doesn't encode (as utf-8) back to the same bytes. For
hash purposes especially, just look at the original bytes.

(cherry picked from commit 28d5c00)
radoering pushed a commit that referenced this pull request Mar 2, 2024
Because warehouse doesn't send a charset, this can get decoded as something
other than utf-8, which doesn't encode (as utf-8) back to the same bytes. For
hash purposes especially, just look at the original bytes.

(cherry picked from commit 28d5c00)
@github-actions
Copy link

github-actions bot commented Apr 2, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/1.8 Backport a PR to 1.8 through an automated PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PEP 658/714 metadata files incorrectly probe encoding

2 participants