I am trying to understand opening of a file in different modes; specifically, I don't understand the function of 'rU' in the code below.
csv.reader(open(filename, 'rU'), delimiter=',')
As per the docs below, the 'U' adds support for universal newline characters as these vary between operating systems.
https://docs.python.org/2/library/functions.html#open
"In addition to the standard fopen() values mode may be 'U' or 'rU'. Python is usually built with universal newlines support; supplying 'U' opens the file as a text file, but lines may be terminated by any of the following: the Unix end-of-line convention '\n', the Macintosh convention '\r', or the Windows convention '\r\n'. All of these external representations are seen as '\n' by the Python program."