Bug#1028731: python-crank: FTBFS: ImportError: cannot import name 'getargspec' from 'inspect' (/usr/lib/python3.11/inspect.py)

2023-01-19 Thread Sebastiaan Couwenberg

Control: tags -1 patch

The attached patch resolves the issue.

Kind Regards,

Bas

--
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1diff -Nru python-crank-0.7.2/debian/changelog 
python-crank-0.7.2/debian/changelog
--- python-crank-0.7.2/debian/changelog 2019-10-06 12:11:53.0 +0200
+++ python-crank-0.7.2/debian/changelog 2023-01-19 14:29:02.0 +0100
@@ -1,3 +1,11 @@
+python-crank (0.7.2-5.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add patch to fix FTBFS with python3.11.
+(closes: #1028731)
+
+ -- Bas Couwenberg   Thu, 19 Jan 2023 14:29:02 +0100
+
 python-crank (0.7.2-5) unstable; urgency=medium
 
   [ Ondřej Nový ]
diff -Nru python-crank-0.7.2/debian/patches/python3.11.patch 
python-crank-0.7.2/debian/patches/python3.11.patch
--- python-crank-0.7.2/debian/patches/python3.11.patch  1970-01-01 
01:00:00.0 +0100
+++ python-crank-0.7.2/debian/patches/python3.11.patch  2023-01-19 
14:29:01.0 +0100
@@ -0,0 +1,25 @@
+Description: Don't used getargspec, removed in python3.11.
+Author: Bas Couwenberg 
+Forwarded: not-needed
+Bug-Debian: https://bugs.debian.org/1028731
+
+--- a/crank/util.py
 b/crank/util.py
+@@ -6,7 +6,7 @@ MIT License
+ """
+ 
+ import collections, sys, string
+-from inspect import getargspec
++from inspect import getfullargspec
+ 
+ __all__ = [
+ 'get_argspec', 'get_params_with_argspec', 
'remove_argspec_params_from_params',
+@@ -31,7 +31,7 @@ def get_argspec(func):
+ try:
+ argspec = _cached_argspecs[im_func]
+ except KeyError:
+-spec = getargspec(im_func)
++spec = getfullargspec(im_func)
+ argvals = spec[3]
+ 
+ # this is a work around for a crappy api choice in getargspec
diff -Nru python-crank-0.7.2/debian/patches/series 
python-crank-0.7.2/debian/patches/series
--- python-crank-0.7.2/debian/patches/series2019-10-06 12:11:53.0 
+0200
+++ python-crank-0.7.2/debian/patches/series2023-01-19 14:26:26.0 
+0100
@@ -1 +1,2 @@
 remove-broken-test.patch
+python3.11.patch


Bug#1028731: python-crank: FTBFS: ImportError: cannot import name 'getargspec' from 'inspect' (/usr/lib/python3.11/inspect.py)

2023-01-14 Thread Lucas Nussbaum
Source: python-crank
Version: 0.7.2-5
Severity: serious
Justification: FTBFS
Tags: bookworm sid ftbfs
User: lu...@debian.org
Usertags: ftbfs-20230113 ftbfs-bookworm

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.


Relevant part (hopefully):
> make[1]: Entering directory '/<>'
> make[1]: pyversions: No such file or directory
> py3versions: no X-Python3-Version in control file, using supported versions
> set -e ; for pyvers in 3.10 3.11; do \
>   PYTHON=python$pyvers nosetests3 -v ; \
> done
> Failure: ImportError (cannot import name 'getargspec' from 'inspect' 
> (/usr/lib/python3.11/inspect.py)) ... ERROR
> tests.test_dispatcher.TestDispatcher.test_create ... ok
> tests.test_dispatcher.TestDispatcher.test_dispatch ... ok
> Failure: ImportError (cannot import name 'getargspec' from 'inspect' 
> (/usr/lib/python3.11/inspect.py)) ... ERROR
> Failure: ImportError (cannot import name 'getargspec' from 'inspect' 
> (/usr/lib/python3.11/inspect.py)) ... ERROR
> Failure: ImportError (cannot import name 'getargspec' from 'inspect' 
> (/usr/lib/python3.11/inspect.py)) ... ERROR
> 
> ==
> ERROR: Failure: ImportError (cannot import name 'getargspec' from 'inspect' 
> (/usr/lib/python3.11/inspect.py))
> --
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
> raise self.exc_val.with_traceback(self.tb)
>   File "/usr/lib/python3/dist-packages/nose/loader.py", line 416, in 
> loadTestsFromName
> module = self.importer.importFromPath(
>  ^
>   File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in 
> importFromPath
> return self.importFromDir(dir_path, fqname)
>
>   File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in 
> importFromDir
> mod = load_module(part_fqname, fh, filename, desc)
>   
>   File "/usr/lib/python3.11/imp.py", line 235, in load_module
> return load_source(name, filename, file)
>^
>   File "/usr/lib/python3.11/imp.py", line 172, in load_source
> module = _load(spec)
>  ^^^
>   File "", line 721, in _load
>   File "", line 690, in _load_unlocked
>   File "", line 940, in exec_module
>   File "", line 241, in _call_with_frames_removed
>   File "/<>/tests/test_dispachstate.py", line 1, in 
> from crank.dispatchstate import DispatchState
>   File "/<>/crank/dispatchstate.py", line 4, in 
> from crank.util import default_path_translator, noop_translation
>   File "/<>/crank/util.py", line 9, in 
> from inspect import getargspec
> ImportError: cannot import name 'getargspec' from 'inspect' 
> (/usr/lib/python3.11/inspect.py)
> 
> ==
> ERROR: Failure: ImportError (cannot import name 'getargspec' from 'inspect' 
> (/usr/lib/python3.11/inspect.py))
> --
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
> raise self.exc_val.with_traceback(self.tb)
>   File "/usr/lib/python3/dist-packages/nose/loader.py", line 416, in 
> loadTestsFromName
> module = self.importer.importFromPath(
>  ^
>   File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in 
> importFromPath
> return self.importFromDir(dir_path, fqname)
>
>   File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in 
> importFromDir
> mod = load_module(part_fqname, fh, filename, desc)
>   
>   File "/usr/lib/python3.11/imp.py", line 235, in load_module
> return load_source(name, filename, file)
>^
>   File "/usr/lib/python3.11/imp.py", line 172, in load_source
> module = _load(spec)
>  ^^^
>   File "", line 721, in _load
>   File "", line 690, in _load_unlocked
>   File "", line 940, in exec_module
>   File "", line 241, in _call_with_frames_removed
>   File "/<>/tests/test_objectdispatcher.py", line 4, in 
> from crank.objectdispatcher import *
>   File "/<>/crank/objectdispatcher.py", line 19, in 
> from crank.util import get_argspec, method_matches_args
>   File "/<>/crank/util.py", line 9, in 
> from inspect import getargspec
> ImportError: cannot import name 'getargspec' from 'inspect' 
> (/usr/lib/python3.11/inspect.py)
> 
> ==
> ERROR: Failure: ImportError (cannot import name 'getargspec' from 'inspect' 
>