Merge lp:~henninge/launchpad/devel-bug-666660-poimport-oops into lp:launchpad

Proposed by Henning Eggers
Status: Merged
Approved by: Henning Eggers
Approved revision: no longer in the source branch.
Merged at revision: 11834
Proposed branch: lp:~henninge/launchpad/devel-bug-666660-poimport-oops
Merge into: lp:launchpad
Diff against target: 25 lines (+1/-3)
2 files modified
lib/lp/translations/doc/potmsgset.txt (+0/-2)
lib/lp/translations/model/potmsgset.py (+1/-1)
To merge this branch: bzr merge lp:~henninge/launchpad/devel-bug-666660-poimport-oops
Reviewer Review Type Date Requested Status
Jonathan Lange (community) Approve
Steve Kowalik (community) code* Approve
Launchpad code reviewers code Pending
Review via email: mp+39653@code.launchpad.net

Commit message

Lower log level for "Translations ... match n existing translations." to INFO to avoid it being turned into an OOPS.

Description of the change

= Bug 666660 =

This bug is about OOPSes being generated for logging messages that are not severe enough to warrant that. The code deals with the situation nicely and simply means to leave a notice for statistical purposes. There really is nothing we could do about the situation that it is reporting, anyway.

== Proposed fix ==

Lower the logging level of the message to INFO because they won't get generate OOPSes then.

== Test ==

bin/test -vvct potmsgset.txt

== QA ==

Watch the error reports for the poimport script for OOPSes as described in the bug. They should not appear any more. But this is not really QA'able because of the sporadic nature of the occurrences.

No lint.

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) wrote :

This looks great!

review: Approve (code*)
Revision history for this message
Jonathan Lange (jml) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/translations/doc/potmsgset.txt'
--- lib/lp/translations/doc/potmsgset.txt 2010-10-27 18:30:31 +0000
+++ lib/lp/translations/doc/potmsgset.txt 2010-11-02 08:18:48 +0000
@@ -624,8 +624,6 @@
624 >>> message_with_one_form = pm_potmsgset.updateTranslation(624 >>> message_with_one_form = pm_potmsgset.updateTranslation(
625 ... pm_translation, pm_template.owner, ['%d fu'],625 ... pm_translation, pm_template.owner, ['%d fu'],
626 ... is_imported=False, lock_timestamp=datetime.now(pytz.UTC))626 ... is_imported=False, lock_timestamp=datetime.now(pytz.UTC))
627 WARNING:...Translation for POTMsgSet ... into 'zap' matches
628 2 existing translations.
629627
630 >>> message_with_one_form == message_with_two_forms628 >>> message_with_one_form == message_with_two_forms
631 True629 True
632630
=== modified file 'lib/lp/translations/model/potmsgset.py'
--- lib/lp/translations/model/potmsgset.py 2010-10-27 18:30:31 +0000
+++ lib/lp/translations/model/potmsgset.py 2010-11-02 08:18:48 +0000
@@ -557,7 +557,7 @@
557557
558 if len(matches) > 0:558 if len(matches) > 0:
559 if len(matches) > 1:559 if len(matches) > 1:
560 logging.warn(560 logging.info(
561 "Translation for POTMsgSet %s into %s "561 "Translation for POTMsgSet %s into %s "
562 "matches %s existing translations." % sqlvalues(562 "matches %s existing translations." % sqlvalues(
563 self, pofile.language.code, len(matches)))563 self, pofile.language.code, len(matches)))