safely report IOErrors even in the face of unexpectedly encoded file names

--HG--
extra : rebase_source : e19f5f1b11ba54126f147b2a67110b2d9b66754d