-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sys.stdout
output with many lines is truncated on the integrated terminal with pythonTerminalEnvVarActivation
#21312
Comments
Can you demonstrate that opting out of |
Yes: If that helps, toggling By the way, this is in the integrated terminal with |
@Tyriar Any idea why this might be happening when using env collection, is a restriction imposed for |
No restriction, I don't know how this could happen. |
@bersbersbers It's likely because of some environment variables which are being set due to experiment. Try the following:
|
Done - installed v2023.13.12071009.
This is before opening a
Problem does not reproduce. After opening a
Problem appears again.
Nothing for me to do here, I fear :( |
Sure! I also verified this:
|
This appears to be missing. |
Also, please send the result of the command below when run outside VS Code in command prompt:
Make sure to replace |
Lastly, I may need the debug logs based on above information:
|
Sorry for that: The other commands contain quite a bit of to-be-redacted information, so unless you absolutely need this, I'd like to proceed without first. To help in that: I was able to reproduce the problem outside of VS Code, looking at the difference between environments at different times:
So this creates the same problem in rem Pass
python -c "import sys; sys.stdout.write(''.join(f'{i:04d} \n' for i in range(5000)))"
set PYTHONUNBUFFERED=1
rem Fail
python -c "import sys; sys.stdout.write(''.join(f'{i:04d} \n' for i in range(5000)))" |
This seems to be a duplicate of python/cpython#86210 |
Yup, seems like it. I have modified our code to not Thanks for helping diagnose this btw~ |
I have tried v2023.15.5755506229-dev and it seems to do the trick (took me a couple of tries, but once I closed all terminals and installed the VSIX every time I reloaded VS Code, it worked). Thanks! |
Type: Bug
Behaviour
Expected vs. Actual
Expected: See numbers 0-4999
Actual: See fewer numbers, in my case, 0-1249
Discovered in Nuitka/Nuitka#2249
The number of lines printed actually varies with the number of lines generated:
1 -> 1
10 -> 10
100 -> 100
900 -> 900
1000 -> 1000
2000 -> 2000
2300 -> 2300
2340 -> 2340
2342 -> 1171
2344 -> 1172
3000 -> 1500
4000 -> 2000
5000 -> 1250
10000 -> 1250
So it looks like something is restricting the number of lines to <= 2340 by division by 2. If the original number if not divisible by 2, one can even end up with incomplete lines. That number does not seem to depend on the length of the lines.
Steps to reproduce:
pythonTerminalEnvVarActivation
experimentpython -c "import sys; sys.stdout.write(''.join(f'{i:04d} \n' for i in range(5000)))"
Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.8.0
VS Code version: Code 1.78.2 (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:39:26.248Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No
The text was updated successfully, but these errors were encountered: