[Image-SIG] unicode filenames in PIL
Douglas Bagnall
douglas@paradise.net.nz
Sat, 7 Jul 2001 15:17:20 +1200
hi all,
I was getting mysterious errors from the image save method:
i.save(fname)
"[...]/PIL/Image.py", line 681, in save format = EXTENSION[ext]
KeyError:
until I discovered the filename string was unicode. This had happened
somewhat by stealth, as a plain string mixed with unicode yeilds a
unicode result, so a small piece of the filename from XML had infected
the whole.
Anyway,
i.save(str(fname))
fixes the problem, but I wonder if this mightn't be better done within
Image.py?
cheers,
Douglas