 <p>Looking at <a href="http://hg.python.org/cpython/file/v2.7.4/Lib/ctypes/__init__.py#l243" rel="nofollow">the source</a>, <code>__repr__</code> will only show the contents of the string if</p> <ol> <li>It is running on Windows; and</li> <li><a href="http://msdn.microsoft.com/en-us/library/aa366714.aspx" rel="nofollow"><code>IsBadStringPtr</code></a> returns <code>TRUE</code>.</li> </ol> <p>They probably want to show a string representation if possible, since that's a rather useful thing to show, but not crash your program if it points somewhere unexpected. <code>IsBadStringPtr</code> only exists on Windows, necessitating the first check. Frankly, I'm surprised they'd use it, as it's clearly marked obsolete, and <a href="https://blogs.msdn.com/b/oldnewthing/archive/2006/09/27/773741.aspx" rel="nofollow">for good reasons</a>.</p>