File: tzdata

package info (click to toggle)
python-tz 2022.7.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,100 kB
  • sloc: python: 2,110; makefile: 16
file content (34 lines) | stat: -rw-r--r-- 1,496 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Description: Use system zone information from the tzdata package
Author: Kurt Roeckx <kurt@roeckx.be>
Author: Hilko Bengen <bengen@debian.org>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416202
Forwarded: not-needed
Last-Update: 2018-02-14

Index: pytz-2018.3/pytz/tzfile.py
===================================================================
--- pytz-2018.3.orig/pytz/tzfile.py
+++ pytz-2018.3/pytz/tzfile.py
@@ -126,7 +126,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',
Index: pytz-2018.3/pytz/__init__.py
===================================================================
--- pytz-2018.3.orig/pytz/__init__.py
+++ pytz-2018.3/pytz/__init__.py
@@ -94,7 +94,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