Bug 427128

Summary: should not buffer python script run or debug output
Product: [Developer tools] kdev-python Reporter: Gaël de Chalendar (aka Kleag) <kleagg>
Component: User interfaceAssignee: Sven Brauch <mail>
Status: RESOLVED DUPLICATE    
Severity: normal CC: mail
Priority: NOR    
Version: 5.5.2   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Gaël de Chalendar (aka Kleag) 2020-09-29 20:07:02 UTC
SUMMARY


STEPS TO REPRODUCE
1. Setup a launch configuration to run the following script:
import time

for i in range(100000000):
    print(i)
    time.sleep(0.001)

2. Run/debug the launch configuration

OBSERVED RESULT
Outputs appear in batches each one or 2 seconds.

EXPECTED RESULT
As in a console, ran or debugged program output (even if stdout) should not be buffered

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Frameworks 5.69.0
Qt 5.12.8 (construit sur 5.12.8)
KDE Neon

ADDITIONAL INFORMATION
Comment 1 Francis Herne 2020-09-29 20:25:33 UTC
Yep, this is a bit annoying.

You can use `sys.stdout.flush()`, but it shouldn't be necessary.

*** This bug has been marked as a duplicate of bug 384791 ***
Comment 2 Sven Brauch 2020-09-29 20:28:36 UTC
I don't understand why this happens, I tried investigating before but never dug deep enough to find the reason. The complaint is valid, of course.
Comment 3 Gaël de Chalendar (aka Kleag) 2020-09-29 21:29:10 UTC
Side note: how did I miss the original bug which I duplicated? I searched before submitting!

I currently work on a research project using AI for helping software engineering, doing requirements traceability for example. Maybe I should add bug duplicate detection as an important task to handle!