En Tue, 22 May 2007 14:22:25 -0300, <[EMAIL PROTECTED]> escribió: > I'm using the code below to read the zipped, base64 encoded WMF file > saved in an XML file with "Save as XML" from MS Word. As the "At this > point" comment shows, I know that the base64 decoding is going fine, > but unzipping from the decodedVersion StringIO object isn't getting me > anything, because the len(fileContent) call is returning 0. Any > suggestions?
Perhaps GzipFile reads from the current position till end (and sees nothing). Try rewinding the file: > decodedVersion = StringIO.StringIO() > base64.decode(open(infile, 'r'),decodedVersion) decodedVersion.seek(0) > fileObj = gzip.GzipFile(fileobj=decodedVersion); > fileContent = fileObj.read() > print len(fileContent) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list