在哪里可以找到传递给 open() 函数的不同模式的定义

Where to find definitions of different modes passed into `open()` function

我正在尝试了解以不同模式打开文件;具体来说,我不明白下面代码中 'rU' 的功能。

csv.reader(open(filename, 'rU'), delimiter=',')

根据下面的文档,'U' 添加了对通用换行符的支持,因为这些字符因操作系统而异。

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."