diff --git a/bittensor_cli/src/bittensor/utils.py b/bittensor_cli/src/bittensor/utils.py index 1497470a9..80aab6916 100644 --- a/bittensor_cli/src/bittensor/utils.py +++ b/bittensor_cli/src/bittensor/utils.py @@ -266,7 +266,7 @@ def get_hotkey_wallets_for_wallet( hotkeys_path = wallet_path / wallet.name / "hotkeys" try: hotkeys = [entry.name for entry in hotkeys_path.iterdir()] - except FileNotFoundError: + except (FileNotFoundError, NotADirectoryError): hotkeys = [] for h_name in hotkeys: if h_name.endswith("pub.txt"): @@ -307,6 +307,7 @@ def get_hotkey_wallets_for_wallet( AttributeError, TypeError, KeyFileError, + ValueError, ): # usually an unrelated file like .DS_Store continue diff --git a/bittensor_cli/src/commands/wallets.py b/bittensor_cli/src/commands/wallets.py index 391fe2cf2..1112d195d 100644 --- a/bittensor_cli/src/commands/wallets.py +++ b/bittensor_cli/src/commands/wallets.py @@ -823,6 +823,7 @@ async def wallet_list(wallet_path: str, json_output: bool): for wallet in wallets: if ( wallet.coldkeypub_file.exists_on_device() + and os.path.isfile(wallet.coldkeypub_file.path) and not wallet.coldkeypub_file.is_encrypted() ): coldkeypub_str = wallet.coldkeypub.ss58_address