PIL is reporting stuff via warning.warn #1084

Closed
ralsina opened this Issue Mar 1, 2014 · 5 comments

Comments

Projects
None yet
2 participants
Owner

ralsina commented Mar 1, 2014

And it looks bad in nikola's output. Here's an example:

/home/ralsina/.virtualenvs/nikola/local/lib/python2.7/site-packages/PIL/TiffImagePlugin.py:451: UserWarning: Possibly corrupt EXIF data.  Expecting to read 1769472 bytes but only got 0. Skipping tag 0
  warnings.warn("Possibly corrupt EXIF data.  Expecting to read %d bytes but only got %d. Skipping tag %s" % (size, len(data), tag))
/home/ralsina/.virtualenvs/nikola/local/lib/python2.7/site-packages/PIL/TiffImagePlugin.py:451: UserWarning: Possibly corrupt EXIF data.  Expecting to read 2883584 bytes but only got 0. Skipping tag 0
  warnings.warn("Possibly corrupt EXIF data.  Expecting to read %d bytes but only got %d. Skipping tag %s" % (size, len(data), tag))

@ralsina ralsina added bug minor labels Mar 1, 2014

@Kwpolska Kwpolska modified the milestone: v6.4.0, v6.5.0 Mar 1, 2014

Owner

Kwpolska commented Mar 1, 2014

The documentation explicitly states that we should override warnings.showwarning(message, category, filename, lineno[, file[, line]]) with something of our own (i.e. calling our logger)

Owner

Kwpolska commented Mar 1, 2014

Well, provided that it works with logbook, which it might not, in which case we should fall back to the override scenario.

@ralsina ralsina modified the milestone: v7.0.0, v6.5.0 Mar 22, 2014

ralsina self-assigned this Mar 23, 2014

ralsina added the in progress label Mar 23, 2014

Owner

ralsina commented Mar 23, 2014

Both logging.captureWarnings and logbook.compat.redirect_warnings make warnings disappear, which is surprising. I don't understand enough of how logging is setup to know where they go.

ralsina removed the in progress label Mar 23, 2014

ralsina removed their assignment Mar 23, 2014

@ralsina ralsina modified the milestone: Whenever, v7.0.0 Apr 18, 2014

Kwpolska closed this in 577c9fc May 4, 2014

Kwpolska self-assigned this May 4, 2014

Owner

Kwpolska commented May 4, 2014

Done via overriding showwarning as captureWarnings/redirect_warnings seem to be broken for us. (logging is crazy!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment