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

Make sys.dllhandle available on non-Windows #129457

Closed
FFY00 opened this issue Jan 29, 2025 · 3 comments
Closed

Make sys.dllhandle available on non-Windows #129457

FFY00 opened this issue Jan 29, 2025 · 3 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@FFY00
Copy link
Member

FFY00 commented Jan 29, 2025

Feature or enhancement

Proposal:

We currently expose the Python library path, if available, as sys.dllhandle on Windows. This could also be helpful on other platforms.

My main worry are hasattr(sys, 'dllhandle') checks that assume its availability on Windows only. @zooba, do you have any concerns about this?

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

@FFY00 FFY00 added type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels Jan 29, 2025
@zooba
Copy link
Member

zooba commented Jan 30, 2025

I don't think this attribute transfers well to other OS's - it would be the equivalent of returning dlopen(sysconfig.get_config_var("LIBRARY")) (or something like that - I guessed the variable name).

It's most useful for ctypes, which I believe already has a way to get the current Python API?

@FFY00
Copy link
Member Author

FFY00 commented Jan 31, 2025

Ugh, yes 🤦. What I want is an attribute with the path of the runtime library.

@FFY00 FFY00 closed this as completed Jan 31, 2025
@FFY00
Copy link
Member Author

FFY00 commented Jan 31, 2025

Opened GH-129492.

@ncoghlan ncoghlan closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants