Skip to content

gui(vdigit): Fix for Wrong number of arguments in a call of stub class - #7393

Merged
petrasovaa merged 1 commit into
OSGeo:mainfrom
echoix-org:finding-autofix-e8c93973
May 18, 2026
Merged

petrasovaa merged 1 commit into
OSGeo:mainfrom
echoix-org:finding-autofix-e8c93973

Conversation

@echoix

@echoix echoix commented May 15, 2026 •

Copy link
Copy Markdown
Member

If we look at the stub class created as a fallback just above in that small file, we clearly see that calling __init__ with more arguments than the stub won’t work. So add the extra arguments.


Generated PR text:
To fix this without changing behavior, make the fallback IVDigit constructor accept the same arguments as the primary implementation usage in VDigit.__init__.

Best single fix:

  • File: gui/wxpython/vdigit/main.py
  • Region: fallback class in the except block (lines 27–29 in snippet)
  • Change:
    • from def __init__(self):
    • to def __init__(self, giface, mapwindow):
  • Keep body as pass (stub behavior unchanged).
  • No new imports or dependencies are needed.

This preserves existing functionality while removing the argument-count runtime hazard and satisfying the static analysis rule.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions github-actions Bot added GUI wxGUI related Python Related code is in Python labels May 15, 2026
@echoix
echoix requested review from ninsbl, pesekon2 and petrasovaa May 15, 2026 01:50
@petrasovaa
petrasovaa merged commit 810b065 into OSGeo:main May 18, 2026
27 checks passed
@github-actions github-actions Bot added this to the 8.6.0 milestone May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GUI wxGUI related Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants