python2 bufferio compatibility