-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix terminal size detection #299
Conversation
I don't believe this solves the problem, see sample CI run here. Note that Using the fallback when the original answer is zero only occurs in Python 3.11+:
Source: https://docs.python.org/3/library/shutil.html#shutil.get_terminal_size |
I have tested it with Docker. Non-tty terminals are handled correctly when passing the the exact commands I used:
And as you see on the screen, in no case, it returns |
Ah, interesting! Ok, then I think there has been a miscommunication: The original issue reported to poetry was that poetry was breaking in CircleCI. After our investigation in python-poetry/poetry#7184, we ultimately determined the root cause was the @neersighted proposed here that it may be possible to reproduce this error by running in docker without a tty, but that was meant to be a reproduction case rather than actually being the central issue. Given your results show that your change here fixes the issue in docker, but my results here show that CircleCI continues to receive EDIT: I guess this implies the original issue in CircleCI is not definitely related to the existence/non-existence of an attached tty. |
Interesting... Seems like a Circle CI thing (online-judge-tools/oj#611, aws/aws-cdk#2355) |
It appears that they do allocate a TTY with a (reported) size of zero, which is fascinating and going to break other tools... e.g. bash provides variables for this that just report the value of |
Is there any blocker for this fix? |
Closes: python-poetry/poetry#7184
This fixes the issue, where in Python <3.11
shutil.get_terminal_size()
would return(0, 0)
size in non-TTY terminals.