package.bbclass: fix python unclosed file ResourceWarning
cover package.bbclass: fix python unclosed file ResourceWarning
*** BLURB HERE ***
The following changes since commit fe43e599327f26b399c1883205e988236a5e51bd:
gcc: Drop 7.3 since 8.2 is working fine for us (2018-12-15 17:10:52 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/package_warn
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/package_warn
Chen Qi (1):
package.bbclass: fix python unclosed file ResourceWarning
meta/classes/package.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
PATCH 1/1 package.bbclass: fix python unclosed file ResourceWarning
Fix the following warning.
ResourceWarning: unclosed file <_io.TextIOWrapper name='/.../systemd/1_239-r0/debugsources.list' mode='a' encoding='UTF-8'>
Signed-off-by Chen Qi <[email protected]>
--- meta/classes/package.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/package.bbclass +2 -1
@@ -368,7 +368,8 @@ def append_source_info(file, sourcefile, d, fatal=True): # is still assuming that. debuglistoutput = '\0'.join(debugsources) + '\0' lf = bb.utils.lockfile(sourcefile + ".lock") - open(sourcefile, 'a').write(debuglistoutput) + with open(sourcefile, 'a') as sf: + sf.write(debuglistoutput) bb.utils.unlockfile(lf)
Signature · 1 line
1.9.1