oops -- I mean:

while source_file is not None:
   ....