#1144193 invoke.util.run: Encountered exception SystemError('buffer overflow') in thread for 'handle_stdin'

Package:
python3-invoke
Source:
python3-invoke
Submitter:
Hefee
Date:
2026-08-17 17:43:05 UTC
Severity:
normal
Tags:
#1144193#5
Date:
2026-08-12 06:41:39 UTC
From:
To:
Hey,

When I run a command with pty=True, that needs input, I see a
SystemError after the first pressed character.

example (tasks.py):

@tasks
def check(c):
    c.run("sudo echo 'huhu'", pty=True)


$invoke --debug check
[...]
invoke.executor.execute: Finished loading collection & shell env configs
[sudo] password for hefee:
[press first character] invoke.util.run: Encountered exception SystemError('buffer overflow') in thread for 'handle_stdin'

I checked and this issue is tracked upstream in https://github.com/pyinvoke/invoke/issues/1070
there is a pull requests open that fixes it:
https://github.com/pyinvoke/invoke/pull/1077

With fixing terminals.py, the issue is gone.