Closed
Bug 672029
Opened 14 years ago
Closed 13 years ago
[compare-locales] Unable to parse .properties files with lots of comments at the end
Categories
(Mozilla Localizations :: Infrastructure, defect)
Mozilla Localizations
Infrastructure
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: florian, Assigned: Pike)
References
Details
Attachments
(1 file)
690 bytes,
patch
|
Pike
:
review-
|
Details | Diff | Splinter Review |
When attempting to read this file https://hg.instantbird.org/l10n/pt-PT/file/ccfb2f1354e3/purple/myspace.properties compare-locales makes Python take 100% of the CPU for a very long time and ends up killed by our buildbot after 20 minutes without any output.
Assignee | ||
Comment 1•14 years ago
|
||
I thought I had a bug on this, but I can't find it.
The problem is that the regular expression in http://hg.mozilla.org/l10n/compare-locales/file/15f42a0ed926/lib/Mozilla/Parser.py#l268 doesn't cope will with lengthy comments. What in
re.compile('^(\s*)((?:[#!].*?\n\s*)*)(([^#!\s\n][^=:\n]*?)\s*[:=][ \t]*((?:[^\\\\]|\\\\.)*?))([ \t]*$\n?)',re.M|re.S)
makes that thing not scale, oh I don't know.
Comment 3•13 years ago
|
||
This solves the issue for me. AFAICS, there is no reason why re.S ought to be used for that regex (that is, no reason for . to be including '\n')
Attachment #594988 -
Flags: review?(l10n)
Assignee | ||
Comment 4•13 years ago
|
||
Comment on attachment 594988 [details] [diff] [review]
Patch
Thanks for trying to patch this.
Sadly, this patch makes Mozilla/tests/unitProperties.py fail. In a rather significant way, too, seems that the value turns into the complete line.
Attachment #594988 -
Flags: review?(l10n) → review-
Assignee | ||
Comment 5•13 years ago
|
||
I guess I have a patch. Will take some time to regression test this, because, well, the old parser takes ages to create the reference data :-)
Assignee: nobody → l10n
Assignee | ||
Comment 6•13 years ago
|
||
http://hg.mozilla.org/l10n/compare-locales/rev/7ad5db5f3c8c has the parser fix, http://hg.mozilla.org/l10n/compare-locales/rev/c788da422d51 landed the gecko tests before that. FIXED, and released as part of 0.9.5
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 7•13 years ago
|
||
PS: The latest bn-IN build on the dashboard took 23 seconds like the rest, instead of 3 minutes+
You need to log in
before you can comment on or make changes to this bug.
Description
•