PY3+BF: ensure that mixed type bytearray is converted to string
RF+ENH+PY3: use "with" statement when opening file
RF: use assertEqual instead of failUnless
PY3: change expected type of error depending on python version.
PEP8: minor formatting
Merge pull request #194 from nno/_tent/py3k

Py3k-related improvements