Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: lib/_emerge/
Date: Sun, 13 Jun 2021 22:42:03
Message-Id: 1623624066.482079c7835c769843544a4920ccb4c49d363351.zmedico@gentoo
1 commit: 482079c7835c769843544a4920ccb4c49d363351
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 13 22:38:40 2021 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 13 22:41:06 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=482079c7
7
8 PORTAGE_NICENESS: fix atexit ResourceWarning: unclosed file
9
10 # emerge -V
11 Portage 3.0.20 (python 3.8.5-final-0, default/linux/amd64/17.1/desktop, gcc-9.3.0, glibc-2.31-r6, 5.4.x x86_64)
12 /usr/lib/python3.8/site-packages/_emerge/actions.py:2663: ResourceWarning: unclosed file <_io.TextIOWrapper name='/proc/self/autogroup' mode='w' encoding='UTF-8'>
13 lambda value: autogroup_file.open("w").write(value).close(),
14 ResourceWarning: Enable tracemalloc to get the object allocation traceback
15
16 Fixes: a4d882964ee1 ("PORTAGE_NICENESS: Consider autogroup scheduling")
17 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
18
19 lib/_emerge/actions.py | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22 diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
23 index 18f8da200..bfb08ed6b 100644
24 --- a/lib/_emerge/actions.py
25 +++ b/lib/_emerge/actions.py
26 @@ -2660,7 +2660,7 @@ def nice(settings):
27 # terminal where portage was executed in, would
28 # continue running with that value.
29 portage.atexit_register(
30 - lambda value: autogroup_file.open("w").write(value),
31 + lambda value: autogroup_file.write_text(value),
32 original_autogroup_nice_value,
33 )