Files must be opened in binary mode, otherwise python expects f.write to take strings
This will only work on python 3
Not sure why it worked on my machine but contents should probably be decoded
Rewrite bytes/unicode read function test cases to work correctly
Python 3 compatibility: PyInt -> PyLong
Only check for PyInt on python 2
Python 3 compatibility: type and module changes
Python 3 compatibility: getattro/setattro
Do not call PyObject_GenericSetAttr.

For whatever reason doing that results in "del curl.attr" complaining that
attr does not exist. If instead I call PyDict_DelItem, everything seems
to be peachy.
Limit file code path to python 2.

On python 3 the files are no longer C FILE pointers, so this code does not work.

However, it continues to work fine on python 2.
Implement writing to files under python 3
Document how files are handled
Test treating a file-like object as a file, on all pythons
Python 3 support: Unicode in strings
Replace bogus Unicode to C string conversion logic.

The old code leaked malloc'd memory and did not handle
embedded NULL bytes, and used C library's locale rather than
Python locale.

The new code still leaks memory but correctly handles
embedded NULL bytes, already encoded data as instances of
bytes type, and uses utf8 encoding if encoding needs to
be performed.

The new code only works on Python 3 >= 3.3, 3.0-3.2 need
to have their own version added.
Python 3 support: Unicode in strings
Handle bytes and unicode in read callback
Make exception message more descriptive
Encoding multibyte data is not going to work well, only allow ascii
Send bytes to write callback under python 3.

This is the only way to pass non-ascii response bodies to
write callbacks without mangling/destroying them, because
encoding is given in headers which are entirely separate
from the body.