defread(self, filenames, encoding='utf-8'):# encoding=None, 这就是679 行"""Read and parse a filename or an iterable of filenames.
Files that cannot be opened are silently ignored; this is
designed so that you can specify an iterable of potential
configuration file locations (e.g. current directory, user's
home directory, systemwide directory), and all existing
configuration files in the iterable will be read. A single
filename may also be given.
Return list of successfully read files.
"""ifisinstance(filenames,(str,bytes, os.PathLike)):
filenames =[filenames]
read_ok =[]for filename in filenames:try:withopen(filename, encoding=encoding)as fp:
self._read(fp, filename)except OSError:continueifisinstance(filename, os.PathLike):
filename = os.fspath(filename)
read_ok.append(filename)return read_ok