[Python-Dev] Problem with 'import site' on Linux

Alexander S Coventry alex_c@MIT.EDU
Sun, 9 Jul 2000 18:54:44 -0400 (EDT)

The function _locale._getdefaultlocale seems to only be defined if
python is compiled for windows, but an attempt is made to call it
regardless of the OS in locale.getdefaultlocale.  This is causing
'import site' to fail when I start python.  I am not sure what ought to
be called instead; in my version, for now, I am going to amend the try:
except: block that this code is wrapped in so that it catches
AttributeError's, as well.

The code I'm referring to is around line 262 in Lib/locale.py, and line
343 in Modules/_localemodule.c