witsch/SublimePythonTidy — pull request #4 by mdornseif (2012-05-27 20:19:40+00:00)
Title: Fix Unicode issues by treating StringIO as byte stream.

The current code took the (unicode) view and stuffed
it into a `StringIO`. The resulting encoding beeing seen
by PythonTidy was dependent on the configuration of the
system the code was running on and on implementation
details in StringIO.

It than read the result (a bytestream) and wrote it into
the (unicode) view. Again with indeterminable results
based on the default encodings of the host system.

For me opening the file http://filez.foxel.org/211a0I1L3t3n2I3P1L25
and pressing CTRL-ALT-CMD-T worked once but pressing it twice
resulted in an `UnicodeException`.

https://github.com/witsch/SublimePythonTidy/issues/1 shows
the same issue and https://github.com/do3cc/SublimePythonTidy/commit/efc88be
seems to be an attempt to fix it.

This changeset ensures that

a) views are treated as unicode
b) StringIOs are treated as bytestream