Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
pygobject-3.2.2-r1 issues with Python 2.7
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
jswails1
n00b
n00b


Joined: 19 Oct 2011
Posts: 20

PostPosted: Mon Nov 11, 2013 3:21 pm    Post subject: pygobject-3.2.2-r1 issues with Python 2.7 Reply with quote

The install phase (I believe) is dying with the following traceback:

Code:

libtool: install: warning: remember to run `libtool --finish /usr/lib64/python2.7/site-packages/gi'
 /bin/mkdir -p '/var/tmp/portage/dev-python/pygobject-3.2.2-r1/image//usr/lib64/python2.7/site-packages/gi'
 /usr/bin/install -c -m 644 __init__.py types.py module.py importer.py pygtkcompat.py '/var/tmp/portage/dev-python/pygobject-3.2.2-r1/image//usr/lib64/python2.7/site-packages/gi'
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site.py", line 62, in <module>
    import os
  File "/usr/lib64/python2.7/os.py", line 49, in <module>
    import posixpath as path
  File "/usr/lib64/python2.7/posixpath.py", line 17, in <module>
    import warnings
  File "/usr/lib64/python2.7/warnings.py", line 8, in <module>
    import types
  File "types.py", line 26, in <module>
    from . import _gobject


The problem here is that when the stdlib intends to import "types", it is erroneously grabbing the "types.py" module from inside the gi package in the pygobject build directory. Presumably this is because the CWD of this step is inside the gi/ package directory. If this stage was done outside the gi/ directory so that the 'types' module that actually got imported was /usr/lib64/python2.7/types.py instead of /var/tmp/portage/dev-python/pygobject-3.2.2-r1/image/usr/lib64/python2.7/site-packages/gi/types.py then this error should go away.

Truth be told I'm not familiar enough with the internals of portage to know how to fix this. My temporary (ugly hackish workaround) is running the following commands as root:

Code:

cd /usr/lib64/python2.7/
cp types.py _types.py
for m in *.py; do sed -i -e "s/import types/import _types as types/g" -e "s/from types import/from _types import/g" $m; done


After this, pygobject builds just fine, but I _really_ do not like hacking Python's stdlib like this. I just ran "emerge --sync", by the way, so to the best of my knowledge this hasn't been fixed upstream.

Cheers!
Back to top
View user's profile Send private message
jswails1
n00b
n00b


Joined: 19 Oct 2011
Posts: 20

PostPosted: Mon Nov 11, 2013 3:28 pm    Post subject: Reply with quote

Turns out this is already a reported bug: https://bugs.gentoo.org/show_bug.cgi?id=487196

Sorry for the noise.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum