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 8988365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:00:01+00:00 2026-06-15T22:00:01+00:00

In the document of wait (http://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait), it says: Warning This will deadlock when using

  • 0

In the document of wait (http://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait), it says:

Warning

This will deadlock when using stdout=PIPE and/or stderr=PIPE and the
child process generates enough output to a pipe such that it blocks
waiting for the OS pipe buffer to accept more data. Use communicate()
to avoid that.

From this, I think communicate could replace all usage of wait() if retcode is not need. And even when the stdout or stdin are not PIPE, I can also replace wait() by communicate().

Is that right? Thanks!

  • 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-06-15T22:00:02+00:00Added an answer on June 15, 2026 at 10:00 pm

    I suspect (the docs don’t explicitly state it as of 2.6) in the case where you don’t use PIPEs communicate() is reduced to wait(). So if you don’t use PIPEs it should be OK to replace wait().

    In the case where you do use PIPEs you can overflow memory buffer (see communicate() note) just as you can fill up OS pipe buffer, so either one is not going to work if you’re dealing with a lot of output.

    On a practical note I had communicate (at least in 2.4) give me one character per line from programs whose output is line-based, that wasn’t useful to put it mildly.

    Also, what do you mean by “retcode is not needed”? — I believe it sets Popen.returncode just as wait() does.

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

Sidebar

Related Questions

The following snippet of jquery says wait until the document is ready. $(document).ready(function() {
Suppose I have 1) a HTML document. 2) This HTML document loads Javascript file
My code as follow: <html xmlns=http://www.w3.org/1999/xhtml> <head> <meta http-equiv=content-type content=text/html; charset=UTF-8> <title>Demo</title> <style type=text/css>
this is my example http://gidzior.net/map/v3_animate_marker_directions.html (i'm using placeholder in the input), thx for the
document.referrer in javascript is blank from a 302 redirect from http to https using
document.getElementById('container').addEventListener('copy',beforecopy,false ); In Chrome / Safari, the above will run the "beforecopy" function when
document.write('test'); Will work, and print 'test' to the document. document.write(d.toDateString()); Does nothing. d is
document.onkeydown.toString() returns onkeydown function but I only want to get this function's name. Is
I need to wait for document readyness in my JavaScript, to insert a div
I've successfully installed this jQuery-based signup form here: http://net.tutsplus.com/tutorials/javascript-ajax/building-a-sleek-ajax-signup-form/ But when I applied it

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.