diff --git a/scripts/glibc_check.py b/scripts/glibc_check.py index 02be4aac4..eb198ed56 100755 --- a/scripts/glibc_check.py +++ b/scripts/glibc_check.py @@ -41,7 +41,7 @@ def main(): overall_versions.add(requires_glibc) if verbose: print("%s %s" % (filename, format_version(requires_glibc))) - except subprocess.CalledProcessError as e: + except subprocess.CalledProcessError: if verbose: print("%s errored." % filename) diff --git a/setup.cfg b/setup.cfg index e2dc79ce5..b2da05b43 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ python_files = testsuite/*.py # with existing code. if you want to change them, you should first fix all # flake8 failures that appear with your change. ignore = E122,E123,E125,E126,E127,E128,E226,E402,E722,E731,E741,F401,F405,F811, - W504,W605,F841 + W504,W605 # line length long term target: 120 max-line-length = 255 exclude = build,dist,.git,.idea,.cache,.tox,docs/conf.py diff --git a/src/borg/archive.py b/src/borg/archive.py index c22a655f7..cf8976428 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -758,7 +758,7 @@ class ChunksIndexError(Error): def fetch_async_response(wait=True): try: return self.repository.async_response(wait=wait) - except Repository.ObjectNotFound as e: + except Repository.ObjectNotFound: nonlocal error # object not in repo - strange, but we wanted to delete it anyway. if forced == 0: @@ -1627,7 +1627,7 @@ def valid_item(obj): yield Item(internal_dict=item) else: report('Did not get expected metadata dict when unpacking item metadata (%s)' % reason, chunk_id, i) - except msgpack.UnpackException as err: + except msgpack.UnpackException: report('Unpacker crashed while unpacking item metadata, trying to resync...', chunk_id, i) unpacker.resync() except Exception: diff --git a/src/borg/crypto/nonces.py b/src/borg/crypto/nonces.py index 39ec3d723..fe5abc547 100644 --- a/src/borg/crypto/nonces.py +++ b/src/borg/crypto/nonces.py @@ -36,7 +36,7 @@ def commit_local_nonce_reservation(self, next_unreserved, start_nonce): def get_repo_free_nonce(self): try: return self.repository.get_free_nonce() - except InvalidRPCMethod as error: + except InvalidRPCMethod: # old server version, suppress further calls sys.stderr.write("Please upgrade to borg version 1.1+ on the server for safer AES-CTR nonce handling.\n") self.get_repo_free_nonce = lambda: None diff --git a/src/borg/testsuite/__init__.py b/src/borg/testsuite/__init__.py index 465e24fa1..caa7d2a22 100644 --- a/src/borg/testsuite/__init__.py +++ b/src/borg/testsuite/__init__.py @@ -111,7 +111,7 @@ def is_utime_fully_supported(): new_stats = os.stat(filepath, follow_symlinks=False) if new_stats.st_atime == 1000 and new_stats.st_mtime == 2000: return True - except OSError as err: + except OSError: pass return False @@ -133,7 +133,7 @@ def is_birthtime_fully_supported(): new_stats = os.stat(filepath, follow_symlinks=False) if new_stats.st_birthtime == birthtime and new_stats.st_mtime == mtime and new_stats.st_atime == atime: return True - except OSError as err: + except OSError: pass return False