Comment 4 for bug 1277606

Revision history for this message
Matthew Russell (matthew-russell) wrote :

On my machine I get the same error.
It's due to the following file being present:

~/.local/lib/python2.7/site-packages/builtins.py

Searches:
$ find ~/.local/lib/python2.7/site-packages/ -type f -exec grep -Hn builtins.py {} \;
/home/matthew/.local/lib/python2.7/site-packages/pies2overrides-2.6.1-py2.7.egg-info/SOURCES.txt:2:builtins.py
/home/matthew/.local/lib/python2.7/site-packages/pies2overrides-2.6.1-py2.7.egg-info/installed-files.txt:2:../builtins.py
/home/matthew/.local/lib/python2.7/site-packages/pies2overrides-2.6.1-py2.7.egg-info/installed-files.txt:19:../builtins.pyc

$ find /home/matthew/.local/lib/python2.7/site-packages/ -type f -name requires.txt -exec grep -Hn pies {} \;
/home/matthew/.local/lib/python2.7/site-packages/pies-2.6.1-py2.7.egg-info/requires.txt:1:pies2overrides
/home/matthew/.local/lib/python2.7/site-packages/isort-3.6.2-py2.7.egg-info/requires.txt:1:pies>=2.6.0

$ find /home/matthew/.local/lib/python2.7/site-packages/ -type f -name requires.txt -exec grep -Hn pies {} \;
/home/matthew/.local/lib/python2.7/site-packages/pies-2.6.1-py2.7.egg-info/requires.txt:1:pies2overrides
/home/matthew/.local/lib/python2.7/site-packages/isort-3.6.2-py2.7.egg-info/requires.txt:1:pies>=2.6.0

This has the sole line:

from __builtins__ import *

The offending module on my system is isort.

In #3 Stefan shows the call site in pyflakes where this is a problem.
Personally I think isort is using the above to try and bridge the 2/3 divide,
but should probably add a compat module.

pyflakes should use:
PY2 = sys.version.starswith('2') or similar.

Will raise a bug in both projects.