[New-bugs-announce] [issue9709] test_distutils warning: initfunc exported twice on Windows

Stefan Krah report at bugs.python.org
Sun Aug 29 19:10:38 CEST 2010

New submission from Stefan Krah <stefan-usenet at bytereef.org>:

On Windows, the initfunc of a C extension is exported twice, as
seen here:

xxmodule.obj : warning LNK4197: export 'initxx' specified multiple times; using first specification

First export: pyport.h: #define PyMODINIT_FUNC __declspec(dllexport) void

Second export: Specified on the command line with /EXPORT

The code responsible for adding the initfunc name to ext.export_symbols
is in build_ext.py:get_export_symbols. I'm not sure if it could be
removed, since older extensions might not use PyMODINIT_FUNC.

If it can't be removed, perhaps PyMODINIT_FUNC could be specified
simply as void.

assignee: eric.araujo
components: Distutils, Distutils2
messages: 115181
nosy: brian.curtin, eric.araujo, skrah
priority: normal
severity: normal
stage: needs patch
status: open
title: test_distutils warning: initfunc exported twice on Windows
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list