Fix to make prepare_tlds.py run on Python 3
Categories
(Core :: Networking: DNS, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox69 | --- | fixed |
People
(Reporter: arpitbharti73, Assigned: nimbus2020b, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [necko-triaged])
Attachments
(1 file)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0
| Reporter | ||
Updated•6 years ago
|
| Reporter | ||
Comment 1•6 years ago
|
||
prepare_tlds.py curently works fine with python 2.7, when using Python 3.6 the program crashes when it encounters accented characters in the public suffix list. I observed this with the 'aéroport' word. This can be fixed in Python 3 by modifying the following line of code:
https://searchfox.org/mozilla-central/source/netwerk/dns/prepare_tlds.py#51
Changing the line to
return encodings.idna.ToASCII(label).decode("utf-8")
by adding .decode("utf-8") at the end makes it run fine with Python 3. If the build system uses Python 2 then this change would make it easy to migrate to Python 3.
To test I ran with both versions of python and they produce the same C++ array as result.
Comment 2•6 years ago
|
||
Thanks for the report. I'll mark this as a good-first-bug for now, since you so nicely provided a fix.
If you want to submit the patch please do so: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch
Otherwise we'll wait for a contributor to get involved.
| Reporter | ||
Comment 3•6 years ago
|
||
I've solved my share of good-first bugs for Firefox before. I'd be happy to see someone else take this up.
If there is no activity in the following weeks, I will submit a patch :)
Comment 4•6 years ago
|
||
That's great! Thanks for letting us know.
| Reporter | ||
Updated•6 years ago
|
| Assignee | ||
Comment 5•6 years ago
|
||
Added python 3 support for prepare_tlds.py
Comment 7•6 years ago
|
||
| bugherder | ||
Updated•6 years ago
|
Description
•