Bug#1028996: python-configshell-fb: (autopkgtest) needs update for Python 3.11

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-configshell-fb-1.1.28/debian/changelog 
python-configshell-fb-1.1.28/debian/changelog
--- python-configshell-fb-1.1.28/debian/changelog   2021-01-23 
01:31:23.0 +0100
+++ python-configshell-fb-1.1.28/debian/changelog   2023-01-19 
10:19:15.0 +0100
@@ -1,3 +1,11 @@
+python-configshell-fb (1:1.1.28-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add upstream patches to fix test failure with python3.11.
+(closes: #1028996)
+
+ -- Bas Couwenberg   Thu, 19 Jan 2023 10:19:15 +0100
+
 python-configshell-fb (1:1.1.28-2) unstable; urgency=medium
 
   * d/t/control: Remove "Tests" header.  Use "@" as "Depends".
diff -Nru 
python-configshell-fb-1.1.28/debian/patches/replace-getargspec-with-getfullargspec.patch
 
python-configshell-fb-1.1.28/debian/patches/replace-getargspec-with-getfullargspec.patch
--- 
python-configshell-fb-1.1.28/debian/patches/replace-getargspec-with-getfullargspec.patch
1970-01-01 01:00:00.0 +0100
+++ 
python-configshell-fb-1.1.28/debian/patches/replace-getargspec-with-getfullargspec.patch
2023-01-19 10:17:30.0 +0100
@@ -0,0 +1,31 @@
+Description: replace getargspec() with getfullargspec()
+ inspect.getargspec() doesn't work anymore with Python3.11
+Author: Maurizio Lombardi 
+Origin: 
https://github.com/open-iscsi/configshell-fb/commit/f3ac914861bd605e3d634aeeb5e706abdbd39259
+Forwarded: not-needed
+Bug-Debian: https://bugs.debian.org/1028996
+
+--- a/configshell/node.py
 b/configshell/node.py
+@@ -1417,10 +1417,10 @@ class ConfigNode(object):
+ @type kparams: dict
+ @raise ExecutionError: When the check fails.
+ '''
+-spec = inspect.getargspec(method)
++spec = inspect.getfullargspec(method)
+ args = spec.args[1:]
+ pp = spec.varargs
+-kw = spec.keywords
++kw = spec.varkw
+ 
+ if spec.defaults is None:
+ nb_opt_params = 0
+@@ -1460,7 +1460,7 @@ class ConfigNode(object):
+ "Missing required parameters %s"
+ % ", ".join("'%s'" % missing for missing in missing_params))
+ 
+-if spec.keywords is None:
++if kw is None:
+ if len(unexpected_keywords) == 1:
+ raise ExecutionError(
+ "Unexpected keyword parameter '%s'."
diff -Nru 
python-configshell-fb-1.1.28/debian/patches/replace-more-occurrences-of-getargspec-with-getfullargspec.patch
 
python-configshell-fb-1.1.28/debian/patches/replace-more-occurrences-of-getargspec-with-getfullargspec.patch
--- 
python-configshell-fb-1.1.28/debian/patches/replace-more-occurrences-of-getargspec-with-getfullargspec.patch
1970-01-01 01:00:00.0 +0100
+++ 
python-configshell-fb-1.1.28/debian/patches/replace-more-occurrences-of-getargspec-with-getfullargspec.patch
2023-01-19 10:19:04.0 +0100
@@ -0,0 +1,70 @@
+Description: Replace more occurrences of getargspec() with getfullargspec()
+ Follow up for f3ac914861bd605e3d634aeeb5e706abdbd39259, getargspec was used 
at two more places.
+Author: Vojtech Trefny 
+Origin: 
https://github.com/open-iscsi/configshell-fb/commit/343e46cbbbed339c67fe969cdf443af4c979f43e
+Forwarded: not-needed
+Bug-Debian: https://bugs.debian.org/1028996
+
+--- a/configshell/node.py
 b/configshell/node.py
+@@ -1575,12 +1575,12 @@ class ConfigNode(object):
+ @type command: str
+ '''
+ method = self.get_command_method(command)
+-parameters, args, kwargs, default = inspect.getargspec(method)
+-parameters = parameters[1:]
+-if default is None:
++spec = inspect.getfullargspec(method)
++parameters = spec.args[1:]
++if spec.defaults is None:
+ num_defaults = 0
+ else:
+-num_defaults = len(default)
++num_defaults = len(spec.defaults)
+ 
+ if num_defaults != 0:
+ required_parameters = parameters[:-num_defaults]
+@@ -1605,16 +1605,16 @@ class ConfigNode(object):
+ syntax += optional_parameters_str
+ 
+ comments = []
+-if args is not None:
+-syntax += "[%s...] " % args
+-if kwargs is not None:
+-syntax += "[%s=value...] " % (kwargs)
++if spec.varargs is not None:
++syntax += "[%s...] " % spec.varargs
++if spec.varkw is not None:
++syntax += "[%s=value...] " % (spec.varkw)
+ 
+ default_values = ''
+ if num_defaults > 0:
+ for index, param in enumerate(optional_parameters):
+-if default[index] is not None:
+-default_values += "%s=%s " % (param, str(default[index]))
++if spec.defaults[index] is not None:
++default_values += "%s=%s " % (param, 

Bug#1028996: python-configshell-fb: (autopkgtest) needs update for Python 3.11

2023-01-15 Thread Graham Inggs
Source: python-configshell-fb
Version: 1:1.1.28-2
Severity: serious
Tag: bookworm sid
User: debian...@lists.debian.org
Usertags: needs-update
User: debian-pyt...@lists.debian.org
Usertags: python3.11
Control: affects -1 src:python3-defaults

Hi Maintainer

The autopkgtests of python-configshell-fb fail with Python 3.11 as the
default version (and Python 3.10 still supported) [1].  I've copied
what I hope is the relevant part of the log below.

Regards
Graham


[1] https://ci.debian.net/packages/p/python-configshell-fb/testing/amd64/


Traceback (most recent call last):
  File "/tmp/autopkgtest-lxc.xyuu059i/downtmp/build.k7y/src/examples/myshell",
line 173, in 
main()
  File "/tmp/autopkgtest-lxc.xyuu059i/downtmp/build.k7y/src/examples/myshell",
line 170, in main
shell.run_interactive()
  File "/usr/lib/python3/dist-packages/configshell_fb/shell.py", line
900, in run_interactive
self._cli_loop()
  File "/usr/lib/python3/dist-packages/configshell_fb/shell.py", line
729, in _cli_loop
self.run_cmdline(cmdline)
  File "/usr/lib/python3/dist-packages/configshell_fb/shell.py", line
843, in run_cmdline
self._execute_command(path, command, pparams, kparams)
  File "/usr/lib/python3/dist-packages/configshell_fb/shell.py", line
818, in _execute_command
result = target.execute_command(command, pparams, kparams)
 ^
  File "/usr/lib/python3/dist-packages/configshell_fb/node.py", line
1405, in execute_command
self.assert_params(method, pparams, kparams)
  File "/usr/lib/python3/dist-packages/configshell_fb/node.py", line
1420, in assert_params
spec = inspect.getargspec(method)
   ^^
AttributeError: module 'inspect' has no attribute 'getargspec'. Did
you mean: 'getargs'?