[C++-sig] Problems with functions taking string arguments on Windows
greg Landrum
greglandrum at mindspring.com
Mon Jun 2 20:44:37 CEST 2003
[Boost 1.30, Win2K, MSVC v6]
Building the attached extension module and running the script results in
crashes every time GetVal attempts to return. The problem (as demonstrated
by GetVal2) appears to be due to the fact that it's taking an std::string
as an argument.
I haven't tested this exact code fragment, but analogous code works just
fine on linux (g++ 3.2). Is this:
a) BPL bug
b) MSVC v6 bug
c) Me bug
Additional information:
Just to verify that this is not due to my suggested changes in
builtin_converters.cpp::string_rvalue_from_python(), I switched that code
back to its previous form (without the PyString_Size argument to the
std::string constructor); this does not change the behavior I'm observing
(i.e. it still crashes ever time).
-greg
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: strings_crash.cpp
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030602/23ccf57e/attachment.txt>
-------------- next part --------------
import rdchem_new
print 'get val2:'
a = rdchem_new.GetVal2('foo')
print 'done:',a
print 'get val:'
a = rdchem_new.GetVal('foo')
print 'done:',a
More information about the Cplusplus-sig
mailing list