After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623336 - strange "from .hamster import" statements cause hamster to fail with ImportError
strange "from .hamster import" statements cause hamster to fail with ImportError
Status: RESOLVED FIXED
Product: hamster-applet
Classification: Deprecated
Component: general
2.30.x
Other Linux
: Normal major
: ---
Assigned To: hamster-applet-maint
hamster-applet-maint
Depends on:
Blocks:
 
 
Reported: 2010-07-02 02:02 UTC by Martin Pool
Modified: 2010-07-05 01:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Martin Pool 2010-07-02 02:02:58 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.
Comment 1 Toms Bauģis 2010-07-02 11:01:12 UTC
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.
Comment 2 Martin Pool 2010-07-05 01:49:49 UTC
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.