Bug#1031566: freecad-common: inspect.getargspec is used in gui_snapper.py which is no longer supported by python >= 3.10

2023-06-30 Thread Petter Reinholdtsen
I have added this patch to the Debian package git repository, and
discovered in the process that the fix was already applied upstream
in https://github.com/FreeCAD/FreeCAD/pull/8101, commit
fe02d63c8c9b1280978be841d04e68a0a55cceb9.
-- 
Happy hacking
Petter Reinholdtsen



Bug#1031566: freecad-common: inspect.getargspec is used in gui_snapper.py which is no longer supported by python >= 3.10

2023-02-18 Thread Manfred Tremmmel
Package: freecad-common
Version: 0.20.2+dfsg1-4
Severity: normal
Tags: patch




-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-3-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de:en_US:en_GB
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information

Recognized this error when trying the arch tutorials, I wasn't able to add 
doors or windows to the house.
The console has shown the error-message:
AttributeError: module 'inspect' has no attribute 'getargspec'.
--- gui_snapper.py.orig 2023-02-18 19:41:38.699975796 +0100
+++ gui_snapper.py  2023-02-18 19:41:15.843883848 +0100
@@ -1426,7 +1426,7 @@
 Gui.Snapper.off()
 self.ui.offUi()
 if callback:
-if len(inspect.getargspec(callback).args) > 1:
+if len(inspect.getfullargspec(callback).args) > 1:
 obj = None
 if self.snapInfo and ("Object" in self.snapInfo) and 
self.snapInfo["Object"]:
 obj = 
App.ActiveDocument.getObject(self.snapInfo["Object"])
@@ -1445,7 +1445,7 @@
 Gui.Snapper.off()
 self.ui.offUi()
 if callback:
-if len(inspect.getargspec(callback).args) > 1:
+if len(inspect.getfullargspec(callback).args) > 1:
 callback(None, None)
 else:
 callback(None)
--- gui_snapper.py.orig 2023-02-18 19:41:38.699975796 +0100
+++ gui_snapper.py  2023-02-18 19:41:15.843883848 +0100
@@ -1426,7 +1426,7 @@
 Gui.Snapper.off()
 self.ui.offUi()
 if callback:
-if len(inspect.getargspec(callback).args) > 1:
+if len(inspect.getfullargspec(callback).args) > 1:
 obj = None
 if self.snapInfo and ("Object" in self.snapInfo) and 
self.snapInfo["Object"]:
 obj = 
App.ActiveDocument.getObject(self.snapInfo["Object"])
@@ -1445,7 +1445,7 @@
 Gui.Snapper.off()
 self.ui.offUi()
 if callback:
-if len(inspect.getargspec(callback).args) > 1:
+if len(inspect.getfullargspec(callback).args) > 1:
 callback(None, None)
 else:
 callback(None)
--- gui_snapper.py.orig 2023-02-18 19:41:38.699975796 +0100
+++ gui_snapper.py  2023-02-18 19:41:15.843883848 +0100
@@ -1426,7 +1426,7 @@
 Gui.Snapper.off()
 self.ui.offUi()
 if callback:
-if len(inspect.getargspec(callback).args) > 1:
+if len(inspect.getfullargspec(callback).args) > 1:
 obj = None
 if self.snapInfo and ("Object" in self.snapInfo) and 
self.snapInfo["Object"]:
 obj = 
App.ActiveDocument.getObject(self.snapInfo["Object"])
@@ -1445,7 +1445,7 @@
 Gui.Snapper.off()
 self.ui.offUi()
 if callback:
-if len(inspect.getargspec(callback).args) > 1:
+if len(inspect.getfullargspec(callback).args) > 1:
 callback(None, None)
 else:
 callback(None)