add tox.ini
test: fix for Python 2.6

At this point in the code Exceptions don't work at all with Python 2.6.
Like if the whole thing is in "try-except" without specifying the type.

Additionally, TextIOWrapper doesn't have the buffer attribute in 2.6