Retrieve buffered data in python 3