Update to 2.5.0

Patch1 is not necessary, issue was fixed upstream in a different way.
Patch0 is dropped, because upstream recommends usings a different function,
and I don't want to keep updating this local patch. If there are problems
cause by dropping this patch, we can either fix the users or restore it.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-02-28 19:39:08 -05:00
parent f4dc26989e
commit 09a95eb45a
5 changed files with 14 additions and 74 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
/python-dateutil-2.2.tar.gz
/2.4.0.tar.gz
/2.4.2.tar.gz
/python-dateutil-2.5.0.tar.gz

View File

@ -1,50 +0,0 @@
--- dateutil/zoneinfo/__init__.py
+++ dateutil/zoneinfo/__init__.py
@@ -14,9 +14,10 @@
__all__ = ["setcachesize", "gettz", "rebuild"]
-_ZONEFILENAME = "dateutil-zoneinfo.tar.gz"
+_LOCAL_ZONEINFO_FILE = "dateutil-zoneinfo.tar.gz"
+_SYSTEM_ZONEINFO_DIR = "/usr/share/zoneinfo"
-# python2.6 compatability. Note that TarFile.__exit__ != TarFile.close, but
+# python2.6 compatibility. Note that TarFile.__exit__ != TarFile.close, but
# it's close enough for python2.6
_tar_open = TarFile.open
if not hasattr(TarFile, '__exit__'):
@@ -31,9 +32,8 @@
def getzoneinfofile_stream():
try:
- return BytesIO(get_data(__name__, _ZONEFILENAME))
+ return BytesIO(get_data(__name__, _LOCAL_ZONEINFO_FILE))
except IOError as e: # TODO switch to FileNotFoundError?
- warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror))
return None
@@ -59,6 +59,14 @@
self.zones.update(links)
else:
self.zones = dict()
+ if os.path.isdir(_SYSTEM_ZONEINFO_DIR):
+ for root, dirnames, filenames in os.walk(_SYSTEM_ZONEINFO_DIR):
+ for filename in filenames:
+ absolute_filename = os.path.join(root, filename)
+ relative_filename = absolute_filename[len(_SYSTEM_ZONEINFO_DIR)+1:]
+ with open(absolute_filename, "rb") as file:
+ if file.read(4) == b"TZif":
+ self.zones[relative_filename] = tzfile(absolute_filename, relative_filename)
# The current API has gettz as a module function, although in fact it taps into
@@ -99,7 +107,7 @@
"libc-bin or some other package that provides it, "
"or it's not in your PATH?")
raise
- target = os.path.join(moduledir, _ZONEFILENAME)
+ target = os.path.join(moduledir, _LOCAL_ZONEINFO_FILE)
with _tar_open(target, "w:%s" % format) as tf:
for entry in os.listdir(zonedir):
entrypath = os.path.join(zonedir, entry)

View File

@ -1,13 +0,0 @@
diff --git dateutil/parser.py~ dateutil/parser.py
index 8b6c2d28b8..75453ef49e 100644
--- dateutil/parser.py~
+++ dateutil/parser.py
@@ -32,7 +32,7 @@ __all__ = ["parse", "parserinfo"]
class _timelex(object):
def __init__(self, instream):
- if isinstance(instream, text_type):
+ if not hasattr(instream, 'read'):
instream = StringIO(instream)
self.instream = instream
self.wordchars = ('abcdfeghijklmnopqrstuvwxyz'

View File

@ -1,16 +1,13 @@
Name: python-dateutil
Version: 2.4.2
Release: 4%{?dist}
Version: 2.5.0
Release: 1%{?dist}
Epoch: 1
Summary: Powerful extensions to the standard datetime module
Group: Development/Languages
License: Python
URL: https://github.com/dateutil/dateutil
Source0: https://github.com/dateutil/dateutil/archive/%{version}.tar.gz
# https://github.com/dateutil/dateutil/issues/11
Patch0: python-dateutil-system-zoneinfo.patch
Patch1: python-dateutil-timelex-string.patch
Source0: https://github.com/dateutil/dateutil/archive/%{version}.tar.gz#/python-dateutil-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
@ -55,13 +52,13 @@ iconv --from=ISO-8859-1 --to=UTF-8 NEWS > NEWS.new
mv NEWS.new NEWS
%build
%{__python2} setup.py build
%{__python3} setup.py build
%py2_build
%py3_build
make -C docs html
%install
%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
%py2_install
%py3_install
%check
%{__python2} setup.py test
@ -84,6 +81,11 @@ make -C docs html
%doc docs/_build/html
%changelog
* Mon Feb 29 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@bupkis> - 1:2.5.0-1
- Update to latest upstream version
- The patch to make dateutil.zoneinfo.gettz() use the system database is dropped.
Upstream recommends using dateutil.tz.gettz() instead.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.4.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

View File

@ -1 +1 @@
b22e2b212813f06955bbb36cada93551 2.4.2.tar.gz
80c96851670122fa9b4083ee5fc0ef3b python-dateutil-2.5.0.tar.gz