-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
Deprecate some of the module file formats #58248
Comments
Stating module files of the form "xxxmodule.so" consumes all 1/3 of stat calls at startup. Looking at the site-packages folders on my machine, both for 2.7 and 3.2, reveals no C extension that follows such naming. This patch deprecates such module namings, so that they can be removed in a later version. |
Patch looks fine, although there aren't any tests. At least for importlib you can simply use a finder test for extension modules to verify the warning is triggered. That way you can create an empty module with the expected naming rather than worry about compiling an extension module. |
On Feb 17, 2012, at 01:36 PM, Antoine Pitrou wrote:
+1 In Debian/Ubuntu I have seen some third party extensions (not built with |
Here is a patch with tests. |
In this case, I propose to drop the feature without deprecation. It is very easy to adjust the build process of packages that still use the feature, and even end users can rename the files. If you want to improve ease-of-use, you could still do the stat calls, and record whether a file would have been imported. If then the import fails, put a message into the import error saying the /some/where/somemodule.so was ignored because the file name is no longer supported. |
I like Martin's suggestion of simply throwing an error. But then again I also really like his idea of simply not warning since it's easier. =) |
Here is a patch simply removing the suffixes. |
I'm in favour of the removesuffixes.patch. However, it will need to be accompanied with a whatsnew change. |
New changeset 42f61304f77d by Antoine Pitrou in branch 'default': |
I've now committed the suffix removal patch with a what's new entry. Thanks! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: