From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CA3A1158089 for ; Tue, 24 Oct 2023 01:48:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 192E92BC013; Tue, 24 Oct 2023 01:48:29 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EB2AD2BC013 for ; Tue, 24 Oct 2023 01:48:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AD9C5335C20 for ; Tue, 24 Oct 2023 01:48:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 15F4012B3 for ; Tue, 24 Oct 2023 01:48:25 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1698072725.d7ff40702646bbbe9ae9e2c691f3290f2cc565ba.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/__init__.py X-VCS-Directories: lib/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: d7ff40702646bbbe9ae9e2c691f3290f2cc565ba X-VCS-Branch: master Date: Tue, 24 Oct 2023 01:48:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: aaa0e7d3-5c01-42a4-ab2d-6ae2ffae94b6 X-Archives-Hash: 180c6c7a7cf43a0e7ea032ef867076d4 commit: d7ff40702646bbbe9ae9e2c691f3290f2cc565ba Author: Zac Medico gentoo org> AuthorDate: Mon Oct 23 14:51:44 2023 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Oct 23 14:52:05 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d7ff4070 create_trees: Handle bytes arguments for utf8_mode Bug: https://bugs.gentoo.org/916149 Signed-off-by: Zac Medico gentoo.org> lib/portage/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py index defefcb286..b26d0cfd53 100644 --- a/lib/portage/__init__.py +++ b/lib/portage/__init__.py @@ -618,6 +618,16 @@ class _trees_dict(dict): 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):