diff options
author | Michał Górny <mgorny@gentoo.org> | 2023-03-30 17:09:44 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2023-03-30 17:40:57 +0200 |
commit | dcfc92cb1264ed25655a035d5cf4993ee384c1f6 (patch) | |
tree | a92ee0949753fc821bcadc94137fdcde7fe9a066 /dev-python | |
parent | dev-python/coverage: Stabilize 7.2.2 sparc, #903585 (diff) | |
download | gentoo-dcfc92cb1264ed25655a035d5cf4993ee384c1f6.tar.gz gentoo-dcfc92cb1264ed25655a035d5cf4993ee384c1f6.tar.bz2 gentoo-dcfc92cb1264ed25655a035d5cf4993ee384c1f6.zip |
dev-python/pytz: Fix resource leak in system-tzinfo patch
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/pytz/files/pytz-2023.2-system-tzinfo.patch | 7 | ||||
-rw-r--r-- | dev-python/pytz/pytz-2023.2-r2.ebuild (renamed from dev-python/pytz/pytz-2023.2-r1.ebuild) | 0 | ||||
-rw-r--r-- | dev-python/pytz/pytz-2023.3-r1.ebuild (renamed from dev-python/pytz/pytz-2023.3.ebuild) | 0 |
3 files changed, 4 insertions, 3 deletions
diff --git a/dev-python/pytz/files/pytz-2023.2-system-tzinfo.patch b/dev-python/pytz/files/pytz-2023.2-system-tzinfo.patch index 1e64f1bd2fa4..85b639f0e615 100644 --- a/dev-python/pytz/files/pytz-2023.2-system-tzinfo.patch +++ b/dev-python/pytz/files/pytz-2023.2-system-tzinfo.patch @@ -7,7 +7,7 @@ diff --git a/pytz/__init__.py b/pytz/__init__.py index f89d0eb..d00f3bb 100644 --- a/pytz/__init__.py +++ b/pytz/__init__.py -@@ -75,6 +75,20 @@ else: # Python 2.x +@@ -75,6 +75,21 @@ else: # Python 2.x return s.encode('ASCII') @@ -15,8 +15,9 @@ index f89d0eb..d00f3bb 100644 + for dirpath, dirnames, filenames in os.walk(_PYTZ_TZDATADIR): + for f in filenames: + p = os.path.join(dirpath, f) -+ if open(p, 'rb').read(4) == b'TZif': -+ yield os.path.relpath(p, _PYTZ_TZDATADIR) ++ with open(p, 'rb') as tzfile: ++ if tzfile.read(4) == b'TZif': ++ yield os.path.relpath(p, _PYTZ_TZDATADIR) + + +_PYTZ_TZDATADIR = os.environ.get('PYTZ_TZDATADIR', '/usr/share/zoneinfo') diff --git a/dev-python/pytz/pytz-2023.2-r1.ebuild b/dev-python/pytz/pytz-2023.2-r2.ebuild index eea96064ba6e..eea96064ba6e 100644 --- a/dev-python/pytz/pytz-2023.2-r1.ebuild +++ b/dev-python/pytz/pytz-2023.2-r2.ebuild diff --git a/dev-python/pytz/pytz-2023.3.ebuild b/dev-python/pytz/pytz-2023.3-r1.ebuild index eea96064ba6e..eea96064ba6e 100644 --- a/dev-python/pytz/pytz-2023.3.ebuild +++ b/dev-python/pytz/pytz-2023.3-r1.ebuild |