PythonWin ASP Unicode woes

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

Steve Holden wrote:

> File "C:\Python22\lib\site-packages\win32com\client\", 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__()
        return str(value)
    except UnicodeError:
        print "offending value", repr(value)
        return repr(value) # fallback


More information about the Python-list mailing list