2008/10/16 Jordan <[EMAIL PROTECTED]>: > On Oct 16, 9:20 pm, John Machin <[EMAIL PROTECTED]> wrote: >> On Oct 17, 11:43 am, Jordan <[EMAIL PROTECTED]> wrote: >> >> > I've got a bunch of files with Japanese characters in their names and >> > os.listdir() replaces those characters with ?'s. I'm trying to open >> > the files several steps later, and obviously Python isn't going to >> > find '01-????.jpg' (formally '01-ひらがな.jpg') because it doesn't exist. >> > I'm not sure where in the process I'm able to stop that from >> > happening. Thanks. >> >> The Fine Manual says: >> """ >> listdir( path) >> >> Return a list containing the names of the entries in the directory. >> The list is in arbitrary order. It does not include the special >> entries '.' and '..' even if they are present in the directory. >> Availability: Macintosh, Unix, Windows. >> Changed in version 2.3: On Windows NT/2k/XP and Unix, if path is a >> Unicode object, the result will be a list of Unicode objects. >> """ >> >> Are you unsure whether your version of Python is 2.3 or later? > > *** Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 > bit (Intel)] on win32. *** says my interpreter > > when it says "if path is a Unicode object...", does that mean the path > name must have a Unicode char?
No, it means if path is of type 'unicode' as opposed to type 'str'. Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list