PythonWin ASP Unicode woes

Fredrik Lundh fredrik at pythonware.com
Tue Aug 13 17:31:09 CEST 2002


Steve Holden wrote:

> File "C:\Python22\lib\site-packages\win32com\client\dynamic.py", line 166,
> in
>  __str__ return str(self.__call__()) UnicodeError: ASCII encoding error:
> ordinal not in range(128)

while debugging, try replacing that str() with a repr().

or perhaps better, replace it with something like:

    value = self.__call__()
    try:
        return str(value)
    except UnicodeError:
        print "offending value", repr(value)
        return repr(value) # fallback

</F>





More information about the Python-list mailing list