Closed tisto closed 2 years ago
I was able to track this down to a plone.scale call:
1/1 (100.0%)> /Users/timo/workspace/plone/plone.restapi/src/plone/restapi/imaging.py(57)get_original_image_url()
-> scale = images_view.scale(
(Pdb) images_view.scale(fieldname, width=width, height=height, direction="thumbnail")
/Users/timo/.buildout/eggs/ZODB-5.5.1-py3.7.egg/ZODB/blob.py:339: ResourceWarning: unclosed file <_io.FileIO name='/var/folders/zw/wqv1f2gd4zdc43t1j834x5580000gn/T/BUC60nli4o_' mode='rb' closefd=True>
super(BlobFile, self).close()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
<plone.namedfile.scaling.ImageScale object at 0x1198dbf90>
Just a guess about what could be causing this:
I created a first fix:
https://github.com/plone/plone.namedfile/pull/88
Will continue to look into it tomorrow...
When running jMeter performance tests on Python 3 I ran into lots of those tracebacks:
I guess we need to properly close a file that we open. Python 3 seems to be more picky about this...