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

TypeError for !table #98

Open
cdeil opened this issue Mar 20, 2013 · 3 comments
Open

TypeError for !table #98

cdeil opened this issue Mar 20, 2013 · 3 comments
Labels
Milestone

Comments

@cdeil
Copy link
Contributor

cdeil commented Mar 20, 2013

To reproduce:

cd docs data
pserve --reload ../../development.ini

then hit the URL hsimple.root/hpx/!table/.

The following `TypeError` will show up in your browser:
Traceback (most recent call last):
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid_debugtoolbar-1.0.4-py2.7.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler
    result = handler(request)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid-1.4-py2.7.egg/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid-1.4-py2.7.egg/pyramid/router.py", line 161, in handle_request
    response = view_callable(context, request)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid-1.4-py2.7.egg/pyramid/config/views.py", line 345, in rendered_view
    result = view(context, request)
  File "/Users/deil/code/WebOOT/weboot/views/__init__.py", line 24, in view_root_object
    content="\n".join(context.content),
TypeError
@pwaller
Copy link
Member

pwaller commented Mar 20, 2013

That's an odd backtrace, for sure.

!table takes a 1D histogram with named bins and puts it in table form. If it's not one of those then !table is not a valid operation.

!table is also just a function I hacked together because I needed it and wanted to demonstrate that it was easy to implement. We could just as well remove it for the moment, or at least hide it.

@cdeil
Copy link
Contributor Author

cdeil commented Mar 20, 2013

I've seen similar Exceptions before mentioning context.content where I did something I wasn't supposed to do. I can't seem to reproduce those now, the only thing I could come up with is

/browse/test_file.root/scales/*/!compose/stack/!compose/stack

which results in

Traceback (most recent call last):
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid_debugtoolbar-1.0.4-py2.7.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler
    result = handler(request)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid-1.4-py2.7.egg/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid-1.4-py2.7.egg/pyramid/router.py", line 161, in handle_request
    response = view_callable(context, request)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid-1.4-py2.7.egg/pyramid/config/views.py", line 345, in rendered_view
    result = view(context, request)
  File "/Users/deil/code/WebOOT/weboot/views/__init__.py", line 22, in view_root_object
    content="\n".join(context.content),
  File "/Users/deil/code/WebOOT/weboot/resources/combination.py", line 583, in content
    assert len(self.object_types) == 1
AssertionError

So yes, I guess !table is very specialised and should maybe be removed, but independent of that probably the backtraces for non-valid actions should be replaced by an "Invalid command" message and if possible give the error message.

@cdeil
Copy link
Contributor Author

cdeil commented Mar 20, 2013

Here's another one: go to some folder where there's no ROOT files and hit the URL /browse/* and you'll get this error:

Traceback (most recent call last):
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid_debugtoolbar-1.0.4-py2.7.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler
    result = handler(request)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid-1.4-py2.7.egg/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid-1.4-py2.7.egg/pyramid/router.py", line 161, in handle_request
    response = view_callable(context, request)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/pyramid-1.4-py2.7.egg/pyramid/config/views.py", line 345, in rendered_view
    result = view(context, request)
  File "/Users/deil/code/WebOOT/weboot/views/multitraverse.py", line 92, in view_multitraverse
    print index_tuple, context.icon, context
AttributeError: 'NoneType' object has no attribute 'icon'

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

No branches or pull requests

2 participants