print databases w/ python 2.7 yields max recursion RuntimeError

Create issue
Issue #41 resolved
Tomas Navarrete Gutierrez created an issue

Hi,

When using python 2.7, printing the databases (bw2data.meta.Databases) goes wrong.

In [64]: type(databases)
Out[64]: bw2data.meta.Databases

In [65]: print databases
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-65-5a55644a77b6> in <module>()
----> 1 print databases

/home/tomas/virtualenvs/ve1/lib/python2.7/site-packages/future/utils/__init__.pyc in <lambda>(self)
    100     if not PY3:
    101         cls.__unicode__ = cls.__str__
--> 102         cls.__str__ = lambda self: self.__unicode__().encode('utf-8')
    103     return cls
    104 

... last 1 frames repeated, from the frame below ...

/home/tomas/virtualenvs/ve1/lib/python2.7/site-packages/future/utils/__init__.pyc in <lambda>(self)
    100     if not PY3:
    101         cls.__unicode__ = cls.__str__
--> 102         cls.__str__ = lambda self: self.__unicode__().encode('utf-8')
    103     return cls
    104 

RuntimeError: maximum recursion depth exceeded in cmp

With an origin in:

/home/tomas/virtualenvs/ve1/lib/python2.7/site-packages/bw2data/serialization.pyc in <lambda>(x)
    168             )
    169 
--> 170     __repr__ = lambda x: str(x)
    171 
    172     def __delitem__(self, name):

Comments (1)

  1. Log in to comment