When processing a file, how do I obtain the current line number?

When I am looping over a file using the construct below, I also want the current line number. with codecs.open(filename, 'rb', 'utf8' ) as f: retval = [] for line in f: ...