Bootstrapping fails using Python 3x due to urllib2

RESOLVED FIXED in mozilla23

Status

defect
RESOLVED FIXED
7 years ago
Last year

People

(Reporter: abhinavjauhri, Assigned: tim_tim2000)

Tracking

unspecified
mozilla23
x86
macOS

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17

Steps to reproduce:

wget --no-check-certificate https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py && python bootstrap.py

(Python 3.2.3)


Actual results:

Traceback (most recent call last):
  File "bootstrap.py", line 21, in <module>
    import urllib2
ImportError: No module named urllib2


Expected results:

bootstrap.py should have worked as usual
bootstrap.py should ideally work with Python 3. I'd love to see this fixed but it's not high on the priority list.

For anyone who comes along, this is code in /python/mozboot/ in mozilla-central. It should work with Python 2.5 through 3.3.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [mentor=gps][lang=python]
I have successfully tested this using Python 2.7.3 and Python 3.2.3 on Linux and Python 2.5 on Windows.
Assignee: nobody → tim_tim2000
Attachment #732785 - Flags: review?
Attachment #732785 - Flags: review? → review?(gps)
Comment on attachment 732785 [details] [diff] [review]
Proposed patch for the bug

Review of attachment 732785 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me!

I'll commit this for you.
Attachment #732785 - Flags: review?(gps) → review+
https://hg.mozilla.org/mozilla-central/rev/f20b0ce9e528

Thank you for the patch!
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [mentor=gps][lang=python]
Target Milestone: --- → mozilla23
Please consider this:
One-Line Bootstrapping failed today on my Archlinux using python 3.5.0.
WOrking properly using python 2.2.7.10-2 on the same machine.
(In reply to mohamed.bgb from comment #5)
> Please consider this:
> One-Line Bootstrapping failed today on my Archlinux using python 3.5.0.
> WOrking properly using python 2.2.7.10-2 on the same machine.

Could not load the bottstrap Python environment.
This should never happen. Consider filing a bug.
Missing parentheses in call to 'print' (archlinux.py, line 77).
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.