Conversation with #python at Wed 04 Jul 2012 08:11:40 AM ART on humitos@irc.gimp.net (irc)

(08:11:43 AM) humitos: hello people
(08:12:33 AM) humitos: I'm having this problem with Pango.EllipsizeMode.MIDDLE -> http://fpaste.org/MDQr/
(08:13:08 AM) humitos: I don't know why I get that error when I run my application because I can access to that attribute from my python
(08:13:27 AM) humitos: >>> from gi.repository import Pango
(08:13:27 AM) humitos: >>> Pango.EllipsizeMode.MIDDLE
(08:13:27 AM) humitos: <enum PANGO_ELLIPSIZE_MIDDLE of type PangoEllipsizeMode>
(08:13:27 AM) humitos: >>>
(08:13:45 AM) humitos: does anybody has an idea about what is happening?
(08:22:06 AM) phako|afk is now known as phako
(08:22:56 AM) jhernandez: humitos: weird
(08:23:30 AM) humitos: jhernandez: I've just reported the issue on Sugar's trac http://bugs.sugarlabs.org/ticket/3744
(08:24:08 AM) jhernandez: I had same issues when I was porting accerciser to use the new gobject introspection based bindings
(08:24:39 AM) humitos: jhernandez: so, you are on the future for me :) , how did you solve it?
(08:24:55 AM) jhernandez: and, most of the cases were from mixing static and dynamic bindings
(08:25:02 AM) benzea: humitos: what does it if you run python inside sugar-jhbuild shell?
(08:25:36 AM) humitos: benzea: that output is from the Terminal Activity
(08:25:49 AM) benzea: dunno, I have no idea really ...
(08:26:10 AM) jhernandez: humitos: where's the source code
(08:26:11 AM) jhernandez: ?
(08:26:57 AM) humitos: jhernandez: let me check
(08:28:13 AM) jhernandez: I'm wondering if is this one git://git.sugarlabs.org/infoslicer/mainline.git
(08:29:16 AM) humitos: jhernandez: oh, I was looking for the sugar-toolkit-gtk3 code
(08:29:38 AM) humitos: jhernandez: yes, that is the code that I'm working on but I have a "ported" version on my pc
(08:29:57 AM) humitos: jhernandez: I didn't pushed the changes yet because I'm working on the port and I didn't finish
(08:29:58 AM) jhernandez: hmm, I see lot of ols imports
(08:30:14 AM) tomeu: humitos: I would recommend working on a branch
(08:30:35 AM) tomeu: that way you can share the code with others and if you lose your hd, the code is still somewhere
(08:30:40 AM) achadwick [~achadwick@nat-alpha.ceu.ox.ac.uk] entered the room.
(08:31:19 AM) humitos: tomeu: yes, I agree with you... but this is the way that SugarLabs adopted... I should suggest a new one
(08:36:34 AM) tomeu: we used to code in branches back when I was at sugarlabs :)
(08:38:34 AM) pitti left the room (quit: WeeChat 0.3.8).
(08:47:15 AM) dieterv: humitos: when you said "from my python", is that the same Python executable & environment (PYTHONPATH, GI_TYPELIB_PATH, ...) that got invoked when you got the backtrace?
(08:47:45 AM) humitos: dieterv: I suppose that, how can I check it?
(08:48:33 AM) dieterv: humitos: also, are you sure Pango.EllipsizeMode isn't being shadowed somewhere, ie if you do print(Pango.__file__) right before the line that results in the exception it still gives you '<gi.repository.Pango>' ?
(08:48:41 AM) humitos: dieterv: and I think: "YES" because I'm using both inside the sugar-jhbuild
(08:50:22 AM) dieterv: humitos: dunno, with my plain-vanilla jhbuild on fedora 16, for example "jhbuild shell gobject-introspection" does not set PATH and the interactive interpreter behaves differently to what I'd expect
(08:50:35 AM) dieterv: mabye sugar-jhbuild is different, dunno...
(08:52:04 AM) humitos: dieterv: what do you mean with "different"? I mean, I think the same context is set for both (python as command -interpreter; and python that run InfoSlicer)
(08:56:41 AM) dieterv: humitos: for me, in jhbuild shell, PATH is not prepended with jhbuild's $(prefix)/bin
(08:57:14 AM) dieterv: humitos: so any executable I run that exists in $(prefix)/bin that I run is *not* going to be the jhbuild version, but the system version
(08:57:30 AM) dieterv: humitos: so if your jhbuild's $(prefix)/bin contains a python executable
(08:57:55 AM) dieterv: humitos: and sugar-jhbuild has the same issue not setting PATH on "jhbuild shell"
(08:58:02 AM) humitos: dieterv: mmm... I think that I don't have enough knowledge to understand this situation :(
(08:58:48 AM) dieterv: hmm, let's see
(08:59:02 AM) dieterv: does sugar-jhbuild install the things it builds in /home/humitos/sugar-jhbuild/install/ ?
(08:59:09 AM) dieterv: if yes, do you have a /home/humitos/sugar-jhbuild/install/python ?
(08:59:18 AM) dieterv: if yes, you might hit the problem I'm describing
(08:59:28 AM) dieterv: if no, never mind, it's something else ;)
(09:00:06 AM) humitos: yes, jhbuild installs things under /home/humitos/sugar-jhbuild/install/ but I don't have a directory called "python" inside it
(09:00:23 AM) humitos: so... "never mind" is the answer and that is so easy to do :D
(09:00:36 AM) tomeu: yeah, sugar-jhbuild at least used to set more env vars than plain jhbuild
(09:00:40 AM) dieterv: no directory, a binary or executable script with it's file name == python
(09:00:53 AM) dieterv: (or python2)
(09:00:54 AM) tomeu: and we used to build python at some point, but since then we have reduced a lot the dependencies we build inside jhbuild
(09:01:03 AM) humitos: dieterv: well, no, I don't have anything related with "python"
(09:01:06 AM) dieterv: tomeu: maybe a stray file
(09:01:10 AM) humitos: $ ls /home/humitos/sugar-jhbuild/install
(09:01:10 AM) humitos: bin etc include _jhbuild lib lib64 libexec share
(09:01:32 AM) dieterv: ls /home/humitos/sugar-jhbuild/install/bin <- notice the "bin" part
(09:01:41 AM) humitos: $ ls /home/humitos/sugar-jhbuild/install/bin/
(09:01:41 AM) humitos: copy-from-journal datastore-service sugar sugar-control-panel sugar-install-bundle sugar-presence-service sugar-ui-check
(09:01:41 AM) humitos: copy-to-journal dbus-binding-tool sugar-activity sugar-emulator sugar-launch sugar-session
(09:02:18 AM) dieterv: humitos: nothing python-ish there so it seems you've hit the "never mins, it's something else" case...
(09:02:28 AM) dieterv: s/mins/mind/
(09:03:04 AM) dieterv: humitos: sorry, no further ideas :/
(09:03:08 AM) ***dieterv -> back to work
(09:03:21 AM) tomeu: humitos: you aren't building pygobject inside sugar-jhbuild, right?
(09:05:36 AM) humitos: tomeu: no, I think that I'm using it from the system package (fedora 17)
(09:07:32 AM) humitos: tomeu: >>> import gi
(09:07:32 AM) humitos: >>> gi.__file__
(09:07:32 AM) humitos: '/usr/lib64/python2.7/site-packages/gi/__init__.pyc'
(09:07:32 AM) humitos: >>>
(09:08:47 AM) tomeu: cool
(09:08:59 AM) tomeu: humitos: so are you sure you aren't importing any static bindings?
(09:09:12 AM) tomeu: humitos: python -vv would tell if you are importing pango.so
(09:11:16 AM) humitos: tomeu: http://fpaste.org/ayLo/
(09:11:52 AM) tomeu: humitos: no, I meant run the activity like that
(09:12:02 AM) tomeu: it's the activity what may be loading static bindings
(09:12:14 AM) humitos: tomeu: mmm... let me think how to do that
(09:12:41 AM) tomeu: from the terminal: python -vv sugar-activity org.blah.bleh.infoslicer
(09:12:43 AM) tomeu: (I think)
(09:13:14 AM) humitos: tomeu: ok, let see
(09:17:39 AM) humitos: python -vv /home/humitos/sugar-jhbuild/install/bin/sugar-launch org.sugarlabs.InfoSlicer ---> http://fpaste.org/q2iW/
(09:17:43 AM) humitos: tomeu: ^
(09:24:01 AM) tomeu: humitos: it's weird that you don't load /usr/lib64/python2.7/site-packages/gi/_gi.so
(09:24:05 AM) tomeu: apparently
(09:24:37 AM) jhernandez: humitos: your problem seems to be mixing bindings
(09:26:26 AM) benzea: uh, are you importing sugar and sugar3?
(09:27:05 AM) benzea: or do you maybe need to use sugar3-launch or something? (I don't remember how it was solved in the end)
(09:27:14 AM) humitos: benzea: let me check... it could be; because I'm doing the porting and maybe I forgot to change one of the imports
(09:28:20 AM) humitos: benzea: nope, I don't have any "import sugar" or "from sugar import "...
(09:28:39 AM) benzea: humitos: what about sugar-launch itself?
(09:29:05 AM) tomeu: benzea: but I'm surprised that any of the static bindings are displayed in the python -v output
(09:29:13 AM) tomeu: s/any/none
(09:29:36 AM) benzea: tomeu: but it is definately loading sugar somewhere
(09:29:51 AM) humitos: benzea: how can I check if sugar-launch is importing "sugar" (2)
(09:30:27 AM) tomeu: I guess strace -e open is a bigger hammer then
(09:30:43 AM) lazka: what about adding: sys.modules["sugar"] = "die!"
(09:31:15 AM) benzea: well, need to go again
(09:31:28 AM) humitos: benzea: thanks for your help
(09:39:59 AM) humitos: does this channel a public log so I can attach it to the ticket that is related with this issue?
(09:40:28 AM) humitos: have*
(09:41:17 AM) tomeu: don't think so
(09:41:31 AM) tomeu: but your chat client probably logs?