try:
f = _io.open(self._datfile, 'r', encoding="Latin-1")
except OSError:
- f = _io.open(self._datfile, 'w', encoding="Latin-1")
- self._chmod(self._datfile)
- f.close()
+ with _io.open(self._datfile, 'w', encoding="Latin-1") as f:
+ self._chmod(self._datfile)
+ else:
+ f.close()
- self._update()
# Read directory file into the in-memory index dict.
def _update(self):
Library
-------
+ - Issue #21729: Used the "with" statement in the dbm.dumb module to ensure
+ files closing. Patch by Claudiu Popa.
+
- Issue #21491: socketserver: Fix a race condition in child processes reaping.
-- Issue #21832: Require named tuple inputs to be exact strings.
-
-- Issue #19145: The times argument for itertools.repeat now handles
- negative values the same way for keyword arguments as it does for
- positional arguments.
+- Issue #21719: Added the ``st_file_attributes`` field to os.stat_result on
+ Windows.
-- Issue #21812: turtle.shapetransform did not tranform the turtle on the
- first call. (Issue identified and fixed by Lita Cho.)
-
-- Issue #21635: The difflib SequenceMatcher.get_matching_blocks() method
- cache didn't match the actual result. The former was a list of tuples
- and the latter was a list of named tuples.
+- Issue #21832: Require named tuple inputs to be exact strings.
- Issue #21722: The distutils "upload" command now exits with a non-zero
return code when uploading fails. Patch by Martin Dengler.