`pty` option not working as expected in Python 3.14
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the behavior using the tasks.py and main.py examples, comparing Python 3.13 with Python 3.14 on macOS. Start by tracing the pty=True execution path and the handling of keyboard input; done means interactive input and Ctrl-C work again under Python 3.14.
Written by the indexing model from the issue text.
Description
I have some tasks that use an interactive terminal however when running those tasks with Python 3.14 the keyboard inputs are not passed through.
I'm not sure my understanding of the issue is good enough to explain it but I have created an example below which should demonstrate the issue:
tasks.py
from invoke import task
@task
def run(c):
c.run("python main.py", pty=True)
main.py
#!/usr/bin/env python3
def main():
result = input("Please enter some text: ")
print(f"This is what you input: {result}")
if __name__ == '__main__':
main()
When I run this with Python 3.13 or older it accepts the input and prints the result:
invoke run
Please enter some text: Some text
This is what you input: Some text
When I run this with Python 3.14, the input is not accepted and actually no keyboard inputs seem to go through including ctrl C to kill the process:
invoke run
Please enter some text: Some text
^C^C
^C^C
I am using pyenv to manage the Python versions (which is 3.14.0 to be exact) and I'm on macOS Sequoia Version 15.7
- Dominant language
- Python
- Stars
- 4.8k
- Forks
- 412
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pyinvoke/invoke
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100