GNOME Bugzilla – Bug 623336
strange "from .hamster import" statements cause hamster to fail with ImportError
Last modified: 2010-07-05 01:49:49 UTC
https://bugs.edge.launchpad.net/ubuntu/+source/hamster-applet/+bug/600857 and dupes points out that hamster in Ubuntu is broken because of lines like from .hamster import ... It's very strange to me that you would have a line like that inside code that's already within the hamster namespace. It looks like it's trying to import the module called hamster.widgets.hamster.configuration. I can see how python import tweaks could make this work - perhaps it is meant to allow running widgets from a different directory - but it's broken as it stands. There's a patch on the ubuntu bug.
http://git.gnome.org/browse/hamster-applet/commit/?id=6db3909987f3221b68be62d42487f98028604a4a addresses the issue properly. will note that the problem reported seems to be a local one as it works here, installed from sources and on all the other distros that ship hamster without modifications, and also, as i just verified, it does work in ubuntu installed from packages. so there is something special about your installation. although admittedly it works by some rather interesting side effect of relative imports. anyway, i would suggest avoiding calling something "broken as it stands" or sharing any kind of that sentiment particularly if as you put it yourself, do not understand why something has been done. won't be patching 2.30 as the reported bug can't be reproduced.
It hit at least three other people running Maverick so I doubt it was a local problem. Did you verify it there? What is this side effect that was supposed to make it work? For that matter I'm kind of curious why you didn't just write it as an absolute import. Anyhow, thank you for responding promptly.