Skip to content
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

Some builtins are only available under Windows or newer Python version #119

Open
tristanlatr opened this issue Jan 27, 2025 · 2 comments · May be fixed by #121
Open

Some builtins are only available under Windows or newer Python version #119

tristanlatr opened this issue Jan 27, 2025 · 2 comments · May be fixed by #121

Comments

@tristanlatr
Copy link
Contributor

tristanlatr commented Jan 27, 2025

The WindowsError builtin name only exist under Windows, so if we are analyzing a module that uses it under Linux it will erroneously marked as unbound.

A possible solution would be to use typeshed to parse the builtins instead of using the actual runtime values. EDIT: This would be too much time consuming… we would have to cache it globally and that probably not a good practice

Another solution would be to manually add the missing names. But it will need maintenance if new problematic builtin names are discovered.

@tristanlatr tristanlatr changed the title Some builtins are only available under Windows Some builtins are only available under Windows or newer Python version Jan 28, 2025
@tristanlatr
Copy link
Contributor Author

The aiter and anext are only available under Python 3.10+.
EncodingWarning as well, and PythonFinalizationError is for Python 3.13+. So the same kind of problem applies to Python version as well.

@tristanlatr
Copy link
Contributor Author

Another idea: maybe the builtin dict can be passed as a parameter so this issue can be fixed in the client side ?

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 a pull request may close this issue.

1 participant