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

Py_LIMITED_API on windows: unresolved symbol __imp___PyArg_ParseTuple_SizeT #55835

Closed
rjs mannequin opened this issue Mar 21, 2011 · 8 comments
Closed

Py_LIMITED_API on windows: unresolved symbol __imp___PyArg_ParseTuple_SizeT #55835

rjs mannequin opened this issue Mar 21, 2011 · 8 comments
Assignees
Labels
extension-modules C modules in the Modules dir

Comments

@rjs
Copy link
Mannequin

rjs mannequin commented Mar 21, 2011

BPO 11626
Nosy @loewis

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:

assignee = 'https://github.com/loewis'
closed_at = <Date 2012-06-23.22:02:43.442>
created_at = <Date 2011-03-21.18:54:35.186>
labels = ['extension-modules']
title = 'Py_LIMITED_API on windows: unresolved symbol\t__imp___PyArg_ParseTuple_SizeT'
updated_at = <Date 2012-06-29.11:51:26.436>
user = 'https://bugs.python.org/rjs'

bugs.python.org fields:

activity = <Date 2012-06-29.11:51:26.436>
actor = 'rjs'
assignee = 'loewis'
closed = True
closed_date = <Date 2012-06-23.22:02:43.442>
closer = 'loewis'
components = ['Extension Modules']
creation = <Date 2011-03-21.18:54:35.186>
creator = 'rjs'
dependencies = []
files = []
hgrepos = []
issue_num = 11626
keywords = []
message_count = 8.0
messages = ['131683', '131705', '131729', '131773', '131792', '163683', '163684', '164325']
nosy_count = 3.0
nosy_names = ['loewis', 'python-dev', 'rjs']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue11626'
versions = ['Python 3.2']

@rjs
Copy link
Mannequin Author

rjs mannequin commented Mar 21, 2011

When building a c extension on windows the linker fails like this:

link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:../../../libs/plop/Release_MD_PLOPDS_VS6 /LIBPATH:C:\Programme\python32\libs /LIBPATH:C:\Programme\python32\PCbuild kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libplop.lib /EXPORT:PyInit_plop_py build\temp.win32-3.2\Release\plop_py.obj /OUT:build\lib.win32-3.2\plop_py.pyd /IMPLIB:build\temp.win32-3.2\Release\plop_py.lib /MANIFESTFILE:build\temp.win32-3.2\Release\plop_py.pyd.manifest
Creating library build\temp.win32-3.2\Release\plop_py.lib and object build\temp.win32-3.2\Release\plop_py.exp

plop_py.obj : error LNK2019: unresolved external symbol __imp___PyArg_ParseTuple_SizeT referenced in function __wrap_PLOP_new

build\lib.win32-3.2\plop_py.pyd : fatal error LNK1120: 1 unresolved externals

I use distutils to build the extension. The same code works fine on Linux/Unix/MacOSX. When I unset the Py_LIMITED_API it works fine on Windows too.

@rjs rjs mannequin added the extension-modules C modules in the Modules dir label Mar 21, 2011
@loewis
Copy link
Mannequin

loewis mannequin commented Mar 21, 2011

It seems this function was forgotten. I'd add this for 3.2.1, which of course means that your extension wouldn't run on a 3.2.0 installation. Would you consider this acceptable?

Would you prefer to see a compiler error indicating that you are using a function not available in 3.2.0 (with an option of opting into 3.2.1+)?

@rjs
Copy link
Mannequin Author

rjs mannequin commented Mar 22, 2011

fixing this for the next version of course would be acceptable.

As I can use the extension (not setting Py_LIMITED_API) even with 3.2.0 it is not a big problem. I only loose the benefit of Py_LIMITED_API and will have to release another version of the binding later on.

Would you prefer to see a compiler error indicating that you are using
a function not available in 3.2.0 (with an option of opting into
3.2.1+)?

I fear I don't understand exactly what is meant here. For me it was enough to get the linker error telling me it is not working.

@loewis
Copy link
Mannequin

loewis mannequin commented Mar 22, 2011

I fear I don't understand exactly what is meant here. For me it was enough to get the linker error telling me it is not working.

Suppose 3.2.1 adds this function, which then means that your extension
builds fine. However, it won't run on 3.2.0, so you might complain that
the ABI isn't really "stable". Therefore, I wonder whether you would
have liked to continue receiving compile-time indications that you are
using parts of the ABI which had not been around in 3.2.0.

Now that you know, you *personally* probably don't need this
notification anymore. I just wonder about people in similar situations.

@loewis loewis mannequin changed the title Py_LIMITED_API on windows: unresolved symbol __imp___PyArg_ParseTuple_SizeT Py_LIMITED_API on windows: unresolved symbol __imp___PyArg_ParseTuple_SizeT Mar 22, 2011
@rjs
Copy link
Mannequin Author

rjs mannequin commented Mar 22, 2011

OK now I got it.

Yes for others this would be "very" helpful. Specially as the Py_LIMITED_API promises to solve the changing API issue on windows and Parse_Tuple is one of the main API's used in extensions this would be helpful I guess.

I personally decided to build without Py_LIMITED_API for Python 3.2.*, I will use the new feature with Python 3.3.*. This is more clear for our customers. Till now we only had new extensions with new x.y versions of Python, nether with x.y.z versions.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Jun 23, 2012

New changeset 3f14119e4af7 by Martin v. Löwis in branch 'default':
Issue bpo-11626: Add _SizeT functions to stable ABI.
http://hg.python.org/cpython/rev/3f14119e4af7

@loewis
Copy link
Mannequin

loewis mannequin commented Jun 23, 2012

As some time has passed (unfortunately), I now decided to add these functions only to the stable ABI of 3.3+. I'd appreciate if you could review the beta releases and comment whether they fix the issue. Notice that you will have to set Py_LIMITED_API to 0x03030000 (or higher) to access them.

@loewis loewis mannequin closed this as completed Jun 23, 2012
@rjs
Copy link
Mannequin Author

rjs mannequin commented Jun 29, 2012

Thanks,

I tested it with 3.3beta1 and it works fine now.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir
Projects
None yet
Development

No branches or pull requests

0 participants