Whenever you are chaining methods in Python and you get this, you can bet that one of them returns None
(even if implicitly by not returning at all). The solution is generally to split up the chain over multiple lines.
temp.seek(0)
print temp.read()