On Wed, Mar 24, 2010 at 10:20, Charles R Harris <charlesr.har...@gmail.com> wrote: > > On Wed, Mar 24, 2010 at 9:07 AM, Robert Kern <robert.k...@gmail.com> wrote: >> >> On Wed, Mar 24, 2010 at 09:43, David Cournapeau <courn...@gmail.com> >> wrote: >> > On Wed, Mar 24, 2010 at 11:35 PM, Nadav Horesh <nad...@visionsense.com> >> > wrote: >> >> Any idea why >> >> >> >> from .io import StringIO >> >> >> >> and not >> >> >> >> from io import StringIO >> >> >> >> ??? >> >> >> >> (Why is the extra "." before "io") >> > >> > Maybe a bug in py2to3, because StringIO is in io in python 3, and we >> > have a io module in numpy (.io is the new syntax for relative import). >> >> Bug reported: >> >> http://bugs.python.org/issue8221 >> > > What would be the best fix? Should we rename io to something like npyio?
utils.py is the only file in there that imports StringIO. It should probably do a local import "from io import BytesIO" because io.py already contains some Python3-awareness: if sys.version_info[0] >= 3: import io BytesIO = io.BytesIO else: from cStringIO import StringIO as BytesIO -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion