Author gregory.p.smith
Recipients NewerCookie, alanmcintyre, amaury.forgeotdarc, apolkosnik, chuck, ethan.furman, georg.brandl, gregory.p.smith, ncoghlan, ronaldoussoren, serhiy.storchaka, terry.reedy
Date 2014-04-30.07:23:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1398842605.59.0.546249937639.issue6839@psf.upfronthosting.co.za>
In-reply-to
Content
Don't use print (to stdout) or sys.stderr directly.  There are already many other uses of warnings.warn within the zipfile module.  Be consistent with those.

Existing zipfile warnings seem to favor lazily importing warnings when its needed rather than a top level 'import warnings'.  While I find that annoying, there are sometimes reasons to do it and the minimally invasive change that is consistent with the rest of the existing code is to do the same thing here.

something similar to:

+            if self.debug and fname != zinfo.orig_filename:
+                import warnings
+                warnings.warn(
+                        'Warning: Filename in directory "%s" and header "%s" differ.' % (
+                            zinfo.orig_filename, fname))
History
Date User Action Args
2014-04-30 07:23:25gregory.p.smithsetrecipients: + gregory.p.smith, georg.brandl, terry.reedy, ronaldoussoren, amaury.forgeotdarc, ncoghlan, alanmcintyre, NewerCookie, chuck, ethan.furman, serhiy.storchaka, apolkosnik
2014-04-30 07:23:25gregory.p.smithsetmessageid: <1398842605.59.0.546249937639.issue6839@psf.upfronthosting.co.za>
2014-04-30 07:23:25gregory.p.smithlinkissue6839 messages
2014-04-30 07:23:25gregory.p.smithcreate