Skip to content

[PR #356/ae4d2c04 backport][0.16] Fix deepcopy crash when uploading file with labels#357

Merged
dkliban merged 1 commit into
0.16from
patchback/backports/0.16/ae4d2c048b41948e94b6872d2490f277b79b8afa/pr-356
Jun 26, 2026
Merged

[PR #356/ae4d2c04 backport][0.16] Fix deepcopy crash when uploading file with labels#357
dkliban merged 1 commit into
0.16from
patchback/backports/0.16/ae4d2c048b41948e94b6872d2490f277b79b8afa/pr-356

Conversation

@patchback

@patchback patchback Bot commented Jun 26, 2026

Copy link
Copy Markdown

This is a backport of PR #356 as merged into main (ae4d2c0).

Summary

  • Fix TypeError: cannot pickle '_hashlib.HASH' object when uploading a file with pulp_labels via the synchronous upload endpoint
  • QueryDict.copy() does a deep copy which fails on uploaded files with hashers — use _mutable flag to modify pulp_labels in place instead
  • Add pulp_labels to the file upload test to cover this code path

Test plan

  • test_upload_maven_artifact_with_file — now uploads with pulp_labels={"type": "jar", "source": "test"} and verifies labels are stored

🤖 Generated with Claude Code

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)
@dkliban dkliban merged commit 1166d56 into 0.16 Jun 26, 2026
8 checks passed
@dkliban dkliban deleted the patchback/backports/0.16/ae4d2c048b41948e94b6872d2490f277b79b8afa/pr-356 branch June 26, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant