[dunfell 08/11] license_image.bbclass: close package.manifest file


Steve Sakoman
 

From: Martin Jansa <Martin.Jansa@...>

* fixes:
NOTE: Executing write_package_manifest ...
DEBUG: Executing python function write_package_manifest
/OE/build/oe-core/openembedded-core/meta/classes/license_image.bbclass:23: ResourceWarning: unclosed file <_io.TextIOWrapper name='/OE/build/oe-core/tmp-glibc/deploy/licenses/core-image-minimal-qemux86-64/package.manifest' mode='w+' encoding='UTF-8'>
'w+').write(output)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
DEBUG: Python function write_package_manifest finished

[YOCTO #14772]

Signed-off-by: Martin Jansa <Martin.Jansa@...>
Signed-off-by: Richard Purdie <richard.purdie@...>
(cherry picked from commit b3114d5d438b7a63a276b4e825b62f3b1ebceed6)
Signed-off-by: Steve Sakoman <steve@...>
---
meta/classes/license_image.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass
index 1396a95f47..9f3a0c3727 100644
--- a/meta/classes/license_image.bbclass
+++ b/meta/classes/license_image.bbclass
@@ -9,8 +9,8 @@ python write_package_manifest() {

pkgs = image_list_installed_packages(d)
output = format_pkg_list(pkgs)
- open(os.path.join(license_image_dir, 'package.manifest'),
- 'w+').write(output)
+ with open(os.path.join(license_image_dir, 'package.manifest'), "w+") as package_manifest:
+ package_manifest.write(output)
}

python license_create_manifest() {
--
2.25.1

Join openembedded-core@lists.openembedded.org to automatically receive all group messages.