Package: python-pyinotify
Version: 0.7.0-2
Severity: normal
Tags: patch
*** Please type your report below this line ***
pyinotify fails to import in a python2.5 session. A sample python
session:
--------------------------
[EMAIL PROTECTED]:~$ python2.5
Python 2.5.1 (r251:54863, Apr 25 2007, 21:31:46)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import pyinotify
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/lib/python-support/python2.5/pyinotify/pyinotify.py", line
48, in <module>
from inotify import inotify_init, inotify_add_watch,
inotify_rm_watch
File "/var/lib/python-support/python2.5/pyinotify/inotify.py", line
49, in <module>
from _inotify import inotify_init, inotify_add_watch,
inotify_rm_watch
ImportError: /var/lib/python-support/python2.5/pyinotify/_inotify.so:
undefined symbol: Py_InitModule4
--------------------------------
This is due to the python-pyinotify build system failing to segregate
the _inotify.so extension module - it's built only once, not once per
python version as it should be.
The attached patch fixes this, by forcing a rebuild before the module is
installed for each python version.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.21-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages python-pyinotify depends on:
ii libc6 2.5-11 GNU C Library: Shared libraries
ii python 2.4.4-6 An interactive high-level object-o
ii python-support 0.6.4 automated rebuilding support for p
diff -u pyinotify-0.7.0/debian/rules pyinotify-0.7.0/debian/rules
--- pyinotify-0.7.0/debian/rules
+++ pyinotify-0.7.0/debian/rules
@@ -20,7 +20,10 @@
build: build-stamp
build-stamp:
dh_testdir
- for python in $(PYVERS); do \
+#Since setup.py doesn't segregate _inotify.so by the python version it's built
+#against, we need to build and install in one go for each python version.
+#(LP #85705)
+# for python in $(PYVERS); do \
"$${python}" setup.py build; \
done
touch $@
@@ -43,7 +46,10 @@
dh_clean -k
dh_installdirs
+#setup.py does not segregate the _inotify.so based on python build version
+#We therefore need to rebuild it before installing for each version.
for python in $(PYVERS); do \
+ $$python setup.py build --force ; \
$$python setup.py install --root=$(CURDIR)/debian/python-pyinotify; \
done