From 0840163bf2d3e9467807772283677856bb799887 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Fri, 8 Oct 2021 12:39:16 -0500 Subject: [PATCH] save: detect missing metastore via ENOENT not EACCES While we might also eventually want to handle EACCES, ENOENT should be what we want for the current handler, i.e. "does it exist at all". Signed-off-by: Rob Browning --- lib/bup/cmd/save.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bup/cmd/save.py b/lib/bup/cmd/save.py index 4deef5d..88f74d7 100755 --- a/lib/bup/cmd/save.py +++ b/lib/bup/cmd/save.py @@ -1,7 +1,7 @@ from __future__ import absolute_import, print_function from binascii import hexlify -from errno import EACCES +from errno import ENOENT from io import BytesIO import math, os, stat, sys, time @@ -513,7 +513,7 @@ def main(argv): try: msr = index.MetaStoreReader(indexfile + b'.meta') except IOError as ex: - if ex.errno != EACCES: + if ex.errno != ENOENT: raise log('error: cannot access %r; have you run bup index?' % path_msg(indexfile)) -- 2.39.2