[Pkg-electronics-devel] Bug#1032392: python3-scikit-rf: import fails: AttributeError: module 'collections' has no attribute 'Sequence'

Josef Schneider josef81sch at gmail.com
Wed Apr 5 13:50:46 BST 2023


Hello,

I have attached a debdiff where I import the collections.abc python 
package which has the Sequence and MutableMapping attributes instead of 
collections. This patch is applied to the 0.15.4 upstream which is the 
current in debian. With this fix, the package builds and importing the 
skrf package in a python console works as expected. I can upload this RC 
bug fix as a NMU if you want. Thanks!

-- 
Josef Schneider

GPG Fingerprint 3267 0331 DB61 A817 7D25 4D05 5A44 BC12 F2A8 E58F
-------------- next part --------------
diff -Nru scikit-rf-0.15.4/debian/changelog scikit-rf-0.15.4/debian/changelog
--- scikit-rf-0.15.4/debian/changelog	2020-12-02 09:46:23.000000000 +0100
+++ scikit-rf-0.15.4/debian/changelog	2023-04-04 19:53:06.000000000 +0200
@@ -1,3 +1,11 @@
+scikit-rf (0.15.4-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add patch to import python package collections.abc instead of collections.
+    + Fixes AttributeError when importing the package (Closes: #1032392).
+
+ -- Josef Schneider <josef81sch at gmail.com>  Tue, 04 Apr 2023 19:53:06 +0200
+
 scikit-rf (0.15.4-2) unstable; urgency=medium
 
   * First source-only upload
diff -Nru scikit-rf-0.15.4/debian/patches/0002-import-collections-abc.patch scikit-rf-0.15.4/debian/patches/0002-import-collections-abc.patch
--- scikit-rf-0.15.4/debian/patches/0002-import-collections-abc.patch	1970-01-01 01:00:00.000000000 +0100
+++ scikit-rf-0.15.4/debian/patches/0002-import-collections-abc.patch	2023-04-04 19:53:06.000000000 +0200
@@ -0,0 +1,43 @@
+From eb86566f22b80cf782585dc04d872fc11b437946 Mon Sep 17 00:00:00 2001
+From: Josef Schneider <josef81sch at gmail.com>
+Date: Tue, 4 Apr 2023 20:04:21 +0200
+Subject: [PATCH] import collections abc
+
+---
+ skrf/util.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/skrf/util.py b/skrf/util.py
+index b9566f3..355ec0e 100644
+--- a/skrf/util.py
++++ b/skrf/util.py
+@@ -32,7 +32,7 @@ import six.moves.cPickle as pickle
+ 
+ import numpy as npy
+ from datetime import datetime
+-import collections
++import collections.abc
+ import pprint
+ import re
+ from subprocess import Popen, PIPE
+@@ -286,7 +286,7 @@ def findReplace(directory, find, replace, filePattern):
+ 
+ # general purpose objects
+ 
+-class HomoList(collections.Sequence):
++class HomoList(collections.abc.Sequence):
+     '''
+ 
+     A Homogeneous Sequence
+@@ -384,7 +384,7 @@ class HomoList(collections.Sequence):
+         return pprint.pformat(self.store)
+ 
+ 
+-class HomoDict(collections.MutableMapping):
++class HomoDict(collections.abc.MutableMapping):
+     '''
+     A Homogeneous Mutable Mapping
+ 
+-- 
+2.38.1
+
diff -Nru scikit-rf-0.15.4/debian/patches/series scikit-rf-0.15.4/debian/patches/series
--- scikit-rf-0.15.4/debian/patches/series	2020-12-02 09:45:36.000000000 +0100
+++ scikit-rf-0.15.4/debian/patches/series	2023-04-04 19:53:06.000000000 +0200
@@ -1 +1,2 @@
 0001-Included-script-should-run-with-Python-3.patch
+0002-import-collections-abc.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x5A44BC12F2A8E58F.asc
Type: application/pgp-keys
Size: 3155 bytes
Desc: OpenPGP public key
URL: <http://alioth-lists.debian.net/pipermail/pkg-electronics-devel/attachments/20230405/246210a5/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-electronics-devel/attachments/20230405/246210a5/attachment.sig>


More information about the Pkg-electronics-devel mailing list