Boost C++ Libraries: Ticket #707: wstring_rvalue_from_python crash on zero length PyObject https://svn.boost.org/trac10/ticket/707 <pre class="wiki"> Using Python 2.3 (OSX native) and OSX 10.4.7 (powerpc-apple-darwin8- gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5341)) Boost version is 1_33_1 and was compiled from source. When PyObject_Length(intermediate) is zero in wstring_rvalue_from_python::extract (when referring to an empty string) a crash will occur in PyUnicode_AsWideChar, most probably because 0 is then passed to it. Doing a if( result.empty( ) ) return std::wstring( ) right after the result string is constructed seems to solve this and produce correct results on my code. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/707 Trac 1.4.3 david_abrahams Wed, 13 Sep 2006 22:48:22 GMT status changed https://svn.boost.org/trac10/ticket/707#comment:1 https://svn.boost.org/trac10/ticket/707#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=52572 This doesn't come with a test case so I can't verify it. Regardless, it's not a Boost.Python bug, but I checked in an attempted workaround anyway. Please reopen if this fix doesn't work for you. </pre> Ticket