This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年02月17日 13:36 by pitrou, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| impsuffix.patch | pitrou, 2012年02月17日 13:36 | review | ||
| impsuffix2.patch | pitrou, 2012年02月18日 18:12 | review | ||
| removesuffixes.patch | pitrou, 2012年02月19日 17:15 | review | ||
| Messages (10) | |||
|---|---|---|---|
| msg153544 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年02月17日 13:36 | |
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. |
|||
| msg153546 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年02月17日 14:08 | |
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. |
|||
| msg153550 - (view) | Author: Barry A. Warsaw (barry) * (Python committer) | Date: 2012年02月17日 14:56 | |
On Feb 17, 2012, at 01:36 PM, Antoine Pitrou wrote: >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. +1 In Debian/Ubuntu I have seen some third party extensions (not built with distutils) that still use this naming convention in their Python 3 extension module, but it's usually pretty easy to rename them to PEP 3149 style names in the platform build scripts. I think it's a great idea to eventually get rid of the untagged names altogether, and saving some stat calls is added benefit. |
|||
| msg153651 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年02月18日 18:12 | |
Here is a patch with tests. |
|||
| msg153652 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2012年02月18日 18:23 | |
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. |
|||
| msg153662 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年02月19日 00:52 | |
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. =) |
|||
| msg153712 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年02月19日 17:15 | |
Here is a patch simply removing the suffixes. |
|||
| msg153727 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2012年02月19日 21:04 | |
I'm in favour of the removesuffixes.patch. However, it will need to be accompanied with a whatsnew change. |
|||
| msg153795 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年02月20日 18:44 | |
New changeset 42f61304f77d by Antoine Pitrou in branch 'default': Issue #14040: Remove rarely used file name suffixes for C extensions (under POSIX mainly). http://hg.python.org/cpython/rev/42f61304f77d |
|||
| msg153797 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年02月20日 18:54 | |
I've now committed the suffix removal patch with a what's new entry. Thanks! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:26 | admin | set | github: 58248 |
| 2012年02月20日 18:54:02 | pitrou | set | status: open -> closed resolution: fixed messages: + msg153797 stage: patch review -> resolved |
| 2012年02月20日 18:44:38 | python-dev | set | nosy:
+ python-dev messages: + msg153795 |
| 2012年02月19日 22:42:04 | eric.araujo | set | nosy:
+ eric.araujo |
| 2012年02月19日 21:04:06 | loewis | set | messages: + msg153727 |
| 2012年02月19日 17:15:25 | pitrou | set | files:
+ removesuffixes.patch messages: + msg153712 |
| 2012年02月19日 00:52:26 | brett.cannon | set | messages: + msg153662 |
| 2012年02月18日 18:37:28 | eric.snow | set | nosy:
+ eric.snow |
| 2012年02月18日 18:28:37 | Arfrever | set | nosy:
+ Arfrever |
| 2012年02月18日 18:23:28 | loewis | set | messages: + msg153652 |
| 2012年02月18日 18:12:48 | pitrou | set | files:
+ impsuffix2.patch messages: + msg153651 |
| 2012年02月17日 14:59:23 | schmir | set | nosy:
+ schmir |
| 2012年02月17日 14:56:34 | barry | set | messages: + msg153550 |
| 2012年02月17日 14:08:05 | brett.cannon | set | messages: + msg153546 |
| 2012年02月17日 13:41:43 | nadeem.vawda | set | nosy:
+ nadeem.vawda |
| 2012年02月17日 13:36:36 | pitrou | create | |