[ python-Bugs-1659173 ] Calling tparm from extension lib fails in Python 2.4

SourceForge.net noreply at sourceforge.net
Tue Feb 13 18:33:12 CET 2007


Bugs item #1659173, was opened at 2007-02-13 18:29
Message generated for change (Comment added) made by richyk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1659173&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Richard B. Kreckel (richyk)
Assigned to: Nobody/Anonymous (nobody)
Summary: Calling tparm from extension lib fails in Python 2.4

Initial Comment:
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 "<stdin>", 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 "<stdin>", line 1, in <module>
ImportError: dynamic module does not define init function (inittestlib)
>>> 

Why, oh why?


----------------------------------------------------------------------

>Comment By: Richard B. Kreckel (richyk)
Date: 2007-02-13 18:33

Message:
Logged In: YES 
user_id=1718463
Originator: YES

Sorry, I was not aware that changing the subject opens a new bug report.
This is more appropiately tracked in [1659171].

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1659173&group_id=5470


More information about the Python-bugs-list mailing list