Run of fresh-releases for python-tzlocal

Try this locally (using silver-platter):

debian-svp new-upstream python-tzlocal 

Merge these changes:

git pull https://janitor.debian.net/git/python-tzlocal fresh-releases/main

Summary

Merged new upstream version: 2.0.0b3 (was: 2.0.0b2).

Diff

=== modified file 'CHANGES.txt'
--- a/CHANGES.txt	2019-06-18 11:05:50 +0000
+++ b/CHANGES.txt	2019-09-04 09:30:07 +0000
@@ -1,6 +1,15 @@
 Changes
 =======
 
+2.0.0b3 (2019-07-13)
+--------------------
+
+- When no time zone configuration can be find, tzlocal now return UTC.
+  This is a major difference from 1.x, where an exception would be raised.
+  This change is because Docker images often have no configuration at all,
+  and the unix utilities will then default to UTC, so we follow that.
+
+
 2.0.0b2 (2019-05-31)
 --------------------
 

=== modified file 'README.rst'
--- a/README.rst	2019-06-18 11:05:50 +0000
+++ b/README.rst	2019-09-04 09:30:07 +0000
@@ -40,7 +40,7 @@
 name from that symlink.
 
 If you need the name of your local time zone, then please make sure your system is properly configured to allow that.
-
+If it isn't configured, tzlocal will default to UTC.
 
 Usage
 -----

=== modified file 'debian/changelog'
--- a/debian/changelog	2019-09-01 13:06:09 +0000
+++ b/debian/changelog	2019-09-04 09:30:07 +0000
@@ -1,3 +1,9 @@
+python-tzlocal (2.0.0b3-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Wed, 04 Sep 2019 09:29:58 +0000
+
 python-tzlocal (2.0.0b2-3) unstable; urgency=medium
 
   * Restore python2 support, still needed by two other packages.

=== modified file 'setup.py'
--- a/setup.py	2019-06-18 11:05:50 +0000
+++ b/setup.py	2019-09-04 09:30:07 +0000
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 from io import open
 
-version = '2.0.0b2'
+version = '2.0.0b3'
 
 with open("README.rst", 'rt', encoding='UTF-8') as file:
     long_description = file.read() + '\n\n'

=== modified file 'tests/tests.py'
--- a/tests/tests.py	2019-06-18 11:05:50 +0000
+++ b/tests/tests.py	2019-09-04 09:30:07 +0000
@@ -6,6 +6,10 @@
 import unittest
 
 from datetime import datetime
+try:
+    from cStringIO import StringIO  # Python 2
+except ImportError:
+    from io import StringIO  # Python 3
 
 from tzlocal import utils
 
@@ -100,8 +104,17 @@
         self.assertEqual(tz_harare.zone, 'Africa/Johannesburg')
 
     def test_fail(self):
-        with self.assertRaises(pytz.exceptions.UnknownTimeZoneError):
-            tz = tzlocal.unix._get_localzone(_root=os.path.join(self.path, 'test_data'))
+        out = StringIO()
+        stderr = sys.stderr
+        try:
+            sys.stderr = out
+            tz = tzlocal.unix._get_localzone(
+                _root=os.path.join(self.path, 'test_data'))
+        finally:
+            sys.stderr = stderr
+        self.assertEqual(tz, pytz.utc)
+        self.assertIn('Can not find any timezone configuration',
+            out.getvalue())
 
     def test_assert_tz_offset(self):
         # The local zone should be the local zone:

=== modified file 'tzlocal/unix.py'
--- a/tzlocal/unix.py	2019-06-18 11:05:50 +0000
+++ b/tzlocal/unix.py	2019-09-04 09:30:07 +0000
@@ -1,6 +1,7 @@
 import os
 import pytz
 import re
+import warnings
 
 from tzlocal import utils
 
@@ -154,8 +155,8 @@
         with open(tzpath, 'rb') as tzfile:
             return pytz.tzfile.build_tzinfo('local', tzfile)
 
-    raise pytz.UnknownTimeZoneError('Can not find any timezone configuration')
-
+    warnings.warn('Can not find any timezone configuration, defaulting to UTC.')
+    return pytz.utc
 
 def get_localzone():
     """Get the computers configured local timezone, if any."""

=== modified file 'tzlocal/windows_tz.py'
--- a/tzlocal/windows_tz.py	2019-06-18 11:05:50 +0000
+++ b/tzlocal/windows_tz.py	2019-09-04 09:30:07 +0000
@@ -533,6 +533,7 @@
  'Etc/GMT-7': 'SE Asia Standard Time',
  'Etc/GMT-8': 'Singapore Standard Time',
  'Etc/GMT-9': 'Tokyo Standard Time',
+ 'Etc/UCT': 'UTC',
  'Etc/UTC': 'UTC',
  'Europe/Amsterdam': 'W. Europe Standard Time',
  'Europe/Andorra': 'W. Europe Standard Time',
@@ -676,6 +677,7 @@
  'ROK': 'Korea Standard Time',
  'Singapore': 'Singapore Standard Time',
  'Turkey': 'Turkey Standard Time',
+ 'UCT': 'UTC',
  'US/Alaska': 'Alaskan Standard Time',
  'US/Aleutian': 'Aleutian Standard Time',
  'US/Arizona': 'US Mountain Standard Time',

=== modified file 'update_windows_mappings.py'
--- a/update_windows_mappings.py	2018-02-13 06:40:05 +0000
+++ b/update_windows_mappings.py	2019-09-04 09:30:07 +0000
@@ -16,7 +16,7 @@
 from urllib.request import urlopen
 from xml.dom import minidom
 
-WIN_ZONES_URL = 'http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml'
+WIN_ZONES_URL = 'https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml'
 ZONEINFO_URL = 'ftp://ftp.iana.org/tz/tzdata-latest.tar.gz'
 
 logging.basicConfig(level=logging.INFO)

Full build log Full worker log