From: Kurt Roeckx <kurt@roeckx.be>
Date: Mon, 6 May 2024 17:25:43 +0800
Subject: Use system zone information from the tzdata package

Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416202
Forwarded: not-needed
Last-Update: 2018-02-14
---
 pytz/__init__.py | 2 +-
 pytz/tzfile.py   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pytz/__init__.py b/pytz/__init__.py
index 2355f8b..6742324 100644
--- a/pytz/__init__.py
+++ b/pytz/__init__.py
@@ -92,7 +92,7 @@ def open_resource(name):
     if zoneinfo_dir is not None:
         filename = os.path.join(zoneinfo_dir, *name_parts)
     else:
-        filename = os.path.join(os.path.dirname(__file__),
+        filename = os.path.join('/usr','share',
                                 'zoneinfo', *name_parts)
         if not os.path.exists(filename):
             # http://bugs.launchpad.net/bugs/383171 - we avoid using this
diff --git a/pytz/tzfile.py b/pytz/tzfile.py
index 99e7448..f791424 100644
--- a/pytz/tzfile.py
+++ b/pytz/tzfile.py
@@ -125,7 +125,8 @@ def build_tzinfo(zone, fp):
 if __name__ == '__main__':
     import os.path
     from pprint import pprint
-    base = os.path.join(os.path.dirname(__file__), 'zoneinfo')
+    # Patched in Debian, use the system zoninfo from the tzdata package
+    base = '/usr/share/zoneinfo'
     tz = build_tzinfo('Australia/Melbourne',
                       open(os.path.join(base, 'Australia', 'Melbourne'), 'rb'))
     tz = build_tzinfo('US/Eastern',
