commit: def3574d3fe9b944dd83e561462ccc6de6f90ff3 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Thu May 7 20:32:03 2020 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Thu May 7 20:34:02 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=def3574d
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 <AT> gmail.com> Bug: https://bugs.gentoo.org/721402 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> lib/portage/locks.py | 6 +++--- 1 file 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 = []
