From 8b188142370296822c8a763a24e1b36290c673c0 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Thu, 11 Jul 2024 10:32:08 +0200 Subject: [PATCH 1/2] fix(`iter_gitdiff`): decode bytes before itemization Analog change to 5fe82eadc41880dcc8ae914d2348462fb98e9465 for `iter_gitdiff()` Refs: https://github.com/datalad/datalad-next/issues/740 --- datalad_next/iter_collections/gitdiff.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/datalad_next/iter_collections/gitdiff.py b/datalad_next/iter_collections/gitdiff.py index c864d830..f4a1a23e 100644 --- a/datalad_next/iter_collections/gitdiff.py +++ b/datalad_next/iter_collections/gitdiff.py @@ -497,10 +497,8 @@ def _mangle_item_for_singledir( def _git_diff_something(path: Path, args: List[str]) -> Iterator[str]: with iter_git_subproc([*args], cwd=path) as r: - yield from decode_bytes( - itemize( - r, - sep=b'\0', - keep_ends=False, - ) + yield from itemize( + decode_bytes(r), + sep='\0', + keep_ends=False, ) From c8598545c5485a6b9a96b9922259acbf07d4d3d3 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Thu, 11 Jul 2024 10:33:09 +0200 Subject: [PATCH 2/2] fix(`iter_gittree`): decode bytes before itemization Analog change to 5fe82eadc41880dcc8ae914d2348462fb98e9465 for `iter_gittree()` Refs: https://github.com/datalad/datalad-next/issues/740 --- datalad_next/iter_collections/gittree.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/datalad_next/iter_collections/gittree.py b/datalad_next/iter_collections/gittree.py index d571947e..a0895429 100644 --- a/datalad_next/iter_collections/gittree.py +++ b/datalad_next/iter_collections/gittree.py @@ -141,10 +141,8 @@ def _git_ls_tree(path: Path, *args) -> Iterator[str]: ], cwd=path, ) as r: - yield from decode_bytes( - itemize( - r, - sep=b'\0', - keep_ends=False, - ) + yield from itemize( + decode_bytes(r), + sep='\0', + keep_ends=False, )