[Python-modules-team] Bug#1001244: circuits: needs update for python3.10: 'Callable' from 'collections' is removed

Steve Langasek steve.langasek at canonical.com
Sat Dec 11 01:47:46 GMT 2021


Package: circuits
Version: 3.1.0+ds1-2
Followup-For: Bug #1001244
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu jammy ubuntu-patch
Control: tags -1 patch

Apologies, the previous patch let the import test pass in local testing
here, but is incomplete.  Please find attached a more complete patch that
should actually let autopkgtests pass.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru circuits-3.1.0+ds1/debian/patches/python-3.10.patch circuits-3.1.0+ds1/debian/patches/python-3.10.patch
--- circuits-3.1.0+ds1/debian/patches/python-3.10.patch	1969-12-31 16:00:00.000000000 -0800
+++ circuits-3.1.0+ds1/debian/patches/python-3.10.patch	2021-12-10 17:35:24.000000000 -0800
@@ -0,0 +1,97 @@
+Description: compatibility with python 3.10
+Author: Steve Langasek <steve.langasek at ubuntu.com>
+Bug-Debian: https://bugs.debian.org/1001244
+Last-Update: 2021-12-10
+Forwarded: no
+
+Index: circuits-3.1.0+ds1/circuits/core/handlers.py
+===================================================================
+--- circuits-3.1.0+ds1.orig/circuits/core/handlers.py
++++ circuits-3.1.0+ds1/circuits/core/handlers.py
+@@ -7,7 +7,7 @@
+ """
+ 
+ from inspect import getargspec
+-from collections import Callable
++from collections.abc import Callable
+ 
+ 
+ def handler(*names, **kwargs):
+Index: circuits-3.1.0+ds1/circuits/core/components.py
+===================================================================
+--- circuits-3.1.0+ds1.orig/circuits/core/components.py
++++ circuits-3.1.0+ds1/circuits/core/components.py
+@@ -9,7 +9,7 @@
+ from itertools import chain
+ from types import MethodType
+ from inspect import getmembers
+-from collections import Callable
++from collections.abc import Callable
+ 
+ from .manager import Manager
+ from .handlers import handler, HandlerMetaClass
+Index: circuits-3.1.0+ds1/circuits/web/controllers.py
+===================================================================
+--- circuits-3.1.0+ds1.orig/circuits/web/controllers.py
++++ circuits-3.1.0+ds1/circuits/web/controllers.py
+@@ -9,7 +9,7 @@
+ 
+ import json
+ from inspect import getargspec
+-from collections import Callable
++from collections.abc import Callable
+ from functools import update_wrapper
+ 
+ from circuits.core import handler, BaseComponent
+Index: circuits-3.1.0+ds1/circuits/web/parsers/multipart.py
+===================================================================
+--- circuits-3.1.0+ds1.orig/circuits/web/parsers/multipart.py
++++ circuits-3.1.0+ds1/circuits/web/parsers/multipart.py
+@@ -57,7 +57,7 @@
+ # Some of these were copied from bottle: http://bottle.paws.de/
+ 
+ try:
+-    from collections import MutableMapping as DictMixin
++    from collections.abc import MutableMapping as DictMixin
+ except ImportError: # pragma: no cover (fallback for Python 2.5)
+     from UserDict import DictMixin
+ 
+Index: circuits-3.1.0+ds1/circuits/web/tools.py
+===================================================================
+--- circuits-3.1.0+ds1.orig/circuits/web/tools.py
++++ circuits-3.1.0+ds1/circuits/web/tools.py
+@@ -316,7 +316,7 @@
+         if not encrypt:
+             encrypt = _httpauth.DIGEST_AUTH_ENCODERS[_httpauth.MD5]
+ 
+-        if isinstance(users, collections.Callable):
++        if isinstance(users, collections.abc.Callable):
+             try:
+                 # backward compatibility
+                 users = users()  # expect it to return a dictionary
+Index: circuits-3.1.0+ds1/circuits/web/utils.py
+===================================================================
+--- circuits-3.1.0+ds1.orig/circuits/web/utils.py
++++ circuits-3.1.0+ds1/circuits/web/utils.py
+@@ -14,7 +14,7 @@
+ from math import sqrt
+ from io import TextIOWrapper
+ from cgi import FieldStorage
+-from collections import MutableMapping
++from collections.abc import MutableMapping
+ 
+ try:
+     from urllib.parse import urljoin as _urljoin
+Index: circuits-3.1.0+ds1/tests/conftest.py
+===================================================================
+--- circuits-3.1.0+ds1.orig/tests/conftest.py
++++ circuits-3.1.0+ds1/tests/conftest.py
+@@ -101,7 +101,7 @@
+ def wait_for(obj, attr, value=True, timeout=3.0):
+     from circuits.core.manager import TIMEOUT
+     for i in range(int(timeout / TIMEOUT)):
+-        if isinstance(value, collections.Callable):
++        if isinstance(value, collections.abc.Callable):
+             if value(obj, attr):
+                 return True
+         elif getattr(obj, attr) == value:
diff -Nru circuits-3.1.0+ds1/debian/patches/series circuits-3.1.0+ds1/debian/patches/series
--- circuits-3.1.0+ds1/debian/patches/series	2019-08-05 00:03:56.000000000 -0700
+++ circuits-3.1.0+ds1/debian/patches/series	2021-12-10 12:01:30.000000000 -0800
@@ -3,3 +3,4 @@
 03_disable-address-check.patch
 04_remove-google-adsense.patch
 05_remove-privacy-breach-badges.patch
+python-3.10.patch


More information about the Python-modules-team mailing list