Repository navigation
Conversation
This branch has not been deployed
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.
Binary element values may be readable, seekable buffers, but
Dataset.to_json()passes them directly to base64 encoding and the bulk-data path callslen()on them. Both paths raise TypeError for supported buffered Pixel Data values.Measure buffered values with
buffer_length. If a BulkDataURI handler is selected, pass the original element to it without reading the value. Otherwise, encode the full buffer as InlineBinary and restore its original position. Regressions cover OB/OW inline round trips and a bulk-data buffer whose read method raises, proving that URI serialization does not materialize the data.Validation: all 3 regressions fail on main before the fix. JSON, data-element, file-writer and file-utility suites pass afterwards (640 passed, 5 skipped, 3 warnings from existing validation tests). Repository-pinned Ruff 0.15.12 lint/format checks and git diff --check pass. Mypy 1.20.2 with Python 3.12 reports six errors in unchanged pixels/utils.py during followed imports; no full type-check pass is claimed. A changed-file check with followed-import diagnostics suppressed is recorded in validation. Python 3.12.14, NumPy 2.5.4, pydicom 3.1.0.dev0. Full package tests and documentation build were not run. A release note is included.