← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~sinzui/launchpad/poimport-typeerror into lp:launchpad

 

The proposal to merge lp:~sinzui/launchpad/poimport-typeerror into lp:launchpad has been updated.

Description changed to:

The TypeError happens when the script is trying to log an error. All the
data is sanitised except for the call to
potmsgset.getSequence(self.potemplate) to get the sequence. This can be
None if the TTI is incomplete. We just want to ensure the data is sane
enough so that we can log the error.

--------------------------------------------------------------------

RULES

    Pre-implementation: stevenk, jcsackett
    * Extract the logic that makes the error email to a separate testable
      method.
    * Add a test for the current behaviour.
    * Update the method to fallback to -1 if the sequence is None
    * Revise the loop to avoid needless string concatenation of errordetails

QA

    * Untestable, the case happens when the object is in an invalid state.

LINT

    lib/lp/translations/model/pofile.py
    lib/lp/translations/tests/test_pofile.py

LoC

    I have a credit of 4000 lines.

TEST

    ./bin/test -vvc -t prepare_pomessage lp.translations.tests.test_pofile

IMPLEMENTATION

Extracted the logic to a method and added a test. Added a rule to use -1
of the sequence is None.
    lib/lp/translations/model/pofile.py
    lib/lp/translations/tests/test_pofile.py

For more details, see:
https://code.launchpad.net/~sinzui/launchpad/poimport-typeerror/+merge/133713
-- 
https://code.launchpad.net/~sinzui/launchpad/poimport-typeerror/+merge/133713
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~sinzui/launchpad/poimport-typeerror into lp:launchpad.


References