POSyntaxWarning lacks contextual information

Bug #1773 reported by Stuart Bishop
6
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Jeroen T. Vermeulen

Bug Description

I'm seeing the following warning in the appserver log files:

 2005-08-15T12:14:42 WARNING root The plural form header has an unknown error. Using the default value...

This doesn't give us any useful information to know which plural form header needs fixing.

If we arn't going to fix them, we shouldn't bother logging.

Revision history for this message
Christian Reis (kiko) wrote :

That's interesting -- in the logs which are mailed to us, an exception (which is the root cause of the problem) comes right before the message. We could change the warning to say at least what pofile is being processed, add even more detail, or remove it -- I'm not sure which is best.

Revision history for this message
Stuart Bishop (stub) wrote : Re: [Bug 1773] unhelpful warning in logs

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)

Christian Reis via Malone wrote:
> Public bug report changed:
> https://launchpad.net/malone/bugs/1773
>
> Comment:
> That's interesting -- in the logs which are mailed to us, an exception (which is
> the root cause of the problem) comes right before the message. We could change
> the warning to say at least what pofile is being processed, add even more
> detail, or remove it -- I'm not sure which is best.

If the logs are being emailed, is their any reason to be outputting them to
 the Z3 logger as well? Remove the noise if possible - the error log should
be logging errors indicating new bugs and problems, and becomes useless if
filled up with cruft (but I have no problem with developers spewing stuff
out at INFO or DEBUG levels if it helps them develop - just leave WARNING
and ERROR for stuff that needs to be dealt with).

--
Stuart Bishop <email address hidden> http://www.canonical.com/
Canonical Ltd. http://www.ubuntu.com/

Revision history for this message
Christian Reis (kiko) wrote : Re: unhelpful warning in logs

Actually, the issue is that POSyntaxWarning doesn't indicate /what/ pofile it is referring to. This is indeed a problem.

Changed in rosetta:
status: New → Accepted
Revision history for this message
Dafydd Harries (daf) wrote :

It will be difficult to fix this unless we know which bit of code is causing the warning. Once we know that, we can catch the warning and add extra information about which PO file caused it to the log.

Revision history for this message
Steve Alexander (stevea) wrote :

The code is in launchpad/components/poparser.py, line 449 or so.

The poparser needs to get some metadata about the file it is parsing, so that it can say what file and line number has the problem. (Or, we could install a logger for this that knows what the file being parsed is.)

Also, the warning is specifically about the 'nplurals' part of the plural-form header not being parseable as an int. We should record the actual text of 'nplurals' in the warning.

Once we've done this, we can look at what is actually causing the warnings, and decide how best to accommodate quietly or continue to warn.

Changed in rosetta:
assignee: nobody → jtv
Changed in rosetta:
status: Confirmed → In Progress
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

This output really should not be reported to admins in the first place (bug 35430). They're not even errors, merely warnings. Of course it would be nice to report them to uploaders instead; see bug 148425.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Fixed in RF 4973.

Changed in rosetta:
status: In Progress → Fix Committed
Changed in rosetta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.