wbond/sublime_package_control — pull request #234 by quarnster (2012-11-07 11:07:12+00:00)
Title: Added unicodehack helper function.

This is needed as some exceptions coming from the OS are
already encoded and so just calling unicode(e) will result
in an UnicodeDecodeError as the string isn't in ascii form.

I consider this a hack as the real fix would be somewhere
in python ensuring that the exception's __unicode__ function
returns a proper unicode string so that this doesn't happen
in the first place.

The error that prompted me to write this fix was

Package Control: Unable to remove old directory for package VintageLines - deferring until next start: [Error 5] Åtkomst nekad: u'C:\\Users\\Fredrik\\AppData\\Roaming\\Sublime Text 2\\Packages\\VintageLines\\.git\\objects\\pack\\pack-52d5b4582c418d937ddd0537df29e4074029feaf.idx'

"Åtkomst nekad" would be "Access denied" in Swedish, which isn't
very surprising, however now I know that that is the error rather
than the more obscure uncaught UnicodeDecodeError I got before
applying this fix.