diff --git a/debian/changelog b/debian/changelog
index 992a66044141918699df667c5298148d0ff3f2d1..a05ce732a52a1c723e56d1a1372b0173d49f15ba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+python-defaults (2.6.5-5) unstable; urgency=medium
+
+  * Use Python's compileall module instead of pycompile to byte-compile
+    debpython module as logging module is not available in pythonX.Y-minimal
+    package (Closes: 586743)
+
+ -- Piotr Ożarowski <piotr@debian.org>  Tue, 22 Jun 2010 10:46:48 +0200
+
 python-defaults (2.6.5-4) unstable; urgency=low
 
   [ Piotr Ożarowski ]
diff --git a/debian/python-minimal.postinst b/debian/python-minimal.postinst
index d723bd04d7301f9fb3443c8dace883fd8d51794a..63645b19250dd5bd505032493b222077a5d94753 100644
--- a/debian/python-minimal.postinst
+++ b/debian/python-minimal.postinst
@@ -1,4 +1,7 @@
 #! /bin/sh -e
-pycompile -p python-minimal
+
+# runpy.py is not available in pythonX.Y-minimal and thus "python -m compileall"
+# cannot be used, temporary workaround:
+python /usr/lib/python2.6/compileall.py /usr/share/python/ >/dev/null
 
 #DEBHELPER#
diff --git a/debian/python-minimal.prerm b/debian/python-minimal.prerm
index 0c01985af7f1d388fe1ac4c3b2bf0d95aef5b8d5..513b85d4e4705efaab505f960fccc17ebded669e 100644
--- a/debian/python-minimal.prerm
+++ b/debian/python-minimal.prerm
@@ -1,4 +1,4 @@
 #! /bin/sh -e
-pyclean -p python-minimal
+find /usr/share/python/ -name '*.py[oc]' -delete
 
 #DEBHELPER#