Skip to content

Fix: Replace inspect.getargspec with inspect.signature for Python 3.1… #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Vidito
Copy link

@Vidito Vidito commented Jul 6, 2025

On Python versions 3.11 and newer, the bottle-sqlite plugin currently raises an AttributeError: module 'inspect' has no attribute 'getargspec'. This occurs because inspect.getargspec was deprecated in Python 3.0 and completely removed in Python 3.11, being replaced by inspect.signature.

This pull request updates the apply method to use inspect.signature when inspect.getargspec is not available. A try-except AttributeError block has been implemented to handle the absence of getargspec, ensuring that the plugin remains compatible with both older Python versions (which still have getargspec) and newer versions (Python 3.11+).

The logic now attempts to use inspect.getargspec first, and if an AttributeError is caught, it falls back to using inspect.signature to retrieve the function's parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant