[Bugfix] Addonmanager error: "NameError: name 'warnings' is not defined. Did you mean: 'Warning'?"

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
Frank Schrüfer
Posts: 34
Joined: Sat Dec 25, 2021 12:23 pm

[Bugfix] Addonmanager error: "NameError: name 'warnings' is not defined. Did you mean: 'Warning'?"

Post by Frank Schrüfer »

Function declaration misses parameter:

diff Mod/AddonManager/addonmanager_macro.py.orig Mod/AddonManager/addonmanager_macro.py
465c465
< self._fetch_single_file(other_file, src_file, dst_file)
---
> self._fetch_single_file(other_file, src_file, dst_file, warnings)
472c472
< def _fetch_single_file(self, other_file, src_file, dst_file):
---
> def _fetch_single_file(self, other_file, src_file, dst_file, warnings):

Sorry, don't have the time to go through the git clone ... process.
As this is no reinvention of the wheel I hope somebody can apply this easy correction to the code.

Regards,
Frank

Code: Select all

OS: openSUSE Tumbleweed (KDE//usr/share/xsessions/plasma5)
Word size of FreeCAD: 64-bit
Version: 0.21.30418 (Git)
Build type: DEBUG
Branch: master
Hash: 73c586ba52210cf56db2ab76aa192042f5ce71ef
Python 3.10.7, Qt 5.15.5, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: German/Germany (de_DE)
Installed mods:
  * AirPlaneDesign 0.4.0
  * BIM 2021.12.0
  * BOLTSFC
  * Beltrami 1.0.7-alpha
  * CADExchanger
  * CommandPanel
  * CubeMenu
  * CurvedShapes 1.0.4
  * Curves 0.5.8
  * Defeaturing 1.2.0
  * Design456 0.0.1
  * DesignSPHysics 0.6.1-2207-03-01
  * DynamicData 2.46.0
  * EM
  * ExplodedAssembly
  * FEM_FrontISTR 0.1.0
  * IconThemes
  * ImportNURBS 1.1.0
  * InventorLoader 1.3.0
  * LCInterlocking
  * Lithophane
  * MakerWorkbench
  * OSE3dPrinter
  * dodo
  * frame 0.1.0
  * lattice2 1.0.0
  * nurbs
  * ose-piping
  * parts_library
  * pcb
  * Autoload
  * POV-Ray-Rendering
  * Pyramids-and-Polyhedrons
  * pyrate
  * ose-workbench-core-master
  * Glass
  * Help 1.0.3
  * Assembly4 0.1.0
  * 3DfindIT.backup1663671805.323724 1.2.0 (Disabled)
  * 3DfindIT 1.2.0
  * fasteners 0.4.6
  * Manipulator 0.1.0
  * Marz 0.4.6
  * MeshRemodel 1.8919.0
  * MnesarcoUtils 0.1.0
  * OpticsWorkbench 0.1.0
  * Plot 0.1.0
  * Reinforcement 0.1.0
  * GDML.backup1663673388.5000124 1.8.0 (Disabled)
  * GDML 2.0.0
  * fcgear.backup1663675698.5467753 1.0.0 (Disabled)
  * fcgear 1.0.0
P.S.:
Traceback to the error was:

Code: Select all

Traceback (most recent call last):
  File "/home/system/usr/FreeCAD/bin/build/Mod/AddonManager/addonmanager_workers_installation.py", line 858, in run
    self.update_macro(repo)
  File "/home/system/usr/FreeCAD/bin/build/Mod/AddonManager/addonmanager_workers_installation.py", line 875, in update_macro
    install_succeeded, _ = repo.macro.install(cache_path)
  File "/home/system/usr/FreeCAD/bin/build/Mod/AddonManager/addonmanager_macro.py", line 414, in install
    success = self._copy_other_files(macro_dir, warnings)
  File "/home/system/usr/FreeCAD/bin/build/Mod/AddonManager/addonmanager_macro.py", line 465, in _copy_other_files
    self._fetch_single_file(other_file, src_file, dst_file)
  File "/home/system/usr/FreeCAD/bin/build/Mod/AddonManager/addonmanager_macro.py", line 491, in _fetch_single_file
    warnings.append(
NameError: name 'warnings' is not defined. Did you mean: 'Warning'?
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: [Bugfix] Addonmanager error: "NameError: name 'warnings' is not defined. Did you mean: 'Warning'?"

Post by chennes »

Thanks for the fix! Applied in git commit bf7732cbc.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply