[Debian-ha-maintainers] Bug#1028510: crmsh: Fails with python3.11

Bas Couwenberg sebastic at xs4all.nl
Thu Jan 12 06:37:23 GMT 2023


Source: crmsh
Version: 4.4.0-3
Severity: serious
Tags: upstream patch

Dear Maintainer,

Your package fails with python3.11:

 autopkgtest [17:21:55]: test pacemaker-node-status.sh: [-----------------------
 + DAEMON_TIMEOUT=60
 + CRM_TIMEOUT=5
 + ulimit -H -l unlimited
 + service corosync start
 + service pacemaker start
 + sleep 60
 + crm_node -n
 + NODE=node1
 + [ -z node1 ]
 + getent hosts node1
 + echo 127.0.0.1 node1
 + crm status
 + grep Online:.*node1
 Traceback (most recent call last):
   File "/usr/sbin/crm", line 35, in <module>
     from crmsh import main
   File "/usr/lib/python3/dist-packages/crmsh/main.py", line 17, in <module>
     from . import ui_root
   File "/usr/lib/python3/dist-packages/crmsh/ui_root.py", line 201, in <module>
     Root.init_ui()
   File "/usr/lib/python3/dist-packages/crmsh/command.py", line 503, in init_ui
     prepare(children, child, aliases)
   File "/usr/lib/python3/dist-packages/crmsh/command.py", line 488, in prepare
     info = ChildInfo(child, cls)
            ^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3/dist-packages/crmsh/command.py", line 558, in __init__
     self.children = self.level.init_ui()
                     ^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3/dist-packages/crmsh/command.py", line 503, in init_ui
     prepare(children, child, aliases)
   File "/usr/lib/python3/dist-packages/crmsh/command.py", line 488, in prepare
     info = ChildInfo(child, cls)
            ^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3/dist-packages/crmsh/command.py", line 558, in __init__
     self.children = self.level.init_ui()
                     ^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3/dist-packages/crmsh/command.py", line 503, in init_ui
     prepare(children, child, aliases)
   File "/usr/lib/python3/dist-packages/crmsh/command.py", line 494, in prepare
     add_help(info)
   File "/usr/lib/python3/dist-packages/crmsh/command.py", line 476, in add_help
     ui_utils.pretty_arguments(info.function, nskip=2)),
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3/dist-packages/crmsh/ui_utils.py", line 116, in pretty_arguments
     specs = inspect.getargspec(f)
             ^^^^^^^^^^^^^^^^^^
 AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
 autopkgtest [17:22:56]: test pacemaker-node-status.sh: -----------------------]
 autopkgtest [17:22:57]: test pacemaker-node-status.sh:  - - - - - - - - - - results - - - - - - - - - -
 pacemaker-node-status.sh FAIL non-zero exit status 1

The attached patch resolves the issue by using inspect.getfullargspec() instead.

Kind Regards,

Bas
-------------- next part --------------
diff -Nru crmsh-4.4.0/debian/changelog crmsh-4.4.0/debian/changelog
--- crmsh-4.4.0/debian/changelog	2022-11-13 13:18:35.000000000 +0100
+++ crmsh-4.4.0/debian/changelog	2023-01-12 07:13:14.000000000 +0100
@@ -1,3 +1,10 @@
+crmsh (4.4.0-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add patch to not use inspect.getargspec, removed from python3.11.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 12 Jan 2023 07:13:14 +0100
+
 crmsh (4.4.0-3) unstable; urgency=medium
 
   * d/patches: fix crmadmin parsing (Closes: #1023824)
diff -Nru crmsh-4.4.0/debian/patches/getargspec.patch crmsh-4.4.0/debian/patches/getargspec.patch
--- crmsh-4.4.0/debian/patches/getargspec.patch	1970-01-01 01:00:00.000000000 +0100
+++ crmsh-4.4.0/debian/patches/getargspec.patch	2023-01-12 07:13:14.000000000 +0100
@@ -0,0 +1,24 @@
+Description: Don't use inspect.getargspec, removed in Python 3.11.
+Author: Bas Couwenberg <sebastic at debian.org>
+Forwarded: https://github.com/ClusterLabs/crmsh/pull/1112
+
+--- a/crmsh/ui_utils.py
++++ b/crmsh/ui_utils.py
+@@ -113,7 +113,7 @@ def pretty_arguments(f, nskip=0):
+     Returns a prettified representation
+     of the command arguments
+     '''
+-    specs = inspect.getargspec(f)
++    specs = inspect.getfullargspec(f)
+     named_args = []
+     if specs.defaults is None:
+         named_args += specs.args
+@@ -140,7 +140,7 @@ def validate_arguments(f, args, nskip=0)
+ 
+     Note: Does not support keyword arguments.
+     '''
+-    specs = inspect.getargspec(f)
++    specs = inspect.getfullargspec(f)
+     min_args = len(specs.args)
+     if specs.defaults is not None:
+         min_args -= len(specs.defaults)
diff -Nru crmsh-4.4.0/debian/patches/series crmsh-4.4.0/debian/patches/series
--- crmsh-4.4.0/debian/patches/series	2022-11-13 13:02:22.000000000 +0100
+++ crmsh-4.4.0/debian/patches/series	2023-01-12 07:11:27.000000000 +0100
@@ -13,3 +13,4 @@
 0017-Fix-profiles-adoc.patch
 0018-Fix-python3-install.patch
 0019-Fix-crmadmin-parsing.patch
+getargspec.patch


More information about the Debian-ha-maintainers mailing list