From eff42d2136ea00682bbc71bf9163a977d339b0ba Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Wed, 4 Aug 2010 12:10:08 -0700 Subject: [PATCH] revert a silly decision about hard-coding latin1 Decoding a path as latin1 when it appears undecodable is a non-solution because, the next time we want to actually *use* the path, it will be encoded differently and the file won't be found. Death to undecodable paths! --- beets/library.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/beets/library.py b/beets/library.py index a0040cbdc..b09bedff7 100644 --- a/beets/library.py +++ b/beets/library.py @@ -165,18 +165,7 @@ def _unicode_path(path): if isinstance(path, unicode): return path encoding = sys.getfilesystemencoding() or sys.getdefaultencoding() - try: - out = path.decode(encoding) - except UnicodeError: - # This is of course extremely hacky, but I've received several - # reports of filesystems misrepresenting their encoding as - # UTF-8 and actually providing Latin-1 strings. This helps - # handle those cases. All this is the cost of dealing - # exclusively with Unicode pathnames internally (which - # simplifies their construction from metadata and storage in - # SQLite). - out = path.decode('latin1') - return out + return path.decode(encoding) # Note: POSIX actually supports \ and : -- I just think they're # a pain. And ? has caused problems for some.