Open will-moore opened 2 years ago
Seen again today on nightshade:
File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omeroweb/webgateway/views.py" in render_image
1076. jpeg_data = img.renderJpeg(z, t, compression=compress_quality)
File "/opt/omero/web/venv3/lib64/python3.6/site-packages/omero/gateway/__init__.py" in wrapped
7886. except ctx.ignoreExceptions:
Exception Type: TypeError at /webgateway/render_image/3970392/
Exception Value: catching classes that do not inherit from BaseException is not allowed
Looking at:
(base) /opt/omero-py $git grep assert_re
src/omero/gateway/__init__.py:class assert_re (object):
src/omero/gateway/__init__.py: Used by the :meth:`assert_re` method to wrap calls requiring rendering
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re(ignoreExceptions=(omero.ConcurrencyException))
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
src/omero/gateway/__init__.py: @assert_re()
and
class assert_re (object):
"""
Function decorator to make sure that rendering engine is prepared before
call. Is configurable by various options.
"""
def __init__(self, onPrepareFailureReturnNone=True, ignoreExceptions=None):
and
>>> try:
... pass
... except
KeyboardInterrupt
>>> ignore = (,)
File "<stdin>", line 1
ignore = (,)
^
SyntaxError: invalid syntax
>>> ignore = None
>>> try:
... pass
... except ignore:
... pass
...
>>> try:
... 1/0
... except ignore:
... pass
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
ZeroDivisionError: division by zero
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
TypeError: catching classes that do not inherit from BaseException is not allowed
I think just defining a default for assert_re
might solve this.
If an exception is thrown during init of rendering engine, this throws an Exception which then also generates a
TypeError
withexcept ctx.ignoreExceptions:
sinceignoreExceptions
is None by default see https://www.openmicroscopy.org/qa2/qa/feedback/30554/