[PR #356/ae4d2c04 backport][0.16] Fix deepcopy crash when uploading file with labels#357
Merged
dkliban merged 1 commit intoJun 26, 2026
Conversation
QueryDict.copy() fails with TypeError when the request contains uploaded files with hashers (_hashlib.HASH objects cannot be pickled). Use _mutable flag instead to modify pulp_labels in place. Also adds labels to the file upload test to cover this code path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> (cherry picked from commit ae4d2c0)
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #356 as merged into main (ae4d2c0).
Summary
TypeError: cannot pickle '_hashlib.HASH' objectwhen uploading a file withpulp_labelsvia the synchronous upload endpointQueryDict.copy()does a deep copy which fails on uploaded files with hashers — use_mutableflag to modifypulp_labelsin place insteadpulp_labelsto the file upload test to cover this code pathTest plan
test_upload_maven_artifact_with_file— now uploads withpulp_labels={"type": "jar", "source": "test"}and verifies labels are stored🤖 Generated with Claude Code