Closed Bug 1552658 Opened 6 months ago Closed 6 months ago

Fix to make run on Python 3


(Core :: Networking: DNS, enhancement, P3)

66 Branch



Tracking Status
firefox69 --- fixed


(Reporter: arpit73, Assigned: nimbus2020b, Mentored)


(Blocks 1 open bug)


(Keywords: good-first-bug, Whiteboard: [necko-triaged])


(1 file)

47 bytes, text/x-phabricator-request
Details | Review

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0

Type: defect → enhancement
Component: Untriaged → Networking: DNS
Product: Firefox → Core 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:
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.

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:

Otherwise we'll wait for a contributor to get involved.

Mentor: valentin.gosu
Keywords: good-first-bug
Priority: -- → P3
Whiteboard: [necko-triaged]

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 :)

That's great! Thanks for letting us know.

Blocks: buildpython3
Summary: Fix to make on Python 3 → Fix to make run on Python 3
Attached file Bug 1552658 solved

Added python 3 support for

Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Assignee: nobody → nimbus2020b
You need to log in before you can comment on or make changes to this bug.