New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdout buffering under python3 provides suboptimal UX #1131

Closed
alex opened this Issue Aug 12, 2013 · 6 comments

Comments

Projects
None yet
4 participants
@alex
Member

alex commented Aug 12, 2013

Under python3, stdout is a buffered writer, as a result, no output happens until the entire process exits, which is a poor user experience when you're installing a bunch of packages. It should flush the buffer regularly.

@jezdez

This comment has been minimized.

Show comment
Hide comment
@jezdez

jezdez Aug 12, 2013

Contributor

It flushes here, FTR

pip/pip/log.py

Line 145 in 5f1ca6b

sys.stdout.flush()

Contributor

jezdez commented Aug 12, 2013

It flushes here, FTR

pip/pip/log.py

Line 145 in 5f1ca6b

sys.stdout.flush()

@alex

This comment has been minimized.

Show comment
Hide comment
@alex

alex Aug 12, 2013

Member

Weird! I wonder why this occurs.

Member

alex commented Aug 12, 2013

Weird! I wonder why this occurs.

@xordoquy

This comment has been minimized.

Show comment
Hide comment
@xordoquy

xordoquy Aug 12, 2013

http://docs.python.org/3/library/sys.html#sys.stdout

"When interactive, standard streams are line-buffered. Otherwise, they are block-buffered like regular text files. You can override this value with the -u command-line option."

xordoquy commented Aug 12, 2013

http://docs.python.org/3/library/sys.html#sys.stdout

"When interactive, standard streams are line-buffered. Otherwise, they are block-buffered like regular text files. You can override this value with the -u command-line option."

@xordoquy

This comment has been minimized.

Show comment
Hide comment
@xordoquy

xordoquy Aug 12, 2013

f.buffer.write(b(s))

There's no flush here. If I add one, I have the logs output immediatly.

xordoquy commented Aug 12, 2013

f.buffer.write(b(s))

There's no flush here. If I add one, I have the logs output immediatly.

@jezdez

This comment has been minimized.

Show comment
Hide comment
@jezdez

jezdez Aug 12, 2013

Contributor

@xordoquy Good catch, that seems the culprit, indeed.

Contributor

jezdez commented Aug 12, 2013

@xordoquy Good catch, that seems the culprit, indeed.

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Sep 19, 2013

Contributor

fixed here in pypa/develop: 129a37b
I confirmed tests passed before direct push to pypa: https://travis-ci.org/qwcode/pip/builds/11573223

Contributor

qwcode commented Sep 19, 2013

fixed here in pypa/develop: 129a37b
I confirmed tests passed before direct push to pypa: https://travis-ci.org/qwcode/pip/builds/11573223

@qwcode qwcode closed this Sep 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment