From: Michael D. <md...@st...> - 2007-07-11 15:03:49
|
Michael Droettboom wrote: > Jouni K. Seppänen wrote: > >> "John Hunter" <jd...@gm...> writes: >> >> >> >>> On 7/10/07, Michael Droettboom <md...@st...> wrote: >>> >>> >> I'm seeing a bug on OS X, whose file system is by default >> case-preserving but not case-sensitive: >> >> 458 -> fontdictObject = self.embedTTF( >> 459 filename, self.used_characters[filename]) >> >> Here self.used_characters has a key starting with '/Users/jks/...' but >> filename is '/users/jks/...'. I'm not sure how to fix this cleanly. >> I though os.path.normcase would help, but it doesn't: >> >> >> > Thanks for that. The Ps backend has the same problem. I'll do a little > research and see what a common solution to this might be. > > I changed the code to use the file's (st_ino, st_dev) pair as a key, rather than the path. This is cached to prevent lots of little stat calls. This approach is reported to work on "Macintosh, Unix, and Windows", but I've only tested on Linux and OS-X. Please let me know if it solves your issue. Along the way, I found an interesting discussion about why normcase does what it does on OS-X. (Summary: because file names are case sensitive on OS-X, but not the default HFS+ filesystem that Macs ship with as their System volume.) http://mail.python.org/pipermail/python-list/2006-January/360098.html Cheers, Mike |