Originally reported by: anntzer (Bitbucket: anntzer, GitHub: anntzer)
The following part of pkg_resources
#!python
try:
basestring
next = lambda o: o.next()
from cStringIO import StringIO as BytesIO
except NameError:
basestring = str
from io import BytesIO
def execfile(fn, globs=None, locs=None):
if globs is None:
globs = globals()
if locs is None:
locs = globs
exec(compile(open(fn).read(), fn, 'exec'), globs, locs)
tries to provide some standard Python2 functions when run with Python3, but is broken if other packages already do the same, but for a different subset. Specifically, if another package already defined (in Python3) builtins.basestring = str, the import of cStringIO will fail with an ImportError, and later calls to next will fail too.
Originally reported by: anntzer (Bitbucket: anntzer, GitHub: anntzer)
The following part of pkg_resources
tries to provide some standard Python2 functions when run with Python3, but is broken if other packages already do the same, but for a different subset. Specifically, if another package already defined (in Python3)
builtins.basestring = str, the import of cStringIO will fail with an ImportError, and later calls tonextwill fail too.