Discussion:
[Urwid] help with transient traceback: AttributeError: 'Text' object has no attribute '_cache_translation'
Mike McCracken
2015-01-06 22:16:05 UTC
Permalink
Hi, we're using urwid in our openstack installer project, and have run into
a transient traceback from inside urwid's cached rendering code that we're
having trouble reproducing.

I'm hoping that someone on here has seen it before - I didn't find anything
too useful from a google search, so it doesn't seem like a FAQ.

The traceback in question is at the end of this email, and is also tracked
in this bug:
https://github.com/Ubuntu-Solutions-Engineering/openstack-installer/issues/326
that project has all the relevant code, and I'm happy to try to explain
anything relevant about the code base.

Thanks in advance for any advice.

File "/usr/share/openstack/cloudinstall/utils.py", line 66, in run
super().run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/share/openstack/cloudinstall/core.py", line 411, in
begin_deployment_async
self.begin_deployment()
File "/usr/share/openstack/cloudinstall/core.py", line 447, in
begin_deployment
self.deploy_using_placement()
File "/usr/share/openstack/cloudinstall/core.py", line 594, in
deploy_using_placement
err = self.try_deploy(charm_class)
File "/usr/share/openstack/cloudinstall/core.py", line 637, in try_deploy
mspec=mspec))
File "/usr/share/openstack/cloudinstall/core.py", line 232, in
info_message
"{}\N{HORIZONTAL ELLIPSIS}".format(message))
File "/usr/lib/python3.4/contextlib.py", line 66, in __exit__
next(self.gen)
File "/usr/share/openstack/cloudinstall/core.py", line 76, in
status_context
view.redraw_screen()
File "/usr/share/openstack/cloudinstall/core.py", line 267, in
redraw_screen
self.loop.draw_screen()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 565, in
draw_screen
canvas = self._topmost_widget.render(self.screen_size, focus=True)
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 141, in
cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 1750, in
render
canv = get_delegate(self).render(size, focus=focus)
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 141, in
cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python3/dist-packages/urwid/container.py", line 1058, in
render
(maxcol, maxrow), focus)
File "/usr/lib/python3/dist-packages/urwid/container.py", line 1018, in
frame_top_bottom
self.focus_part=='header' and focus)
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 201, in
cached_rows
return fn(self, size, focus)
File "/usr/lib/python3/dist-packages/urwid/container.py", line 1568, in
rows
return sum(self.get_item_rows(size, focus))
File "/usr/lib/python3/dist-packages/urwid/container.py", line 1470, in
get_item_rows
focus=focus and self.focus_item == w))
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 201, in
cached_rows
return fn(self, size, focus)
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 1021, in rows
return len(self.get_line_translation(maxcol))
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 1037, in
get_line_translation
return self._cache_translation
AttributeError: 'Text' object has no attribute '_cache_translation'
Ian Ward
2015-01-27 16:28:14 UTC
Permalink
Hi Mike,

Sorry I didn't see your email earlier. That's interesting, I'm not
sure how _cache_maxcol could be set without _cache translation also
being set. Are threads involved? You could try changing the order of
the settings in _update_cache_translation (put the
`self._cache_maxcol = maxcol` line last)

Ian

On Tue, Jan 6, 2015 at 5:16 PM, Mike McCracken
Post by Mike McCracken
Hi, we're using urwid in our openstack installer project, and have run into
a transient traceback from inside urwid's cached rendering code that we're
having trouble reproducing.
I'm hoping that someone on here has seen it before - I didn't find anything
too useful from a google search, so it doesn't seem like a FAQ.
The traceback in question is at the end of this email, and is also tracked
https://github.com/Ubuntu-Solutions-Engineering/openstack-installer/issues/326
that project has all the relevant code, and I'm happy to try to explain
anything relevant about the code base.
Thanks in advance for any advice.
File "/usr/share/openstack/cloudinstall/utils.py", line 66, in run
super().run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/share/openstack/cloudinstall/core.py", line 411, in
begin_deployment_async
self.begin_deployment()
File "/usr/share/openstack/cloudinstall/core.py", line 447, in
begin_deployment
self.deploy_using_placement()
File "/usr/share/openstack/cloudinstall/core.py", line 594, in
deploy_using_placement
err = self.try_deploy(charm_class)
File "/usr/share/openstack/cloudinstall/core.py", line 637, in try_deploy
mspec=mspec))
File "/usr/share/openstack/cloudinstall/core.py", line 232, in
info_message
"{}\N{HORIZONTAL ELLIPSIS}".format(message))
File "/usr/lib/python3.4/contextlib.py", line 66, in __exit__
next(self.gen)
File "/usr/share/openstack/cloudinstall/core.py", line 76, in
status_context
view.redraw_screen()
File "/usr/share/openstack/cloudinstall/core.py", line 267, in
redraw_screen
self.loop.draw_screen()
File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 565, in
draw_screen
canvas = self._topmost_widget.render(self.screen_size, focus=True)
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 141, in
cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 1750, in
render
canv = get_delegate(self).render(size, focus=focus)
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 141, in
cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python3/dist-packages/urwid/container.py", line 1058, in
render
(maxcol, maxrow), focus)
File "/usr/lib/python3/dist-packages/urwid/container.py", line 1018, in
frame_top_bottom
self.focus_part=='header' and focus)
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 201, in
cached_rows
return fn(self, size, focus)
File "/usr/lib/python3/dist-packages/urwid/container.py", line 1568, in
rows
return sum(self.get_item_rows(size, focus))
File "/usr/lib/python3/dist-packages/urwid/container.py", line 1470, in
get_item_rows
focus=focus and self.focus_item == w))
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 201, in
cached_rows
return fn(self, size, focus)
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 1021, in rows
return len(self.get_line_translation(maxcol))
File "/usr/lib/python3/dist-packages/urwid/widget.py", line 1037, in
get_line_translation
return self._cache_translation
AttributeError: 'Text' object has no attribute '_cache_translation'
_______________________________________________
Urwid mailing list
http://lists.excess.org/mailman/listinfo/urwid
Loading...