Bob Tolbert schrieb: > I've checked out SVN trunk and installed Sphinx and all dependencies > into a clean install of Python 2.5.2 on Windows. Now all script > invocations include the following error: > > <snip> > > import locale # directory > C:\cygwin\home\bob\devel\Sphinx\doctools\trunk\sphinx\locale > # C:\cygwin\home\bob\devel\Sphinx\doctools\trunk\sphinx\locale\__init__.pyc > matches > C:\cygwin\home\bob\devel\Sphinx\doctools\trunk\sphinx\locale\__init__.py > import locale # precompiled from > C:\cygwin\home\bob\devel\Sphinx\doctools\trunk\sphinx\locale\__init__.pyc > # c:\Python25\lib\codecs.pyc matches c:\Python25\lib\codecs.py > import codecs # precompiled from c:\Python25\lib\codecs.pyc > import _codecs # builtin > import encodings # directory c:\Python25\lib\encodings > # c:\Python25\lib\encodings\__init__.pyc matches > c:\Python25\lib\encodings\__init__.py > import encodings # precompiled from c:\Python25\lib\encodings\__init__.pyc > # c:\Python25\lib\encodings\aliases.pyc matches > c:\Python25\lib\encodings\aliases.py > import encodings.aliases # precompiled from > c:\Python25\lib\encodings\aliases.pyc > 'import site' failed; traceback: > Traceback (most recent call last): > File "C:\Python25\Lib\site.py", line 415, in <module> > main() > File "C:\Python25\Lib\site.py", line 406, in main > aliasmbcs() > File "C:\Python25\Lib\site.py", line 357, in aliasmbcs > enc = locale.getdefaultlocale()[1] > AttributeError: 'module' object has no attribute 'getdefaultlocale' > > </snip> > > > and as best as I can tell, the cause is that the Sphinx "locale" > module is being imported on top of the system locale.py. I guess I > don't understand how this might happen, but it appears to be new in > Sphinx. Didn't occur with 0.4.3 from the last distribution. I've > switched SVN in order to use math. > > Also, this only occurs on Windows since the call above only happens if > sys.platform=="win32"
What script are you executing, and are you by chance doing this in the sphinx/ directory containing the locale subdir? Since the current directory is always on sys.path, Python imports the wrong module in that case. Georg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en -~----------~----~----~----~------~----~------~--~---
