Merge Christopher Corley's changes
diff --git a/README b/README
index 9453699..39735e7 100644
--- a/README
+++ b/README
@@ -80,7 +80,9 @@
   * attachment:python-dateutil-1.0-1.noarch.rpm
 
 == Author ==
-The dateutil module was written by GustavoNiemeyer <gustavo@niemeyer.net>.
+The dateutil module was written by Gustavo Niemeyer <gustavo@niemeyer.net> and
+is currently maintained by Tomi Pieviläinen <tomi.pievilainen@iki.fi>. The latest
+code is available in [https://launchpad.net/dateutil Launchpad].
 
 == Documentation ==
 The following modules are available.
@@ -1967,4 +1969,17 @@
 tzfile('Brazil/East')
 }}}
 
+== Building ==
+When you get the source, it does not contain the internal zoneinfo
+database. To get (and update) the database, run the updatezinfo.py script. Make sure
+that the zic command is in your path, and that you have network connectivity
+to get the latest timezone information from IANA. If you have downloaded
+the timezone data earlier, you can give the tarball as a parameter to
+updatezinfo.py.
+
+== Testing ==
+dateutil has a comprehensive test suite, which can be run simply by running the
+test.py script in the project root. Note that if you don't have the internal
+zoneinfo database, some tests will fail. Apart from that, all tests should pass.
+
 ## vim:ft=moin
diff --git a/dateutil/zoneinfo/__init__.py b/dateutil/zoneinfo/__init__.py
index a1b3487..81db140 100644
--- a/dateutil/zoneinfo/__init__.py
+++ b/dateutil/zoneinfo/__init__.py
@@ -5,9 +5,12 @@
 This module offers extensions to the standard Python
 datetime module.
 """
-from dateutil.tz import tzfile
-from tarfile import TarFile
+import logging
 import os
+from subprocess import call
+from tarfile import TarFile
+
+from dateutil.tz import tzfile
 
 __author__ = "Tomi Pieviläinen <tomi.pievilainen@iki.fi>"
 __license__ = "Simplified BSD"
@@ -58,6 +61,11 @@
     return tzinfo
 
 def rebuild(filename, tag=None, format="gz"):
+    """Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*
+
+    filename is the timezone tarball from ftp.iana.org/tz.
+
+    """
     import tempfile, shutil
     tmpdir = tempfile.mkdtemp()
     zonedir = os.path.join(tmpdir, "zoneinfo")
@@ -75,7 +83,18 @@
                     name == "leapseconds"):
                 tf.extract(name, tmpdir)
                 filepath = os.path.join(tmpdir, name)
-                os.system("zic -d %s %s" % (zonedir, filepath))
+                try:
+                    # zic will return errors for nontz files in the package
+                    # such as the Makefile or README, so check_call cannot
+                    # be used (or at least extra checks would be needed)
+                    call(["zic", "-d", zonedir, filepath])
+                except OSError as e:
+                    if e.errno == 2:
+                        logging.error(
+                            "Could not find zic. Perhaps you need to install "
+                            "libc-bin or some other package that provides it, "
+                            "or it's not in your PATH?")
+                    raise
         tf.close()
         target = os.path.join(moduledir, targetname)
         for entry in os.listdir(moduledir):
diff --git a/test.py b/test.py
index 4ec2c1f..394992c 100755
--- a/test.py
+++ b/test.py
@@ -10,14 +10,14 @@
 
 # Add build directory to search path
 if os.path.exists("build"):
-	from distutils.util import get_platform
-	import sys
-	if sys.version_info >= (3, 2):
-		s = "build/lib"
-	else:
-		s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
-	s = os.path.join(os.getcwd(), s)
-	sys.path.insert(0, s)
+    from distutils.util import get_platform
+    import sys
+    if sys.version_info >= (3, 2):
+        s = "build/lib"
+    else:
+        s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
+    s = os.path.join(os.getcwd(), s)
+    sys.path.insert(0, s)
 
 from dateutil.relativedelta import *
 from dateutil.parser import *
@@ -4017,6 +4017,6 @@
 
 
 if __name__ == "__main__":
-	unittest.main()
+    unittest.main()
 
 # vim:ts=4:sw=4