@@ -62,7 +62,7 @@ def async_wrapper(fn):
6262from .archiver ._common import build_matcher , build_filter
6363from .archive import Archive , get_item_uid_gid
6464from .hashindex import FuseVersionsIndex
65- from .helpers import daemonize , daemonizing , signal_handler , format_file_size , bin_to_hex
65+ from .helpers import daemonize , daemonizing , signal_handler , format_file_size , bin_to_hex , Error
6666from .helpers import HardLinkManager
6767from .helpers import msgpack
6868from .helpers .lrucache import LRUCache
@@ -574,8 +574,16 @@ def pop_option(options, key, present, not_present, wanted_type, int_base=0):
574574 dir_gid = self .gid_forced if self .gid_forced is not None else self .default_gid
575575 dir_user = uid2user (dir_uid )
576576 dir_group = gid2group (dir_gid )
577- assert isinstance (dir_user , str )
578- assert isinstance (dir_group , str )
577+ if not isinstance (dir_user , str ):
578+ raise Error (
579+ f"uid { dir_uid } can not be resolved to a username. "
580+ f"Please check that the corresponding user exists or do not specify a uid mount option."
581+ )
582+ if not isinstance (dir_group , str ):
583+ raise Error (
584+ f"gid { dir_gid } can not be resolved to a group name. "
585+ f"Please check that the corresponding group exists or do not specify a gid mount option."
586+ )
579587 dir_mode = 0o40755 & ~ self .umask
580588 self .default_dir = Item (
581589 mode = dir_mode , mtime = int (time .time () * 1e9 ), user = dir_user , group = dir_group , uid = dir_uid , gid = dir_gid
0 commit comments