aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-05-07 13:32:03 -0700
committerZac Medico <zmedico@gentoo.org>2020-05-07 13:34:02 -0700
commitdef3574d3fe9b944dd83e561462ccc6de6f90ff3 (patch)
tree67fa4e786839ac7a3086e73d303833f2160075cb
parentdoebuild: Use ccache/distcc/icecream only in src_* phases (diff)
downloadportage-def3574d3fe9b944dd83e561462ccc6de6f90ff3.tar.gz
portage-def3574d3fe9b944dd83e561462ccc6de6f90ff3.tar.bz2
portage-def3574d3fe9b944dd83e561462ccc6de6f90ff3.zip
locks: translate surrogate from uname (bug 721402)
Prevent an error like this when attempting to encode a surrogate: UnicodeEncodeError: 'utf-8' codec can't encode characters in position 20-22: surrogates not allowed Tested-by: Vladimir Varlamov <bes.internal@gmail.com> Bug: https://bugs.gentoo.org/721402 Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/portage/locks.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/portage/locks.py b/lib/portage/locks.py
index 2331e6f57..535698dfe 100644
--- a/lib/portage/locks.py
+++ b/lib/portage/locks.py
@@ -1,5 +1,5 @@
# portage: Lock management code
-# Copyright 2004-2019 Gentoo Authors
+# Copyright 2004-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
__all__ = ["lockdir", "unlockdir", "lockfile", "unlockfile", \
@@ -516,7 +516,7 @@ def unlockfile(mytuple):
def hardlock_name(path):
base, tail = os.path.split(path)
return os.path.join(base, ".%s.hardlock-%s-%s" %
- (tail, os.uname()[1], os.getpid()))
+ (tail, portage._decode_argv([os.uname()[1]])[0], os.getpid()))
def hardlink_is_mine(link, lock):
try:
@@ -672,7 +672,7 @@ def unhardlink_lockfile(lockfilename, unlinkfile=True):
pass
def hardlock_cleanup(path, remove_all_locks=False):
- myhost = os.uname()[1]
+ myhost = portage._decode_argv([os.uname()[1]])[0]
mydl = os.listdir(path)
results = []