components/python/pytz/patches/01-zoneinfopath.patch
author Laszlo Peter <laszlo.peter@oracle.com>
Wed, 13 Jul 2016 14:48:26 -0700
changeset 6410 3ae42b2b5dad
parent 3998 components/python/pytz/patches/zoneinfopath.patch@5bd484384122
permissions -rw-r--r--
PSARC/2016/355 cachetools - Extensible memoizing collections and decorators PSARC/2016/356 funcsigs - Backport of the PEP 362 function signature features from Python 3.3's inspect module PSARC/2016/358 pika-pool - pika connection pooling library PSARC/2016/362 pika - Python AMQP client library PSARC/2016/402 appdirs - Platform-specific application directories Python module PSARC/2016/430 requestsexceptions - find the path to exceptions in the requests library PSARC/2016/431 python-editor - Programmatically open an editor, capture the result PSARC/2016/432 rJSmin - Javascript Minifier PSARC/2016/433 unicodecsv - CSV python module with unicode support 22996389 The appdirs module should be added to Userland 22960798 The Python module cachetools should be added to Userland 22961272 The Python module funcsigs should be added to Userland 23528657 The Python pika module should be added to Userland 23520215 The Python pika-pool module should be added to Userland 23757060 The python-editor module should be added to Userland 23757078 The rJSmin python modules should be added to Userland 23757069 The requestsexceptions python module should be added to Userland 23757082 The unicodecsv python module should be added to Userland 23747719 update Babel to 2.3.4 23206271 Upgrade cffi to 1.5.2 23206346 Upgrade enum to 1.1.6 23206525 Upgrade filechunkio 1.6 23206568 Upgrade formencode to 1.3.0 23206878 Upgrade librabbitmq to 1.6.1 23206931 Upgrade markdown to 2.6.6 23206993 Upgrade markupsafe to 0.23 23119312 Upgrade pygments to 2.1.3 23207180 Upgrade pyparsing to 2.1.4 23207199 Upgrade pyrabbit to 1.1.0 23207670 Upgrade pytz to 2016.4 23209215 Upgrade rfc3986 to 0.3.1 23210233 Upgrade waitress to 0.9.0 23210235 Upgrade webtest to 2.0.21 23760103 Incorrect version of pymemcache delivered

pytz by default ships a private copy of the Olson timezone database, for
operating systems that don't ship their own.  Since Solaris does, we should
point at that copy.  The extra table files are in different places between
the two, so we adjust those paths as well.

--- pytz-2016.4/pytz/__init__.py.~1~	2016-05-19 12:19:35.788693592 -0700
+++ pytz-2016.4/pytz/__init__.py	2016-05-19 12:42:59.605991654 -0700
@@ -86,8 +86,7 @@
     for part in name_parts:
         if part == os.path.pardir or os.path.sep in part:
             raise ValueError('Bad path segment: %r' % part)
-    filename = os.path.join(os.path.dirname(__file__),
-                            'zoneinfo', *name_parts)
+    filename = os.path.join('/usr/share/lib/zoneinfo', *name_parts)
     if not os.path.exists(filename) and resource_stream is not None:
         # http://bugs.launchpad.net/bugs/383171 - we avoid using this
         # unless absolutely necessary to help when a broken version of
@@ -326,13 +325,15 @@
 
     def _fill(self):
         data = {}
-        zone_tab = open_resource('zone.tab')
+        zone_tab = open_resource('tab/zone_sun.tab')
         try:
             for line in zone_tab:
                 line = line.decode('UTF-8')
                 if line.startswith('#'):
                     continue
                 code, coordinates, zone = line.split(None, 4)[:3]
+                if not code.isupper():
+                    continue
                 if zone not in all_timezones_set:
                     continue
                 try:
@@ -354,13 +355,15 @@
     '''
     def _fill(self):
         data = {}
-        zone_tab = open_resource('iso3166.tab')
+        zone_tab = open_resource('tab/country.tab')
         try:
             for line in zone_tab.readlines():
                 line = line.decode('UTF-8')
                 if line.startswith('#'):
                     continue
                 code, name = line.split(None, 1)
+                if not code.isupper():
+                    continue
                 data[code] = name.strip()
             self.data = data
         finally: