This is a simple hack to allow the writing to redis as if it was just file object in python.