Skip to content

ANSI Escape Sequences do not work under PM2 in version of bittensor older than 6.9.4 #2365

@vaqxai

Description

@vaqxai

Describe the bug

When using ansi escape sequences with bittensor 6.9.4, the messages are correctly formatted, but not later (7.1.2 and 8.2.0 tested) versions. Even a simple print() before any bittensor functions are executed (other than the import itself) doesn't work with colorized messages in the later versions.

To Reproduce

print("Test Colored: \033[0;33mTest")
import bittensor as bt
print("Test Colored: \033[0;33mTest")

while using bittensor==6.9.4 yields correct colorization (while the python script is ran under PM2 process manager)
then change bittensor to be 8.2.0 or 7.1.2 (i havent tested with other versions), and see that after import bittensor the colorization stops working.
This behaviour will carry over to any bt.logging.info or ANY attempt to print to stdout.

Expected behavior

All messages accept and use ANSI Escape sequences correctly

Screenshots

image
image
image

Environment

Python3.12, PM2 5.4.2, Bittensor 6.9.4/7.1.2/8.2.0, Ubuntu 24.04, kitty terminal over openssh

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions