Last Comment Bug 843492 - Bootstrapping fails using Python 3x due to urllib2
: Bootstrapping fails using Python 3x due to urllib2
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: unspecified
: x86 Mac OS X
-- normal (vote)
: mozilla23
Assigned To: Timur Timirkhanov
:
: Gregory Szorc [:gps] (away until 2017-03-20)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-20 23:55 PST by Abhinav Jauhri
Modified: 2015-11-11 23:34 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Proposed patch for the bug (3.66 KB, patch)
2013-04-03 05:38 PDT, Timur Timirkhanov
gps: review+
Details | Diff | Splinter Review

Description User image Abhinav Jauhri 2013-02-20 23:55:13 PST
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 User image Gregory Szorc [:gps] (away until 2017-03-20) 2013-03-20 18:46:05 PDT
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.
Comment 2 User image Timur Timirkhanov 2013-04-03 05:38:45 PDT
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.
Comment 3 User image Gregory Szorc [:gps] (away until 2017-03-20) 2013-04-03 10:27:47 PDT
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.
Comment 4 User image Gregory Szorc [:gps] (away until 2017-03-20) 2013-04-03 10:32:14 PDT
https://hg.mozilla.org/mozilla-central/rev/f20b0ce9e528

Thank you for the patch!
Comment 5 User image mohamed.bgb 2015-11-11 23:31:32 PST
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 User image mohamed.bgb 2015-11-11 23:34:30 PST
(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).

Note You need to log in before you can comment on or make changes to this bug.