Martin v. L=F6wis wrote: > "M.-A. Lemburg" <mal@lemburg.com> writes: >=20 >=20 >>This looks like a modified site.py. Where did you get this from ? >=20 > Perhaps from the Python CVS? Hmm, I don't have that in my CVS checkout... I guess a cleanup is due. > if sys.platform =3D=3D 'win32': > import locale, codecs > enc =3D locale.getdefaultlocale()[1] > if enc.startswith('cp'): # "cp***" ? > try: > codecs.lookup(enc) > except LookupError: > import encodings > encodings._cache[enc] =3D encodings._unknown > encodings.aliases.aliases[enc] =3D 'mbcs' That's the wrong way to do it. This code should live in encodings/__init__.py, not site.py, and it should be done lazy, ie. Python startup time should not suffer from this in general, only when Unicode and cpXXX encodings are being requested and not found. The codec machinery was carefully designed not to introduce extra overhead when not using Unicode in programs. The above approach pretty much kills this effort :-) --=20 Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Apr 12 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 73 days left
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4