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

Can't print empty lepl.List objects. #18

Closed
GoogleCodeExporter opened this issue Apr 17, 2015 · 3 comments
Closed

Can't print empty lepl.List objects. #18

GoogleCodeExporter opened this issue Apr 17, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

An empty list of lepl.List or a subclass cannot be printed (or converted to 
string):

>>> l = lepl.List()
>>> print l
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/exports/home/wagnerflo/.local/lib/python2.6/site-packages/LEPL-4.3.3-py2.6.egg/lepl/support/list.py", line 55, in __str__
    return sexpr_to_tree(self)
  File "/exports/home/wagnerflo/.local/lib/python2.6/site-packages/LEPL-4.3.3-py2.6.egg/lepl/support/list.py", line 165, in sexpr_to_tree
    return '\n'.join(fold(list_)('', ''))
  File "/exports/home/wagnerflo/.local/lib/python2.6/site-packages/LEPL-4.3.3-py2.6.egg/lepl/support/list.py", line 163, in <lambda>
    return lambda first, rest: join(list(fun(first, rest)))
  File "/exports/home/wagnerflo/.local/lib/python2.6/site-packages/LEPL-4.3.3-py2.6.egg/lepl/support/list.py", line 162, in fun
    yield force[-1](rest + ' `- ', rest + '    ')
IndexError: list index out of range

A patch is attached which seems to fix the issue.

Original issue reported on code.google.com by flor...@wagner-flo.net on 28 Nov 2010 at 2:29

Attachments:

@GoogleCodeExporter
Copy link
Author

Whoa.  That's awful.  Sorry - will try get a new release out today.  Andrew

Original comment by acooke....@gmail.com on 28 Nov 2010 at 2:37

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

This was fixed, right?

Original comment by acooke....@gmail.com on 8 Jan 2012 at 10:42

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

I think so. Haven't used lepl in a while...

Original comment by flor...@wagner-flo.net on 9 Jan 2012 at 8:01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant