<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle">P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</style>
</head>
<body fPStyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<p>I just had my first fun with Pep 393 strings and debuggers.&nbsp; Trying to debug a deadlocked python program, I'm trying to figure out the callstack of the thread in the debugger.</p>
<p>I ended up with something like:</p>
<p>&nbsp;</p>
<p>(char*)&amp;((PyASCIIObject*)(tstate-&gt;frame-&gt;f_code-&gt;co_filename))[1]</p>
<p>&nbsp;</p>
<p>while previously, it was sufficient to do</p>
<p>(PyUnicodeObject*)(tstate-&gt;frame-&gt;f_code-&gt;co_filename)</p>
<p>&nbsp;</p>
<p>Obviously this won't work for non-ASCII objects.</p>
<p>I wonder if there is a way to make this situation easier?&nbsp; Perhaps for &quot;debug&quot; builds, we can store some debug information in the frame object, e.g. utf8 encoding of the filename and function?</p>
<p>&nbsp;</p>
<p>K</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
</body>
</html>