Merge lp:~benji/launchpad/bug-742662-2 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Benji York |
Approved revision: | no longer in the source branch. |
Merged at revision: | 13957 |
Proposed branch: | lp:~benji/launchpad/bug-742662-2 |
Merge into: | lp:launchpad |
Diff against target: |
180 lines (+54/-30) 3 files modified
lib/lp/translations/utilities/sanitize.py (+49/-23) lib/lp/translations/utilities/tests/test_file_importer.py (+3/-4) lib/lp/translations/utilities/tests/test_sanitize.py (+2/-3) |
To merge this branch: | bzr merge lp:~benji/launchpad/bug-742662-2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Kowalik (community) | code | Approve | |
Review via email: mp+75248@code.launchpad.net |
Commit message
[r=stevenk][bug=742662] remove the validation of grandfathered-in translation data with mixed newlines
Description of the change
Bug 742662 describes a scenario in which very old imported translations
can contain mixed newlines (\r as well as \n). The fix (discovered by
doing an intra-implement
mixed newlines in already-imported translations while preserving the
current behavior of disallowing any new imports with mixed newlines.
Since there was already two import sanitization functions
(sanitize_
which were just references to one-another, it was easy to provide new
definitions that behave as desired.
The only semi-invasive thing I had to do was to rework the place at
which the MixedNewlineMar
introduction of the new mixed_style constant in the Sanitizer class and
the new handling thereof.
The tests had to be slightly modified to account for the new behavior.
Tests: bin/test -c -m lp.translations
Lint: several pre-existing lint errors were fixed
QA: I would say to use the reproduction instructions on bug 742662 on
qastaging, but I can't reproduce the error now, so I'll have to figure
something else out.
This looks good. My only comment would be to fix the indentation for the sanitize_ translations_ from_webui( ) function.