This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Sworddragon, akira, eryksun, vstinner
Date 2014-09-20.06:56:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411196197.53.0.434323502223.issue22443@psf.upfronthosting.co.za>
In-reply-to
Content
unbuffer works for me. It fakes a tty, so apt-get doesn't automatically enter quiet mode.

    import io
    import subprocess

    args = ['unbuffer', 'apt-get', 'download', 'firefox']
    p = subprocess.Popen(args, 
                         stdout=subprocess.PIPE, 
                         stderr=subprocess.STDOUT)
    out = io.TextIOWrapper(p.stdout, newline='')

    while True:
        c = out.read(1)
        if c == '':
            break
        print(c, end='', flush=True)

    p.wait()

unbuffer isn't required if you disable quiet mode as follows:

    args = ['apt-get', '-q=0', 'download', 'firefox']
History
Date User Action Args
2014-09-20 06:56:37eryksunsetrecipients: + eryksun, vstinner, akira, Sworddragon
2014-09-20 06:56:37eryksunsetmessageid: <1411196197.53.0.434323502223.issue22443@psf.upfronthosting.co.za>
2014-09-20 06:56:37eryksunlinkissue22443 messages
2014-09-20 06:56:37eryksuncreate