On Mon, Feb 9, 2015 at 2:37 PM, Brian <brian.from...@gmail.com> wrote: > Thank you, Ian and Zack! That was exactly the issue. Apparently, having a > token.py script (one of my first Python 2 scripts to get an authorization > token from a billing server) is OK for Python 2 but breaks Python 3.
Local modules that have the same absolute module path as standard library modules will cause problems in either version of Python. I think it's unfortunate that Python files that happen to live in the same directory as the main script automatically get treated as top-level modules that shadow the standard library. You're not the first person to be confused by this. It appears that the reason this works for you in Python 2 and not in Python 3 is because the linecache module doesn't import tokenize in Python 2, whereas it does in Python 3. If you had tried to import tokenize directly in Python 2 then I expect you'd have the same problem. -- https://mail.python.org/mailman/listinfo/python-list