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 2008年12月06日 01:29 by christian.heimes, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| fix-make-smelly-on-trunk.patch | dmalcolm, 2010年01月13日 20:18 | |||
| py3k-add-_Py-prefix-to-avoid-smelliness.patch | dmalcolm, 2010年07月20日 18:04 | |||
| Messages (15) | |||
|---|---|---|---|
| msg77090 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2008年12月06日 01:29 | |
I just found about the smelly build target. It checks for smelly exports. $ make smelly [...] nm -p libpython2.6.a | \ sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \ asdl_int_seq_new asdl_seq_new init_ast init_codecs initerrno initgc initimp initposix initpwd initsignal init_sre init_symtable initthread initxxsubtype initzipimport nm -p libpython3.0.a | \ sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \ _add_one_to_index_C _add_one_to_index_F asdl_int_seq_new asdl_seq_new These should be checked and fixed. |
|||
| msg77091 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2008年12月06日 01:38 | |
Are you suggesting that the init* functions in Python 2.6 should not longer be exported? Why? And how? |
|||
| msg77096 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2008年12月06日 02:20 | |
I just suggest that somebody should look into it. I neither know how critical the issue is nor how to change them. This bug report serves as a reminder. |
|||
| msg77292 - (view) | Author: Marc-Andre Lemburg (lemburg) * (Python committer) | Date: 2008年12月08日 09:44 | |
For Python 2.x you cannot change the "main" function name of C extensions, since this is used by the Python import mechanism. |
|||
| msg77350 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2008年12月08日 21:56 | |
I guess you *could* change the name of extensions that become builtin modules. However, I think it is not worth the trouble, especially since PEP 3121 solves the problem for good, for Python 3. I propose to simply filter out init[_a-z]+ from the set of "bad" symbols. That leaves us with asdl_*_seq_new, and _add_one_to_index_; the latter is already reported as issue3101. |
|||
| msg77517 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2008年12月10日 09:05 | |
There is no proposed patch yet, so removing 2.5.3 from the target versions. |
|||
| msg84408 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2009年03月29日 14:33 | |
#5591 is a duplicate of this. |
|||
| msg93793 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2009年10月09日 14:06 | |
In trunk: _add_one_to_index_C _add_one_to_index_F asdl_int_seq_new asdl_seq_new init_ast init_codecs initerrno initgc initimp initposix initpwd initsignal init_sre init_symtable initthread initxxsubtype initzipimport In py3k: _add_one_to_index_C _add_one_to_index_F asdl_int_seq_new asdl_seq_new |
|||
| msg97737 - (view) | Author: Dave Malcolm (dmalcolm) (Python committer) | Date: 2010年01月13日 20:18 | |
Re: msg #77350: > I propose to simply filter out init[_a-z]+ from the set of "bad" > symbols. I'm attaching a patch (to trunk) to Makefile.pre.in which filters out such symbols. Relevant part of output of "make smelly" on my svn build with this patch: nm -p libpython2.7.a | \ sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | \ grep -v -E "^init[_a-z]+" | sort -u; \ _add_one_to_index_C _add_one_to_index_F asdl_int_seq_new asdl_seq_new |
|||
| msg110934 - (view) | Author: Dave Malcolm (dmalcolm) (Python committer) | Date: 2010年07月20日 17:48 | |
py3k is much cleaner than python 2, due to the change in the module API. Here's "make smelly"'s output on a recent py3k checkout: nm -p libpython3.2.a | \ sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \ _add_one_to_index_C _add_one_to_index_F asdl_int_seq_new asdl_seq_new |
|||
| msg110938 - (view) | Author: Dave Malcolm (dmalcolm) (Python committer) | Date: 2010年07月20日 18:04 | |
Patch to py3k which adds the "_Py" prefix to the four listed symbols. With this, the output from "make smelly" is clean (odorless, perhaps?). However, adding _Py does seem to go against this comment in Include/asdl.h: /* It would be nice if the code generated by asdl_c.py was completely independent of Python, but it is a goal the requires too much work at this stage. So, for example, I'll represent identifiers as interned Python strings. */ |
|||
| msg176418 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2012年11月26日 15:15 | |
For Python 3.3 and 3.4 make smelly still lists two exported symbols. asdl_int_seq_new asdl_seq_new Do we have to check the modules, too? Some of them like _ctypes and _decimal export a lot of symbols. Here is a small shell snippet for Makefile. for MOD in `find $(srcdir)/build -name '*.s[ol]' ` ; do \ EXPORT=`nm -p $$MOD | sed -n "/ [TDB] /s/.* //p" | \ grep -E -v "^_*Py|^_init|^_fini" | sort -u`; \ if [ -n "$$EXPORT" ]; then \ echo $$MOD; \ echo $$EXPORT; \ fi \ done |
|||
| msg176486 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2012年11月27日 19:36 | |
I'd like to focus this issue; it has been open long enough, and deserves to get closed once the original issue is resolved - which was that "make smelly" reports symbols. I think dmalcolm's patch is quite a good start for that. It may well be that other modules need to be considered - but PLEASE not in this issue. For Unix with shared libraries, the extension modules certainly cause problems, in particular if Python gets embedded in a context (e.g. Apache) that also loads separate copies of the same libraries, and may cause problems if one of our functions collide with some library. However, I see *two* issues falling out of this: one to extend the "make smelly" target to include extension modules, and the other to then fix the extension modules - preferably with one issue per extension module. |
|||
| msg177551 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年12月15日 19:27 | |
This very simple patch should certainly be applied. |
|||
| msg199622 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年10月12日 20:54 | |
New changeset 142c62a490ce by Antoine Pitrou in branch 'default': Issue #4555: All exported C symbols are now prefixed with either "Py" or "_Py". http://hg.python.org/cpython/rev/142c62a490ce |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:42 | admin | set | github: 48805 |
| 2013年10月12日 21:08:22 | pitrou | set | status: open -> closed stage: commit review -> resolved resolution: fixed versions: - Python 3.2 |
| 2013年10月12日 20:54:48 | python-dev | set | nosy:
+ python-dev messages: + msg199622 |
| 2012年12月15日 19:27:12 | pitrou | set | assignee: dmalcolm stage: patch review -> commit review messages: + msg177551 versions: + Python 2.7, - Python 2.6 |
| 2012年11月27日 19:36:37 | loewis | set | messages: + msg176486 |
| 2012年11月26日 22:39:01 | pitrou | set | stage: test needed -> patch review |
| 2012年11月26日 15:15:51 | christian.heimes | set | messages:
+ msg176418 versions: + Python 3.3, Python 3.4, - Python 3.1, Python 2.7 |
| 2010年07月20日 18:04:22 | dmalcolm | set | files:
+ py3k-add-_Py-prefix-to-avoid-smelliness.patch messages: + msg110938 |
| 2010年07月20日 17:49:23 | belopolsky | set | title: Smelly exports -> Smelly exports (global symbols in python not prefixed with Py or _Py) |
| 2010年07月20日 17:48:01 | dmalcolm | set | messages: + msg110934 |
| 2010年01月13日 20:18:37 | dmalcolm | set | files:
+ fix-make-smelly-on-trunk.patch nosy: + dmalcolm messages: + msg97737 keywords: + patch |
| 2009年10月09日 14:06:37 | pitrou | set | messages:
+ msg93793 versions: + Python 3.2, - Python 3.0 |
| 2009年03月29日 14:33:26 | pitrou | set | nosy:
+ pitrou, doko messages: + msg84408 |
| 2009年03月29日 14:33:00 | pitrou | link | issue5591 superseder |
| 2008年12月10日 09:05:29 | loewis | set | messages:
+ msg77517 versions: - Python 2.5.3 |
| 2008年12月08日 21:56:16 | loewis | set | messages: + msg77350 |
| 2008年12月08日 09:44:43 | lemburg | set | nosy:
+ lemburg messages: + msg77292 |
| 2008年12月06日 02:55:30 | loewis | set | priority: high -> normal |
| 2008年12月06日 02:20:16 | christian.heimes | set | messages: + msg77096 |
| 2008年12月06日 01:38:30 | loewis | set | nosy:
+ loewis messages: + msg77091 |
| 2008年12月06日 01:29:10 | christian.heimes | create | |