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 a Mapper object #74

Closed
JordanP opened this issue Sep 20, 2016 · 0 comments
Closed

Can't print a Mapper object #74

JordanP opened this issue Sep 20, 2016 · 0 comments

Comments

@JordanP
Copy link

JordanP commented Sep 20, 2016

While fixing #11 a bug was introduced.

table = [('Route name', 'Methods', 'Path', 'Controller', 'action')] + \
        [(r.name or '', format_methods(r), r.routepath or '',
          r.defaults.get('controller', ''), r.defaults.get('action', ''))
         for r in self.matchlist]

widths = [max(len(row[col]) for row in table)
          for col in range(len(table[0]))]

While iterating over all the rows and all the columns of the table, a call to len(r.defaults.get('controller', '')) is going to be made. But r.defaults.get('controller', '') is an instance of a class that doesn't have to have a __len__ method. So this code will fail with TypeError: object of type 'ResourceV21' has no len().

@JordanP JordanP closed this as completed Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant