On Fri, Mar 27, 2015 at 10:34 AM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Daniel,

Ah, I think that the fix is to change it to "cStringIO" rather than "cStringIO.StringIO".  Can you try that and if it works, PR it?

For a tiny bit of context, six is part of our plan for supporting both python2 and python3 in the same codebase.  If you run into more issues like this, it helps to look at this page in the six docs:

https://pythonhosted.org/six/#module-six.moves
 

On Fri, Mar 27, 2015 at 12:32 PM, Daniel Fenn <dsfenn@gmail.com> wrote:
Hi everyone,

I've been working here and there on making the two point functions compatible with yt 3. I've run into an issue with the file i/o that's got me puzzled.

There's a call to write_on_root() that's failing with the error

AttributeError: 'builtin_function_or_method' object has no attribute 'StringIO'

Looking at the definition for write_on_root() in parallel_analysis_interface.py, I see that the offending line is:

return cStringIO.StringIO()

So apparently there's no function called StringIO(), even though the documentation for cStringIO says there should be.

I think the issue is how cStringIO is being imported:
from yt.extern.six.moves import cStringIO

Looking through yt/extern/six.py, it looks like it's modifying how the modules are imported, or something like that, but I can't really figure out what's going on in that file.

Does anyone have any thoughts on this?

Thanks,

Daniel

_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org



_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org