[Python-Dev] Embedded python on Win2K, import failures

Martin v. L÷wis martin@v.loewis.de
12 Apr 2003 13:17:35 +0200


"M.-A. Lemburg" <mal@lemburg.com> writes:

> This looks like a modified site.py. Where did you get this from ?

Perhaps from the Python CVS?

if sys.platform == 'win32':
    import locale, codecs
    enc = locale.getdefaultlocale()[1]
    if enc.startswith('cp'):            # "cp***" ?
        try:
            codecs.lookup(enc)
        except LookupError:
            import encodings
            encodings._cache[enc] = encodings._unknown
            encodings.aliases.aliases[enc] = 'mbcs'

Regards,
Martin