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" "$@"
,
Oct 6 2017
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..!!
,
Oct 9 2017
I have the same issue on Arch Linux as well.
,
Oct 9 2017
,
Oct 10 2017
I think for the workaround, '/usr/bin/env python2' shebang can be used to enforce the proper Python binary version.
,
Oct 11 2017
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 |
||||
Comment 1 by kenorb@gmail.com
, Oct 5 2017As for workaround, this command worked: PATH="/usr/bin:$PATH" gn gen out/Default