fix: JSON output empty for btcli subnets list --json-out command#800
Merged
ibraheem-abe merged 4 commits intoopentensor:stagingfrom Jan 21, 2026
Merged
Conversation
Release/9.17.0
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
Collaborator
|
Thank you for your contribution. The fix is correct but I think we shouldn't change the force_terminal for json_ouputs. This can possibly add ANSI escape sequences in some cases which can make the json_outputs malformed/in need of cleaning Also, this branch needs to be targeted against staging |
ibraheem-abe
approved these changes
Jan 21, 2026
basfroman
approved these changes
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #635
Problem
Running
btcli subnets list --json-outproduced no output.Root Cause
In
dict_table()function,tao_flow_emawas already converted to a float via.tao, but line 604 tried to call.taoagain, causing anAttributeError: 'float' object has no attribute 'tao'.This error was silently swallowed, resulting in empty output.
Changes
subnets.py: Fixed double.taocall ontao_flow_emautils.py: Changedjson_consoleto useforce_terminal=Trueto ensure output in all environmentsTesting
btcli subnets list --json-outnow produces valid JSON output