Revision: 8404 Author: xqt Date: 2010-08-14 22:02:23 +0000 (Sat, 14 Aug 2010)
Log Message: ----------- gzip support for xmlreader.py (patch request bug #3029423 by emijrp. Thanks)
Modified Paths: -------------- trunk/pywikipedia/xmlreader.py
Modified: trunk/pywikipedia/xmlreader.py =================================================================== --- trunk/pywikipedia/xmlreader.py 2010-08-14 21:34:34 UTC (rev 8403) +++ trunk/pywikipedia/xmlreader.py 2010-08-14 22:02:23 UTC (rev 8404) @@ -294,6 +294,9 @@ if self.filename.endswith('.bz2'): import bz2 source = bz2.BZ2File(self.filename) + elif self.filename.endswith('.gz'): + import gzip + source = gzip.open(self.filename) elif self.filename.endswith('.7z'): import subprocess source = subprocess.Popen('7za e -bd -so %s 2>/dev/null'