Bootstrapping fails using Python 3x due to urllib2

RESOLVED FIXED in mozilla23

Status

()

Core
Build Config
RESOLVED FIXED
4 years ago
2 years ago

People

(Reporter: Abhinav Jauhri, Assigned: Timur Timirkhanov)

Tracking

unspecified
mozilla23
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
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

Comment 1

4 years ago
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]
(Assignee)

Comment 2

4 years ago
Created attachment 732785 [details] [diff] [review]
Proposed patch for the bug

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?

Updated

4 years ago
Attachment #732785 - Flags: review? → review?(gps)

Comment 3

4 years ago
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+

Comment 4

4 years ago
https://hg.mozilla.org/mozilla-central/rev/f20b0ce9e528

Thank you for the patch!
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Whiteboard: [mentor=gps][lang=python]
Target Milestone: --- → mozilla23

Comment 5

2 years ago
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.

Comment 6

2 years ago
(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).
You need to log in before you can comment on or make changes to this bug.