Closed Bug 654232 Opened 13 years ago Closed 13 years ago

[traceback] UnicodeDecodeError on /developers/addon/adblock-plus/file/74835/validation

Categories

(addons.mozilla.org Graveyard :: Developer Pages, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: krupa.mozbugs, Assigned: basta)

References

()

Details

Attachments

(1 file)

299.94 KB, application/x-xpinstall
Details
steps to reproduce:
1. Load https://addons.allizom.org/en-US/developers/addon/adblock-plus/file/74835/validation

traceback details:
"Traceback (most recent call last): 

File "/data/amo_python/www/preview/zamboni/apps/devhub/views.py", line 547, in json_file_validation v_result = tasks.file_validator(file.id) 

File "/data/amo_python/www/preview/zamboni/vendor/lib/python/celery/task/base.py", line 222, in __call__ return self.run(*args, **kwargs) 

File "/data/amo_python/www/preview/zamboni/vendor/lib/python/celery/decorators.py", line 52, in run return fun(*args, **kwargs) 

File "/data/amo_python/www/preview/zamboni/vendor/src/nuggets/celeryutils.py", line 33, in wrapped return fun(*args, **kw) 

File "/data/amo_python/www/preview/zamboni/apps/amo/decorators.py", line 82, in wrapper return f(*args, **kw) 

File "/data/amo_python/www/preview/zamboni/apps/amo/decorators.py", line 74, in wrapper return f(*args, **kw) 

File "/data/amo_python/www/preview/zamboni/apps/devhub/tasks.py", line 47, in file_validator result = _validator(file.file_path) 

File "/data/amo_python/www/preview/zamboni/apps/devhub/tasks.py", line 70, in _validator spidermonkey=settings.SPIDERMONKEY) 

File "/data/amo_python/www/preview/zamboni/vendor/src/amo-validator/validator/validate.py", line 39, in validate for_appversions=for_appversions) 

File "/data/amo_python/www/preview/zamboni/vendor/src/amo-validator/validator/submain.py", line 54, in phttp://pastebin.mozilla.org/repare_package for_appversions) 

File "/data/amo_python/www/preview/zamboni/vendor/src/amo-validator/validator/submain.py", line 122, in test_package return test_inner_package(err, package_contents, package, for_appversions) 

File "/data/amo_python/www/preview/zamboni/vendor/src/amo-validator/validator/submain.py", line 239, in test_inner_package test_func(err, package_contents, xpi_package) 

File "/data/amo_python/www/preview/zamboni/vendor/src/amo-validator/validator/testcases/content.py", line 130, in test_packed_packages sub_xpi) 

File "/data/amo_python/www/preview/zamboni/vendor/src/amo-validator/validator/submain.py", line 239, in test_inner_package test_func(err, package_contents, xpi_package) 

File "/data/amo_python/www/preview/zamboni/vendor/src/amo-validator/validator/testcases/content.py", line 160, in test_packed_packages data["extension"]) 

File "/data/amo_python/www/preview/zamboni/vendor/src/amo-validator/validator/testcases/markup/markuptester.py", line 101, in process self._feed_parser(line) 

File "/data/amo_python/www/preview/zamboni/vendor/src/amo-validator/validator/testcases/markup/markuptester.py", line 107, in _feed_parser self.feed(line + "\n") 

File "/usr/lib/python2.6/HTMLParser.py", line 108, in feed self.goahead(0) 

File "/usr/lib/python2.6/HTMLParser.py", line 148, in goahead k = self.parse_starttag(i) 

File "/usr/lib/python2.6/HTMLParser.py", line 249, in parse_starttag attrvalue = self.unescape(attrvalue) 

File "/usr/lib/python2.6/HTMLParser.py", line 387, in unescape return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));", replaceEntities, s) 

File "/usr/lib/python2.6/re.py", line 151, in sub return _compile(pattern, 0).sub(repl, string, count) 

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Assignee: nobody → mbasta
It would figure that re is not unicode-safe. I'll tweak this sometime this week.
I have a fix, but can't test it because I don't have access to the URL above. Can you attach the XPI?
Attached file add-on
This should be fixed:

https://github.com/mozilla/amo-validator/pull/29

Kumar: Could you add this to the regression tests as well?
Can we get this closed today?
In the pull request above I requested some code changes before this gets merged in.

As for the regression test, I have pushed this to a branch (it fails) and will merge when it passes https://github.com/kumar303/test-amo-validator/compare/master...non-ascii-html
Merged:

https://github.com/mozilla/amo-validator/commit/9b33a0b80a75c0d9fe7250d1be868bf5164c57c3
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: