Issue 1659171: Calling tparm from extension lib fails in Python 2.5 (original) (raw)
Created on 2007-02-13 17:27 by richyk, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (10)
Author: Richard B. Kreckel (richyk)
Date: 2007-02-13 17:27
Attached is a little C++ module that fetches the terminal capability string for turning off all attributes and runs it through tparm(). (All this is done in a static Ctor of a class without init function, but never mind.)
Compile with: g++ -c testlib.cc g++ testlib.o -o testlib.so -shared -Wl,-soname,testlib.so -lncurses
On SuSE Linux 10.1 (and older), I get the expected behavior:
Python 2.4.2 (#1, Oct 13 2006, 17:11:24) [GCC 4.1.0 (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import testlib Terminal is "xterm" Dump of sgr0: 1b 5b 30 6d Dump of instance: 1b 5b 30 6d Traceback (most recent call last): File "", line 1, in ? ImportError: dynamic module does not define init function (inittestlib)
However, on SuSE Linux 10.2, tparm creates a NULL pointer: Python 2.5 (r25:51908, Jan 9 2007, 16:59:32) [GCC 4.1.2 20061115 (prerelease) (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import testlib Terminal is "xterm" Dump of sgr0: 1b 5b 30 6d Rats! tparm made a NULL pointer! Traceback (most recent call last): File "", line 1, in ImportError: dynamic module does not define init function (inittestlib)
Why, oh why?
Author: Richard B. Kreckel (richyk)
Date: 2007-02-14 08:52
I suspect that this is a duplicate of Bug [1548092]. Note that, there it is asserted that tparm returns NULL on certain invalid strings. That does not seem to be true. It returns NULL for valid trivial strings, too.
Author: Martin v. Löwis (loewis) *
Date: 2007-02-14 21:24
I fail to see the bug. The exception precisely describes the error in your code
ImportError: dynamic module does not define init function (inittestlib)
Why do you expect any meaningful behavior in the presence of this error? Your shared library isn't an extension module.
If you think it is related to #1548092, please try out the subversion trunk, which has fixed this bug.
Author: Richard B. Kreckel (richyk)
Date: 2007-02-22 12:25
The error message about the undefined init function is a red herring. The example is actually a stripped-down testcase from a much larger Boost.Python module, which of course does have an init function. The point here is the NULL pointer returned by tparm.
Author: Neal Norwitz (nnorwitz) *
Date: 2007-02-25 22:16
Can you test with 2.5 from SVN and confirm your program works in the complete context?
Author: Richard B. Kreckel (richyk)
Date: 2007-03-12 11:30
Sorry, I cannot do that test anytime soon. (I've not enough time and my company doesn't let me access your SVN.)
Author: Neal Norwitz (nnorwitz) *
Date: 2007-03-13 04:53
I can't help with the time factor, but I can with the access to svn. You can download a snapshot here:
http://svn.python.org/snapshots/python25.tar.bz2
There are snapshots for the trunk as well as the active release branch.
So if you can get a little free time, it would be great if you could download the tarball and test. Thanks.
Author: Daniel Diniz (ajaksu2) *
Date: 2009-03-30 21:25
I'll close this unless someone can confirm for 2.6.
Author: Richard B. Kreckel (richyk)
Date: 2009-03-31 08:26
I just tried Python 2.6 (r26:66714, Feb 21 2009, 05:33:00) from SUSE Linux Enterprise Server 11 (i586) and it didn't fail. This appears to have been fixed, somehow.
Author: Daniel Diniz (ajaksu2) *
Date: 2009-04-01 03:22
Thanks, Richard!
If someone confirms it, please reopen.
History
Date
User
Action
Args
2022-04-11 14:56:22
admin
set
github: 44578
2009-04-01 03:22:29
ajaksu2
set
status: pending -> closed
resolution: out of date
messages: +
stage: test needed -> resolved
2009-03-31 08:26:36
richyk
set
messages: +
2009-03-30 21:25:04
ajaksu2
set
status: open -> pending
priority: normal -> low
type: behavior
versions: + Python 2.6
nosy: + ajaksu2
messages: +
stage: test needed
2007-02-13 17:27:43
richyk
create