[Parted-maintainers] Bug#769737: Broken import path renders python3-parted unusable

Christian Kastner debian at kvr.at
Sun Nov 16 00:26:58 UTC 2014


Package: python3-parted
Version: 3.10.0-1
Severity: grave
Tags: patch

With Python 3, pyparted cannot be imported:

$ sudo aptitude install python-parted python3-parted
$ python -c 'import parted'
$ python3 -c 'import parted'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/parted/__init__.py", line 55, in <module>
    from parted.device import Device
  File "/usr/lib/python3/dist-packages/parted/device.py", line 31, in <module>
    from decorators import localeC
ImportError: No module named 'decorators'

This has already been fixed upstream. The attached debdiff includes this fix.

Regards,
Christian

diff -Nru pyparted-3.10.0/debian/changelog pyparted-3.10.0/debian/changelog
--- pyparted-3.10.0/debian/changelog	2014-09-30 20:10:56.000000000 +0200
+++ pyparted-3.10.0/debian/changelog	2014-11-16 01:49:48.000000000 +0100
@@ -1,3 +1,11 @@
+pyparted (3.10.0-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Backport patch Fix-localeC-imports.patch from upstream which fixes an
+    ImportError that rendered the python3-parted package unusable.
+
+ -- Christian Kastner <debian at kvr.at>  Sun, 16 Nov 2014 00:59:49 +0100
+
 pyparted (3.10.0-1) unstable; urgency=medium
 
   * New upstream release.
diff -Nru pyparted-3.10.0/debian/patches/Fix-localeC-imports.patch pyparted-3.10.0/debian/patches/Fix-localeC-imports.patch
--- pyparted-3.10.0/debian/patches/Fix-localeC-imports.patch	1970-01-01 01:00:00.000000000 +0100
+++ pyparted-3.10.0/debian/patches/Fix-localeC-imports.patch	2014-11-16 00:56:30.000000000 +0100
@@ -0,0 +1,60 @@
+From ed960211d0a23db67fbec4e134365e5ff331fd7d Mon Sep 17 00:00:00 2001
+From: David Cantrell <dcantrell at redhat.com>
+Date: Wed, 22 Oct 2014 09:52:55 -0400
+Subject: [PATCH] Fix localeC imports in a handful of src/parted/*.py files.
+
+Need to use 'from parted.decorators import localeC'
+
+Also fix one instance of 'from parted.cachedlist import CachedList' in
+disk.py
+
+Origin: https://github.com/dcantrell/pyparted/commit/ed960211d0a23db67fbec4e134365e5ff331fd7d
+Last-Update: 2014-11-16
+
+---
+ src/parted/device.py     | 2 +-
+ src/parted/disk.py       | 4 ++--
+ src/parted/filesystem.py | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+Index: pyparted-3.10.0/src/parted/device.py
+===================================================================
+--- pyparted-3.10.0.orig/src/parted/device.py
++++ pyparted-3.10.0/src/parted/device.py
+@@ -28,7 +28,7 @@ import warnings
+ import parted
+ import _ped
+ 
+-from decorators import localeC
++from parted.decorators import localeC
+ 
+ class Device(object):
+     """Device()
+Index: pyparted-3.10.0/src/parted/disk.py
+===================================================================
+--- pyparted-3.10.0.orig/src/parted/disk.py
++++ pyparted-3.10.0/src/parted/disk.py
+@@ -25,8 +25,8 @@
+ import _ped
+ import parted
+ 
+-from cachedlist import CachedList
+-from decorators import localeC
++from parted.cachedlist import CachedList
++from parted.decorators import localeC
+ 
+ class Disk(object):
+     """Disk()
+Index: pyparted-3.10.0/src/parted/filesystem.py
+===================================================================
+--- pyparted-3.10.0.orig/src/parted/filesystem.py
++++ pyparted-3.10.0/src/parted/filesystem.py
+@@ -25,7 +25,7 @@
+ import _ped
+ import parted
+ 
+-from decorators import localeC
++from parted.decorators import localeC
+ 
+ # XXX: add docstrings!
+ 
diff -Nru pyparted-3.10.0/debian/patches/series pyparted-3.10.0/debian/patches/series
--- pyparted-3.10.0/debian/patches/series	2014-09-30 20:10:56.000000000 +0200
+++ pyparted-3.10.0/debian/patches/series	2014-11-16 00:55:19.000000000 +0100
@@ -1 +1,2 @@
 no-last-flag-check.patch
+Fix-localeC-imports.patch



More information about the Parted-maintainers mailing list