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

glasgow.platform module shadows standard lib #189

Closed
DurandA opened this issue Mar 5, 2020 · 3 comments
Closed

glasgow.platform module shadows standard lib #189

DurandA opened this issue Mar 5, 2020 · 3 comments
Labels
question Meta: question / support issue

Comments

@DurandA
Copy link

DurandA commented Mar 5, 2020

The glasgow.platform module shadows the platform module from the standard Python library. This is problematic when importing libusb1 (import usb1) from an interpreter launched from the glasgow module:

AttributeError: module 'platform' has no attribute 'system'

May I suggest to rename the platform module to platform_?

@DurandA DurandA changed the title platform module shadows standard lib glasgow.platform module shadows standard lib Mar 5, 2020
@whitequark whitequark added the question Meta: question / support issue label Mar 5, 2020
@whitequark
Copy link
Member

Why are you running an interpreter from within the glasgow module? It's namespaced under glasgow. toplevel module specifically to prevent this sort of problem.

@DurandA
Copy link
Author

DurandA commented Mar 5, 2020

Why are you running an interpreter from within the glasgow module?

There is no particular reason, I was just there when testing one of my scripts.

It's namespaced under glasgow. toplevel module specifically to prevent this sort of problem.

Fair enough, I just thought that it was kind of evil to name modules after modules from standard lib.

Sorry, something went wrong.

@DurandA DurandA closed this as completed Mar 5, 2020
@whitequark
Copy link
Member

I just thought that it was kind of evil to name modules after modules from standard lib.

Evil? Future versions of Python can add new modules to standard library. Am I supposed to avoid those names, too? I didn't even realize there is a platform module.

Sorry, something went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Meta: question / support issue
Projects
None yet
Development

No branches or pull requests

2 participants