Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 354403 - dev-python/guppy doesn't work with Python 2.7
Summary: dev-python/guppy doesn't work with Python 2.7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: python-2.7
  Show dependency tree
 
Reported: 2011-02-10 20:35 UTC by Alec Meyers
Modified: 2011-12-20 15:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,35.82 KB, text/plain)
2011-02-10 21:06 UTC, Alec Meyers
Details
ebuild patch (guppy.patch,391 bytes, patch)
2011-12-03 11:42 UTC, Ian Delaney (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Meyers 2011-02-10 20:35:41 UTC
Guppy throws an ImportError when used.


Reproducible: Always

Steps to Reproduce:
1. Following the the tutorial: http://guppy-pe.sourceforge.net/heapy_tutorial.html
2. Open python
3. Type in "from guppy import hpy; hp=hpy()"

Actual Results:  
$ python
Python 2.7.1 (r271:86832, Dec  3 2010, 16:15:53) 
[GCC 4.5.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from guppy import hpy; hp=hpy()
Error at initialization of module heapycTraceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/guppy/__init__.py", line 37, in hpy
    return r.guppy.heapy.Use
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 45, in __getattr__
    return self._share.getattr(self, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 195, in getattr
    d = self.getattr2(inter, cache, owner, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 213, in getattr2
    x = self.getattr_package(inter, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 261, in getattr_package
    x = self.makeModule(x, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 321, in makeModule
    return Share(module, self, module.__name__, Clamp)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 184, in __init__
    getattr(inter, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 45, in __getattr__
    return self._share.getattr(self, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 195, in getattr
    d = self.getattr2(inter, cache, owner, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 215, in getattr2
    x = self.getattr3(inter, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 283, in getattr3
    pa = getattr(pa, at)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 45, in __getattr__
    return self._share.getattr(self, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 195, in getattr
    d = self.getattr2(inter, cache, owner, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 213, in getattr2
    x = self.getattr_package(inter, name)
  File "/usr/lib64/python2.7/site-packages/guppy/etc/Glue.py", line 250, in getattr_package
    x = __import__(self.makeName(name), globals(), locals())
  File "/usr/lib64/python2.7/site-packages/guppy/heapy/View.py", line 555, in <module>
    prime_builtin_types()
  File "/usr/lib64/python2.7/site-packages/guppy/heapy/View.py", line 538, in prime_builtin_types
    import guppy.heapy.heapyc
  File "/usr/lib64/python2.7/site-packages/guppy/sets/__init__.py", line 3, in <module>
    from setsc import BitSet	# base bitset type
ImportError: /usr/lib64/python2.7/site-packages/guppy/sets/setsc.so: undefined symbol: _PyLong_AsScaledDouble


Expected Results:  
An hpy object should be successfully created


Portage 2.2.0_alpha23 (default/linux/amd64/10.0/desktop, gcc-4.5.2, glibc-2.12.2-r0, 2.6.37 x86_64)
=================================================================
System uname: Linux-2.6.37-x86_64-Intel-R-_Core-TM-_i7_CPU_M_620_@_2.67GHz-with-gentoo-2.0.1
Timestamp of tree: Thu, 10 Feb 2011 02:15:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.7.1, 3.1.3
dev-util/cmake:      2.8.3-r1
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.7.0
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
Repositories: gentoo mozilla sage-on-gentoo local
Installed sets: @kde4, @ooffice-tmp, @texlive, @xfce4
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-10.1 dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -fno-ident -floop-interchange -floop-strip-mine -floop-block -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe -fno-ident -floop-interchange -floop-strip-mine -floop-block -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://mirrors.rit.edu/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="en"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="gzip"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage/tree/official"
PORTDIR_OVERLAY="/usr/portage/tree/layman/mozilla /usr/portage/tree/layman/sage-on-gentoo /usr/portage/tree/local"
SYNC="rsync://rsync21.us.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi aio alsa amd64 apng audiofile avi bash-completion berkdb bluetooth branding bzip2 cairo cdparanoia cdr chm cli cracklib crypt css cups curl custom-optimization cxx dbus dell dirac dri dts dvd dvdr emboss encode exif expat ffmpeg fftw firefox flac foomaticdb fortran ftp gdu gif git gmp gpm gtk iconv imagemagick imlib inotify java5 java6 jpeg kde kdehiddenvisibility kvm laptop latex lcms libnotify logrotate lqr lzma lzo mad mikmod mmx mmxext mng modules mp3 mp4 mpeg mplayer mudflap multilib musepack ncurses nptl nptlonly nsplugin nvidia ogg opengl openmp openssl pam pango pch pcre pdf perl png ppds pppd python qt qt3support qt4 quicktime rar readline resolvconf rtmp samba schroedinger sdl session sndfile speex spell sqlite sqlite3 srt sse sse2 sse3 sse4 ssl ssse3 startup-notification subversion svg sysfs tcpd theora threads tiff tokyocabinet truetype udev unicode usb v4l v4l2 vaapi vcd videos vim-syntax vorbis vpx webkit wifi wmf x264 xcb xcomposite xft xorg xscreensaver xulrunner xv xvid xvmc xz zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XFCE_PLUGINS="clock logout menu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS
Comment 1 Rafał Mużyło 2011-02-10 20:50:25 UTC
Any chance of the build log ?

But it seems to be a bug in guppy - _PyLong_AsScaledDouble, as the name suggests, is private API, that was removed in python 2.7.
Comment 2 Alec Meyers 2011-02-10 21:06:36 UTC
Created attachment 262085 [details]
build.log

Here you go.

After some googling, I looks like they fixed it in Ubuntu: https://bugs.launchpad.net/ubuntu/+source/guppy/+bug/685127

I haven't had a chance to try it yet, though.
Comment 3 Rafał Mużyło 2011-02-10 21:39:55 UTC
That patch is quite amusing: to fix a breakage caused by removal of a private API element, upstream used *another* private API element.

Most relevant seems to be the dev input here: http://bugs.python.org/issue5576.
Comment 4 Ian Delaney (RETIRED) gentoo-dev 2011-12-03 11:42:56 UTC
Created attachment 294575 [details, diff]
ebuild patch

fixed.  The patch above lead to discerning that guppy is calling on the old 
_PyLong_AsScaledDouble replaced by that patch long implemented in python 2.7
Comment 5 Maxim Koltsov (RETIRED) gentoo-dev 2011-12-17 08:40:16 UTC
Fixed with rev bump. Thanks, Ian.
Comment 7 Ian Delaney (RETIRED) gentoo-dev 2011-12-20 12:44:41 UTC
I don't know why but pythons 2.5 2.6 don't work but my patch wasn't quite right anyway.
src_prepare() {
        if [ $(eselect python show) == "python2.7" ]; then
                sed -e 's:_PyLong_AsScaledDouble:_PyLong_Frexp:' -i src/sets/bitset.c || die
        fi
}
or something equivalent I think should do.  I can't get to use the more conventional python_get_version but this amounts to the same thing.

It seems it should also be adjusted to it depending on python2.7 alone because pythons 2.5 2.6 don't work emerging with them selected as system python version.  Without this change it will work on NO python versions.  The package emerges ok but attempting the import in the opening comment it only effectively imports with python2.7, I don't know why.  I'm not sure what to do with those links in the previous comment.  They're related but perhaps someone can turn them into a patch or such
Comment 8 Maxim Koltsov (RETIRED) gentoo-dev 2011-12-20 15:16:39 UTC
I made this sed thing apply only for 2.7, so bug is fixed now.