Skip to content

Pin blessed < 1.40.0 - #816

Merged
pinheadmz merged 1 commit into
bitcoin-dev-project:mainfrom
sr-gi:pin-blessed
Jul 23, 2026
Merged

Pin blessed < 1.40.0#816
pinheadmz merged 1 commit into
bitcoin-dev-project:mainfrom
sr-gi:pin-blessed

Conversation

@sr-gi

@sr-gi sr-gi commented Jul 21, 2026

Copy link
Copy Markdown
Member

Starting from blessed 1.40.0, Terminal.init queries the terminal's capabilities via an XTGETTCAP escape sequence and blocks reading the response. This runs as a side effect of merely importing inquirer (control.py imports it at module scope).

warnet pins inquirer==3.4.0, but inquirer doesn't pin its own dependency on blessed, so a fresh install always resolves to whatever blessed release is newest at install time.

warnet deploy spawns one multiprocessing.Process per tank. In macOS deployments this becomes a problem, given multiprocessing's default start method is "spawn". When running warnet deploy in macOS, each spawned task will re-execute the whole warnet import tree, re-triger the inquirer import and run the blocking terminal query.

Starting from blessed 1.40.0, Terminal.__init__ queries the terminal's capabilities via an XTGETTCAP
escape sequence and blocks reading the response. This runs as a side effect of merely importing inquirer
(control.py imports it at module scope).

warnet pins inquirer==3.4.0, but inquirer doesn't pin its own dependency on blessed,
so a fresh install always resolves to whatever blessed release is newest at install time.

warnet deploy spawns one multiprocessing.Process per tank. In macOS deployments this becomes a problem,
given multiprocessing's default start method is "spawn". When running `warnet deploy` in macOS, each
spawned task will re-execute the whole warnet import tree, re-triger the inquirer import and run the
blocking terminal query.
@sr-gi

sr-gi commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

My laptop got fried last week and I've been slowly working towards getting my new setup up to speed.

Run into this today when trying to re-deploy warnet. I'm guessing I didn't run into this earlier as blessed may have been pulled by inquirer before it got updated to 1.40.0

@pinheadmz

Copy link
Copy Markdown
Contributor

I tried to reproduce, installing master as a "fresh install" with pip install --no-cache-dir -e .

I got the latest version of blessed:

Collecting blessed>=1.19.0 (from inquirer==3.4.0->warnet==1.1.20.post1.dev52+g486bd7846)
  Downloading blessed-1.47.0-py3-none-any.whl.metadata (13 kB)

... but didn't have any problems deploying a network (on macos).
Although I did notice it does something weird to my terminal (bash, in a tmux pane). The cursor and anything I type is invisible until i execute reset.

I wonder if what you're seeing is from another package? Here's my list inside the warnet venv:

(.venv) --> pip freeze
blessed==1.47.0
blinker==1.9.0
certifi==2026.7.22
cffi==2.1.0
charset-normalizer==3.4.9
click==8.1.7
cryptography==49.0.0
docker==7.1.0
editor==1.8.0
Flask==3.0.3
google-auth==2.56.2
idna==3.18
inquirer==3.4.0
itsdangerous==2.2.0
Jinja2==3.1.6
jinxed==2.1.0
kubernetes==30.1.0
markdown-it-py==4.2.0
MarkupSafe==3.0.3
mdurl==0.1.2
oauthlib==3.3.1
pexpect==4.9.0
ptyprocess==0.7.0
pyasn1==0.6.4
pyasn1_modules==0.4.2
pycparser==3.0
Pygments==2.20.0
python-dateutil==2.9.0.post0
PyYAML==6.0.2
readchar==4.2.2
requests==2.34.2
requests-oauthlib==2.0.0
rich==13.7.1
runs==1.3.0
six==1.17.0
tabulate==0.9.0
urllib3==2.7.0
-e git+https://github.com/bitcoin-dev-project/warnet@486bd7846f16f3a847597a49abf1395255fde689#egg=warnet
wcwidth==0.8.2
websocket-client==1.9.0
Werkzeug==3.1.8
xmod==1.10.0

@pinheadmz

Copy link
Copy Markdown
Contributor

also, python 3.14.5

@sr-gi

sr-gi commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Just re-tested this. After blessed 1.39.0, I need to keep pressing enter on my terminal to release it to make the deployment work, whereas before, the TTY is not captured.

This is with python 3.12.13.

This even happens with small networks. Some time at the beginning of the deployment, some times half way through it, and the only way to keep it going is by "hitting enter".

@pinheadmz

Copy link
Copy Markdown
Contributor

Got it yep, reproduced the bug and confirmed the fix. GRACIAS

@pinheadmz
pinheadmz merged commit 88a3c54 into bitcoin-dev-project:main Jul 23, 2026
16 checks passed
@sr-gi

sr-gi commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Gracias a ti amigo 💃

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.

2 participants