[yt-users] cStringIO error

Daniel Fenn dsfenn at gmail.com
Fri Mar 27 10:51:05 PDT 2015


Yep, that did it! Thanks for your help. I'll submit the PR this afternoon.

Daniel


2015-03-27 13:36 GMT-04:00 Nathan Goldbaum <nathan12343 at gmail.com>:

>
>
> On Fri, Mar 27, 2015 at 10:34 AM, Matthew Turk <matthewturk at 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 at 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 at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150327/a22dbecf/attachment.html>
-------------- next part --------------
_______________________________________________
yt-users mailing list
yt-users at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


More information about the yt-users mailing list