summaryrefslogtreecommitdiff
path: root/dev-python/translate-toolkit
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2023-11-08 08:15:20 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2023-11-08 08:15:20 +0000
commit756bfa715f339dfaa651765bf64e16305d851e1a (patch)
treef78bb51cab065e7185602e5d91fb67288554677b /dev-python/translate-toolkit
parent78d74e125f11c58e610d4d447d0fb4baeed53b21 (diff)
downloadsrcux-756bfa715f339dfaa651765bf64e16305d851e1a.tar.gz
srcux-756bfa715f339dfaa651765bf64e16305d851e1a.tar.xz
srcux-756bfa715f339dfaa651765bf64e16305d851e1a.zip
Adding metadata
Diffstat (limited to 'dev-python/translate-toolkit')
-rw-r--r--dev-python/translate-toolkit/files/translate-toolkit-3.10.1-py312.patch36
-rw-r--r--dev-python/translate-toolkit/translate-toolkit-3.10.1-r1.ebuild (renamed from dev-python/translate-toolkit/translate-toolkit-3.10.1.ebuild)6
2 files changed, 41 insertions, 1 deletions
diff --git a/dev-python/translate-toolkit/files/translate-toolkit-3.10.1-py312.patch b/dev-python/translate-toolkit/files/translate-toolkit-3.10.1-py312.patch
new file mode 100644
index 000000000000..da0fd91520aa
--- /dev/null
+++ b/dev-python/translate-toolkit/files/translate-toolkit-3.10.1-py312.patch
@@ -0,0 +1,36 @@
+From 3217ed10bb9371ff25cb04e194e0250d42f89206 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= <michal@cihar.com>
+Date: Tue, 7 Nov 2023 08:42:56 +0100
+Subject: [PATCH] optrecurse: properly close opened files
+
+This avoids leaking file descriptors in the tests and makes sure the
+content is written at the end of conversion.
+
+Fixes #5071
+---
+ translate/misc/optrecurse.py | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/translate/misc/optrecurse.py b/translate/misc/optrecurse.py
+index d69666b8e8..9337c7c4ff 100644
+--- a/translate/misc/optrecurse.py
++++ b/translate/misc/optrecurse.py
+@@ -684,10 +684,17 @@ def processfile(
+ tempoutput = False
+ templatefile = self.opentemplatefile(options, fulltemplatepath)
+ passthroughoptions = self.getpassthroughoptions(options)
+- if fileprocessor(inputfile, outputfile, templatefile, **passthroughoptions):
++ result = fileprocessor(
++ inputfile, outputfile, templatefile, **passthroughoptions
++ )
++ if fullinputpath is not None:
++ inputfile.close()
++ if result:
+ if tempoutput:
+ self.warning("writing to temporary output...")
+ self.finalizetempoutputfile(options, outputfile, fulloutputpath)
++ if fulloutputpath and os.path.isfile(fulloutputpath):
++ outputfile.close()
+ return True
+ else:
+ # remove the file if it is a file (could be stdout etc)
diff --git a/dev-python/translate-toolkit/translate-toolkit-3.10.1.ebuild b/dev-python/translate-toolkit/translate-toolkit-3.10.1-r1.ebuild
index 7e13ec9acf83..c7126aed8b54 100644
--- a/dev-python/translate-toolkit/translate-toolkit-3.10.1.ebuild
+++ b/dev-python/translate-toolkit/translate-toolkit-3.10.1-r1.ebuild
@@ -4,7 +4,6 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-# py3.12: https://github.com/translate/translate/issues/5071
PYTHON_COMPAT=( python3_{8,9,10,11,12} )
PYTHON_REQ_USE="sqlite"
@@ -52,6 +51,11 @@ BDEPEND="
)
"
+PATCHES=(
+ # https://github.com/translate/translate/commit/3217ed10bb9371ff25cb04e194e0250d42f89206
+ "${FILESDIR}/${P}-py312.patch"
+)
+
distutils_enable_tests pytest
src_test() {