New issue
Advanced search Search tips

Issue 771930 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Support for Python 3

Reported by kenorb@gmail.com, Oct 5 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36 OPR/47.0.2631.71

Steps to reproduce the problem:
1. I'm running chromium/src $ gn gen out/Default

However I've got error as my default Python is 3. Is there any way of making support for Python 3 or correcting the syntax, so it can support both versions?

What is the expected behavior?

What went wrong?
chromium/src $ gn gen out/Default
Traceback (most recent call last):
  File "/Users/kenorb/Sources/Chromium/depot_tools/gn.py", line 15, in <module>
    import gclient_utils
  File "/Users/kenorb/Sources/Chromium/depot_tools/gclient_utils.py", line 271
    except OSError, e:
                  ^
SyntaxError: invalid syntax

Did this work before? N/A 

Chrome version: 60.0.3112.90  Channel: n/a
OS Version: OS X 10.12.0
Flash Version: 

$ which python
/Users/me/anaconda/bin/python
$ python --version
Python 3.6.0 :: Anaconda custom (x86_64)

Affected file: depot_tools/gn
Affected line:
PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/gn.py" "$@"
 

Comment 1 by kenorb@gmail.com, Oct 5 2017

As for workaround, this command worked:

    PATH="/usr/bin:$PATH" gn gen out/Default
Labels: TE-NeedsTraige-help Needs-Milestone
Seems it is out of scope from TE end, adding TE-NeedsTraige-help label to move this out of our triaging bucket.

Could someone from dev team please take a look into this issue.

Thanks..!!

Comment 3 by lie...@gmail.com, Oct 9 2017

I have the same issue on Arch Linux as well.

Comment 4 by alph@chromium.org, Oct 9 2017

Components: -Platform>DevTools Infra>Client>Chrome

Comment 5 by kenorb@gmail.com, Oct 10 2017

I think for the workaround, '/usr/bin/env python2' shebang can be used to enforce the proper Python binary version.

Comment 6 by rsesek@chromium.org, Oct 11 2017

Status: WontFix (was: Unconfirmed)
The Chromium Python environment is 2.7. We have enough Python in our project that it is not practical for us to enforce being 2 and 3 clean.

Sign in to add a comment