Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7603523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:40:39+00:00 2026-05-30T23:40:39+00:00

I experienced this bug in a more complex application I am developing. I execute

  • 0

I experienced this bug in a more complex application I am developing. I execute a python server program and want to read the first data available. And then close it. I do that to validate some settings from the server.

My problem boils down to:

  • QProcess.waitForReadyRead() doesn’t return and timeouts, it’s supposed to return True very quickly
  • It used to work, I rollbacked to an older revision to try to find what caused this to break now, but it’s always there now, I really tried everything I could think of, so I want to know if it’s a normal problem or maybe something that would only affect me and caused by my environment.

This is the test I wrote to show the problem, when I execute it, the 3 first checks return the data immediately, but the last one timeouts and I get no data.

This is certainly not logical. In the test I used wait, in my server it’s just a select-like function, it’s implemented with base modules in python.

from PyQt4 import QtCore

#FILE: 1.py
#print 'TEST'

#FILE: 2.py
# import time
#print 'TEST'
#time.sleep(100)

#FILE: 1.sh
# echo 'TEST'

#FILE: 2.sh
# echo 'TEST'
# sleep 100


proc0= QtCore.QProcess()
proc0.start('sh', ['./1.sh'])
proc0.waitForStarted()
proc0.waitForReadyRead(10000)
output0 = proc0.readAll()

proc1= QtCore.QProcess()
proc1.start('sh', ['./2.sh'])
proc1.waitForStarted()
proc1.waitForReadyRead(10000)
output1 = proc1.readAll()

proc2= QtCore.QProcess()
proc2.start('python', ['./1.py'])
proc2.waitForStarted()
proc2.waitForReadyRead(10000)
output2 = proc2.readAll()

proc3= QtCore.QProcess()
proc3.start('python', ['./2.py'])
proc3.waitForStarted()
proc3.waitForReadyRead(10000)
output3 = proc3.readAll()

print "0"
print output0.size()
print repr(output0.data())
print "1"
print output1.size()
print repr(output1.data())
print "2"
print output2.size()
print repr(output2.data())
print "3"
print output3.size()
print repr(output3.data())

proc0.close()
proc1.close()
proc2.close()
proc3.close()

Is the last test (proc3) supposed to behave like I described? Is there a workaround or a fix that would let me read the data form stdout in my python server…? What is it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:40:41+00:00Added an answer on May 30, 2026 at 11:40 pm

    It’s a comment but…

    I found the solution, python’s print doesn’t flush stdout and waits for a certain amount of data before actually pushing the data to the stdout. sys.stdout.flush() fixed it.

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

has anyone else experienced this . I have SP1 but i have to kill
Has anyone else experienced this? I have uninstalled and reinstalled TortoiseSVN as well as
I know this isn't strictly a programming question but y'all must have experienced this.
This might be an easy one, but I'm not really experienced with sql. I
Forgive me if this is a stupid question. I am not very experienced with
Ok, I am pretty experienced at CSS but at this point I am at
I'm about to deploy to production a fairly complex site and for the first
This is running on Windows 7 (64 bit), Python 2.6 with Win32 Extensions for
I'm trying to find a bug in an old ASP.NET application which causes IE8
Edit: This code is fine. I found a logic bug somewhere that doesn't exist

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.