[Python-modules-commits] r20930 - in packages/python3-dateutil/trunk/debian/patches (2 files)

takluyver-guest at users.alioth.debian.org takluyver-guest at users.alioth.debian.org
Sun Mar 25 18:30:22 UTC 2012


    Date: Sunday, March 25, 2012 @ 18:30:20
  Author: takluyver-guest
Revision: 20930

Patch to fix reading binary timezone files.

Added:
  packages/python3-dateutil/trunk/debian/patches/read-tz.patch
Modified:
  packages/python3-dateutil/trunk/debian/patches/series

Added: packages/python3-dateutil/trunk/debian/patches/read-tz.patch
===================================================================
--- packages/python3-dateutil/trunk/debian/patches/read-tz.patch	                        (rev 0)
+++ packages/python3-dateutil/trunk/debian/patches/read-tz.patch	2012-03-25 18:30:20 UTC (rev 20930)
@@ -0,0 +1,25 @@
+Date: Sun Mar 25 19:26:47 BST 2012
+Author: Thomas Kluyver <thomas at kluyver.me.uk>
+Subject: Fix reading binary tzinfo files.
+
+Will forward upstream
+--- a/dateutil/tz.py
++++ b/dateutil/tz.py
+@@ -196,7 +196,7 @@
+     def __init__(self, fileobj):
+         if isinstance(fileobj, str):
+             self._filename = fileobj
+-            fileobj = open(fileobj)
++            fileobj = open(fileobj, "rb")
+         elif hasattr(fileobj, "name"):
+             self._filename = fileobj.name
+         else:
+@@ -212,7 +212,7 @@
+         # ``standard'' byte order (the high-order  byte
+         # of the value is written first).
+ 
+-        if fileobj.read(4).decode() != "TZif":
++        if fileobj.read(4) != b"TZif":
+             raise ValueError("magic not found")
+ 
+         fileobj.read(16)

Modified: packages/python3-dateutil/trunk/debian/patches/series
===================================================================
--- packages/python3-dateutil/trunk/debian/patches/series	2012-03-25 12:54:32 UTC (rev 20929)
+++ packages/python3-dateutil/trunk/debian/patches/series	2012-03-25 18:30:20 UTC (rev 20930)
@@ -1,3 +1,4 @@
 Use-C-locale-when-calling-date.patch
 update-readme.patch
 test-3.2.patch
+read-tz.patch




More information about the Python-modules-commits mailing list