mercurial/ui.py
changeset 43910 c41ed5d4f770
parent 43909 dbaf9aabfb69
child 43991 e3ce3731d621
equal deleted inserted replaced
43909:dbaf9aabfb69 43910:c41ed5d4f770
   432         except IOError:
   432         except IOError:
   433             if not sections:  # ignore unless we were looking for something
   433             if not sections:  # ignore unless we were looking for something
   434                 return
   434                 return
   435             raise
   435             raise
   436 
   436 
   437         cfg = config.config()
   437         with fp:
   438         trusted = sections or trust or self._trusted(fp, filename)
   438             cfg = config.config()
   439 
   439             trusted = sections or trust or self._trusted(fp, filename)
   440         try:
   440 
   441             cfg.read(filename, fp, sections=sections, remap=remap)
   441             try:
   442             fp.close()
   442                 cfg.read(filename, fp, sections=sections, remap=remap)
   443         except error.ParseError as inst:
   443             except error.ParseError as inst:
   444             if trusted:
   444                 if trusted:
   445                 raise
   445                     raise
   446             self.warn(_(b"ignored: %s\n") % stringutil.forcebytestr(inst))
   446                 self.warn(_(b'ignored: %s\n') % stringutil.forcebytestr(inst))
   447 
   447 
   448         if self.plain():
   448         if self.plain():
   449             for k in (
   449             for k in (
   450                 b'debug',
   450                 b'debug',
   451                 b'fallbackencoding',
   451                 b'fallbackencoding',