[Libreoffice-commits] core.git: pyuno/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 4 19:03:37 UTC 2020


 pyuno/source/loader/pythonloader.py |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 62887aa764e51a74d3b452abd2297a05d9a6bd3f
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Fri Dec 4 18:39:53 2020 +0100
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Dec 4 20:02:57 2020 +0100

    Fix ResourceWarning in pythonloader.py
    
    trace:
    /home/julien/lo/libreoffice/instdir/program/pythonloader.py:146: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/julien/lo/libreoffice/instdir/share/extensions/numbertext/reg.uno.py' mode='r' encoding='utf_8'>
      mod = self.getModuleFromUrl( locationUrl )
    ResourceWarning: Enable tracemalloc to get the object allocation traceback
    
    Change-Id: I106ab6c3c9024a8c1a4624a3b64958dc205e30e6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107232
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/pyuno/source/loader/pythonloader.py b/pyuno/source/loader/pythonloader.py
index 5b824a3c26a1..7c16e226bad9 100644
--- a/pyuno/source/loader/pythonloader.py
+++ b/pyuno/source/loader/pythonloader.py
@@ -100,6 +100,7 @@ class Loader( XImplementationLoader, XServiceInfo, unohelper.Base ):
                     mod.__file__ = filename
                     exec(codeobject, mod.__dict__)
                     g_loadedComponents[url] = mod
+                    fileHandle.close()
                 return mod
             elif "vnd.openoffice.pymodule" == protocol:
                 nSlash = dependent.rfind('/')


More information about the Libreoffice-commits mailing list