Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print databases w/ python 2.7 yields max recursion RuntimeError #41

Closed
aleksandra-kim opened this issue Jun 14, 2016 · 1 comment
Closed
Labels
bug Something isn't working minor

Comments

@aleksandra-kim
Copy link
Member

Original report by Tomas Navarrete Gutierrez (Bitbucket: tomas_navarrete, ).


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):
@aleksandra-kim
Copy link
Member Author

Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).


Fixed in commit 0406e6d.

@aleksandra-kim aleksandra-kim added minor bug Something isn't working labels Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minor
Projects
None yet
Development

No branches or pull requests

1 participant