Skip to content

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

Open
echoix wants to merge 1 commit into
OSGeo:mainfrom
echoix-org:finding-autofix-e8c93973
Open

gui(vdigit): Fix for Wrong number of arguments in a call of stub class#7393
echoix wants to merge 1 commit into
OSGeo:mainfrom
echoix-org:finding-autofix-e8c93973

Conversation

@echoix
Copy link
Copy Markdown
Member

@echoix echoix commented May 15, 2026

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 and petrasovaa May 15, 2026 01:50
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.

1 participant