Skip to content

Conversation

@GlobalStar117
Copy link

Fixes #635

Problem

Running btcli subnets list --json-out produced no output.

Root Cause

In dict_table() function, tao_flow_ema was already converted to a float via .tao, but line 604 tried to call .tao again, causing an AttributeError: 'float' object has no attribute 'tao'.

This error was silently swallowed, resulting in empty output.

Changes

  1. subnets.py: Fixed double .tao call on tao_flow_ema
  2. utils.py: Changed json_console to use force_terminal=True to ensure output in all environments

Testing

  • Verified btcli subnets list --json-out now produces valid JSON output
  • Tested with Python 3.12, BTCLI 9.17.0, finney network

Fixes opentensor#635

## Problem
Running `btcli subnets list --json-out` produced no output.

## Root Cause
In `dict_table()` function, `tao_flow_ema` was already converted to a float
via `.tao`, but line 604 tried to call `.tao` again, causing an
`AttributeError: 'float' object has no attribute 'tao'`.

This error was silently swallowed, resulting in empty output.

## Changes
1. `subnets.py`: Fixed double `.tao` call on `tao_flow_ema`
2. `utils.py`: Changed `json_console` to use `force_terminal=True`
   to ensure output in all environments

## Testing
- Verified `btcli subnets list --json-out` now produces valid JSON output
- Tested with Python 3.12, BTCLI 9.17.0, finney network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve JSON output

1 participant