I think there is a bug with the documentation with the topic "7. Input and Output" Link: https://docs.python.org/3.6/tutorial/inputoutput.html 7.2. Reading and Writing Files "open() returns a file object, and is most commonly used with two arguments: open(filename, mode)." The arguments for this function are open(file, mode).
https://docs.python.org/3.6/library/functions.html#open open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
Best regards Paulo G.P.