"Run" console does not print everything - cuts long string after half of it was printed

Could not find anything regarding this issue via search.

I'm normally use the "Run" console ("Emulate terminal in output console"). I use some print() statements to debug my code, they print some json I fetched from the internet. The json can have like 30k characters. Using print() will only print a part then simply cut the rest. So I see the beginning until at one point it just cuts.

I can recreate this problem by just using print() on a string with 24k characters. PyCharm "Run" will cut it after ~12k chars. If it's 20k chars, it will cut after ~10k chars, 18k -> 9k and if it's 13k chars it prints everything. It basically only prints half.

I edited `idea.cycle.buffer.size` to a big value 999999 or to 'disabled', but that does not change anything.

If I "Run with Python Console", it works fine.

Is this a bug that the "Run" console cannot output that many characters in a single print() ?

 

Thank you

1
7 comments

Hello, 

 

I have tried to reproduce it with this code:

if __name__ == '__main__':
n = 24000
numbers = []
numbers.extend(range(2, n))
print(numbers)

 

But the numbers were printed out as should, could you please provide me with your example? 

0

Thank you for your answer.

See screenshot - it cuts.

 

PyCharm 2020.1.1 (Community Edition)
Build #PC-201.7223.92, built on April 30, 2020
Runtime version: 11.0.6+8-b765.40 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1
GC: ParNew, ConcurrentMarkSweep
Memory: 2014M
Cores: 4

Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32


0

PyCharm 2020.1 is not supported for Windows 7, please see https://www.jetbrains.com/help/pycharm/quick-start-guide.html

 

You can try previous versions, for example 2019 - this should work. https://www.jetbrains.com/pycharm/download/other.html

0

After some testing, I found the issue.

In the "Run Configuration" -> "Execution" you have basically three options:

1) Select nothing

2) [ ] Emulate terminal in console

3) [ ] Run with Python Console

 

My bug occurs only, when "Emulate terminal in console" is selected. If I select nothing, it works fine.

And yes just for the sake of it, it has nothing to do with W7 I tested the old version (and I had this issue anyway with 2019).

 

EDIT: My cmd.exe buffer is set to quite a high value. If I save the output from the code above to a text file and then "cat" it in cmd.exe, it prints everything.

EDIT2: Seems I'm not the only one who had/has this issue: https://stackoverflow.com/a/59871058/2441026

0

Got it, 

 

Please try to run the code I have provided as an example, from cmd. Will you get the same result? 

0

Saving the code to a .py file and running it via cmd will print all 24k numbers and I can scroll up and see every number up to the beginning.

0

Hello, 

 

I have submitted the bug here https://youtrack.jetbrains.com/issue/PY-42726 , please follow it for updates. 

Information on how to use YouTrack: https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications

 

Also, could you please attach your logs folder zipped from ***Help | Collect logs and Diagnostic Data***  to the ticket? 

 

Sorry for the inconvenience. 

0

Please sign in to leave a comment.