Message137662
Hi Terry, I do need to do a lot more investigating into the issue.
I'm using borland builder 6 on a win XP PC to create a interface DLL in
C/C++ for a GUI to call into a large number of pre-written Python test
scripts.
I'm using Python26.dll (I will try using the lib file) to create my embedded
Python environment and redirecting stdin, stdout and stderr bo to the GUI.
The strange issue is when calling the script containing 'import cmath' from
Python console, it works fine. However when calling a script containing
'import cmath' my embedded method (GUI), the application hangs. all other
'import's work fine from my embedded environment.
I've attached a copy of my project with 'my_py.cpp' including the following
snippets:
PyRun_SimpleString( //"import cmath\n" // TRIED HERE!!! 'import cmath'
"import log\n"
"import sys\n"
"class StdoutCatcher:\n"
"\tdef write(self, str):\n"
"\t\tlog.CaptureStdout(str)\n"
"class StderrCatcher:\n"
"\tdef write(self, str):\n"
"\t\tlog.CaptureStderr(str)\n"
"sys.stdout = StdoutCatcher()\n"
"sys.stderr = StderrCatcher()\n");
and I tried within a script using:
pValue = DLL_PyObject_CallObject(pFunc, pArgs); // CALLED HERE!!! python
scripted containing 'import cmath'
Thanks,
Thanh Ly.
-----Original Message-----
From: Terry J. Reedy
Sent: Saturday, June 04, 2011 12:14 AM
To: thanh.l@ntlworld.com
Subject: [issue12232] embedded python import cmath
Terry J. Reedy <tjreedy@udel.edu> added the comment:
Hanging is different from crashing.
2.6 and 3.1 (soon) are only open for security issues.
Perhaps your system is missing something needed for the import.
If you want this to stay open, retest with 2.7 or 3.2 and give much more
information: your system/OS, C/C++ compiler, your Python binary (copy the
startup line in the interactive interpreter), and a minimal code that shows
the problem.
----------
nosy: +terry.reedy
stage: -> test needed
type: crash -> behavior
versions: -Python 2.6
_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue12232>
_______________________________________ |
|
Date |
User |
Action |
Args |
2011-06-04 21:06:09 | Thanh Ly | set | recipients:
+ Thanh Ly, terry.reedy, mark.dickinson |
2011-06-04 21:06:07 | Thanh Ly | link | issue12232 messages |
2011-06-04 21:06:07 | Thanh Ly | create | |
|