[python] Get filename from file pointer