From: Rob Browning Date: Fri, 8 Oct 2021 17:39:16 +0000 (-0500) Subject: save: detect missing metastore via ENOENT not EACCES X-Git-Url: https://arthur.ath.cx/gitweb/?a=commitdiff_plain;h=0840163bf2d3e9467807772283677856bb799887;p=bup.git 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 --- 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))