Closed
Bug 1315970
Opened 8 years ago
Closed 8 years ago
Exception in .parse method reading file with incorrect encoding
Categories
(Localization Infrastructure and Tools :: compare-locales, defect)
Localization Infrastructure and Tools
compare-locales
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: flod, Assigned: Pike)
References
Details
Attachments
(2 files)
When running
entities, map = file_parser.parse()
On a file with wrong encoding, with 1.2 I get an exception, while 1.1 would simply log the error.
Traceback (most recent call last):
File "/Users/flodolo/github/tmx_maker/tests/test_string_extraction.py", line 181, in testBrokenEnconding
extraction.extractStrings()
File "/Users/flodolo/github/tmx_maker/tmx_products/tmx_products.py", line 139, in extractStrings
entities, map = file_parser.parse()
File "/Users/flodolo/github/tmx_maker/libraries/compare-locales/compare_locales/parser.py", line 224, in parse
for e in self:
File "/Users/flodolo/github/tmx_maker/libraries/compare-locales/compare_locales/parser.py", line 237, in walk
contents = ctx.contents
AttributeError: 'NoneType' object has no attribute 'contents'
Attached is the file generating this error.
Assignee | ||
Comment 1•8 years ago
|
||
This is a regression from bug 1290883.
Assignee: nobody → l10n
Blocks: 1290883
Comment hidden (mozreview-request) |
Reporter | ||
Comment 3•8 years ago
|
||
mozreview-review |
Comment on attachment 8809037 [details]
bug 1315970, failed loading should return empty parse lits,
https://reviewboard.mozilla.org/r/91706/#review91594
Thanks, it makes sense and works as expected now.
Attachment #8809037 -
Flags: review?(francesco.lodolo) → review+
Assignee | ||
Comment 4•8 years ago
|
||
https://hg.mozilla.org/l10n/compare-locales/rev/5735bcdca4f339e2aa08030774a18a3ae66dfcdc, marking FIXED.
Thanks for testing and the review.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•