Specify encoding for "open()" functions

This commit is contained in:
Ivan Kravets committed 2021-08-28 13:10:07 +03:00
1 parent b9219a2b62
commit d819617d2b
28 files changed
+63 -43

No files matched your search

+3 -1
View File
@@ -62,7 +62,9 @@ class LockFile(object):
else:
raise LockFileExists
self._fp = open(self._lock_path, "w") # pylint: disable=consider-using-with
self._fp = open(
self._lock_path, mode="w", encoding="utf8"
) # pylint: disable=consider-using-with
try:
if LOCKFILE_CURRENT_INTERFACE == LOCKFILE_INTERFACE_FCNTL:
fcntl.flock(self._fp.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)