Computing directory sizes problem

Martin v. Löwis loewis at informatik.hu-berlin.de
Tue Sep 10 11:37:38 CEST 2002


nmichael at yahoo.com (Neophytos Michael) writes:

> Python version is 2.2.1.  Windows localized version I am not sure. 
> The laptop was purchased in the US so it must be the defaul US
> version.  The filenames in question are mp3 files whose names are made
> up from greek characters (at least I see them as greek when listing
> the files with file explorer).  Any advice on how to adjust my system
> locale would be appreciated.

I can see that this makes problems. Unfortunately, you did not report
the Windows version:
- On XP, navigate to
   Control Panel, Regional And Language Options,
   Advanced, Language for Non-Unicode Programs.
  Set language to Greek. You may also set your location to Greek, but
  that might be irrelevant.
- On W2k, navigate to
   Control Panel, Regional And Language Options,
   General.
  Choose Greek.

In the long run, Python should support Unicode file names independent
of the system locale; this will happen in Python 2.3. If you want to
experiment, you can use the patch in

http://python.org/sf/594001

You'll need CVS Python for that, and MSVC. With those changes,
invoking os.path.walk with a Unicode directory name should give you
Unicode file names again, which you then can pass to os.stat.

Regards,
Martin



More information about the Python-list mailing list