Skip to content

Commit

Permalink
create_trees: Handle bytes arguments for utf8_mode
Browse files Browse the repository at this point in the history
Bug: https://bugs.gentoo.org/916149
Signed-off-by: Zac Medico <zmedico@gentoo.org>
  • Loading branch information
zmedico committed Oct 23, 2023
1 parent c7768ae commit d7ff407
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/portage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,16 @@ def __init__(self, *pargs, **kargs):
def create_trees(
config_root=None, target_root=None, trees=None, env=None, sysroot=None, eprefix=None
):
if utf8_mode:
config_root = (
os.fsdecode(config_root) if isinstance(config_root, bytes) else config_root
)
target_root = (
os.fsdecode(target_root) if isinstance(target_root, bytes) else target_root
)
sysroot = os.fsdecode(sysroot) if isinstance(sysroot, bytes) else sysroot
eprefix = os.fsdecode(eprefix) if isinstance(eprefix, bytes) else eprefix

if trees is None:
trees = _trees_dict()
elif not isinstance(trees, _trees_dict):
Expand Down

0 comments on commit d7ff407

Please sign in to comment.