Bug 14772

Summary: ResourceWarning: Enable tracemalloc to get the object allocation traceback
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Khem Raj <raj.khem>
Component: coreAssignee: Martin Jansa <Martin.Jansa>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: Martin.Jansa, meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie
Version: 5.99   
Target Milestone: 4.1 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Khem Raj 2022-03-31 19:05:31 UTC
I have started to get this warning on master lately in do_rootfs tasks, I am using archlinux with Python 3.10.4

openembedded-core/meta/classes/license_image.bbclass:23: ResourceWarning: unclosed file <_io.TextIOWrapper name='/mnt/b/yoe/master/build/tmp/deploy/licenses/yoe-installer-image-raspberrypi4-64-20220331174313/package.manifest' mode='w+' encoding='UTF-8'>
  'w+').write(output)
ResourceWarning: Enable tracemalloc to get the object allocation traceback


=====================

/mnt/b/yoe/master/sources/openembedded-core/meta/lib/oe/rootfs.py:331: ResourceWarning: unclosed file <_io.TextIOWrapper name='/mnt/b/yoe/master/build/tmp/pkgdata/raspberrypi4-64/kernel-depmod/kernel-abiversion' mode='r' encoding='UTF-8'>
  kernel_ver = open(kernel_abi_ver_file).read().strip(' \n')
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Comment 1 Martin Jansa 2022-04-07 14:30:45 UTC
I've noticed this today as well and fix sent as:
https://lists.openembedded.org/g/openembedded-core/message/164109
Comment 2 Randy MacLeod 2022-04-07 14:36:22 UTC
Patch incoming... Thanks Martin.