diff --git a/CHANGES.rst b/CHANGES.rst index 2a441728c..e9103db5f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,7 +1,7 @@ 3.5.0 (unreleased) ------------------ -- +- handle junk bytes after tree (before or after blocks) [#1822] 3.4.0 (2024-08-04) ------------------ diff --git a/asdf/_tests/data/junk_after_blocks.asdf b/asdf/_tests/data/junk_after_blocks.asdf new file mode 100644 index 000000000..f69d3d257 Binary files /dev/null and b/asdf/_tests/data/junk_after_blocks.asdf differ diff --git a/asdf/_tests/data/junk_before_blocks.asdf b/asdf/_tests/data/junk_before_blocks.asdf new file mode 100644 index 000000000..f69d3d257 Binary files /dev/null and b/asdf/_tests/data/junk_before_blocks.asdf differ diff --git a/asdf/_tests/data/no_junk.asdf b/asdf/_tests/data/no_junk.asdf new file mode 100644 index 000000000..e1626ba1e Binary files /dev/null and b/asdf/_tests/data/no_junk.asdf differ diff --git a/asdf/_tests/test_junk_after_tree.py b/asdf/_tests/test_junk_after_tree.py new file mode 100644 index 000000000..087c3b9cf --- /dev/null +++ b/asdf/_tests/test_junk_after_tree.py @@ -0,0 +1,17 @@ +from pathlib import Path + +import asdf + +TEST_DATA_DIRECTORY = Path(__file__).parent / "data" + + +def test_no_junk(): + asdf.open(TEST_DATA_DIRECTORY / "no_junk.asdf") + + +def test_junk_before_blocks(): + asdf.open(TEST_DATA_DIRECTORY / "junk_before_blocks.asdf") + + +def test_junk_after_blocks(): + asdf.open(TEST_DATA_DIRECTORY / "junk_after_blocks.asdf")