Skip to content
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

GH #248: Fix GreenFileIO.write() #250

Closed
wants to merge 1 commit into from
Closed

Conversation

@vstinner
Copy link
Contributor

vstinner commented Sep 24, 2015

On Python 3, GreenFileIO.write() now always write all bytes using a
loop, to have the same behaviour than GreenPipe.write() on Python 2.
Before, the write() could be partial, write less bytes than expected.

On Python 2, GreenPipe.write() doesn't allow partial writes, it
always write all bytes, even if the user requested an unbuffered pipe
(ex: by calling os.fdopen(fd, 'wb', 0)).

Modifying Python 2 to be pedantic and allow partial writes for
unbuffered pipes will likely break a lot of applications. It's
simpler to modify Python 3 GreenFileIO to behave the same than Python
2 GreenPipe.

On Python 3, GreenFileIO.write() now always write all bytes using a
loop, to have the same behaviour than GreenPipe.write() on Python 2.
Before, the write() could be partial, write less bytes than expected.

On Python 2, GreenPipe.write() doesn't allow partial writes, it
always write all bytes, even if the user requested an unbuffered pipe
(ex: by calling os.fdopen(fd, 'wb', 0)).

Modifying Python 2 to be pedantic and allow partial writes for
unbuffered pipes will likely break a lot of applications. It's
simpler to modify Python 3 GreenFileIO to behave the same than Python
2 GreenPipe.
@vstinner

This comment has been minimized.

Copy link
Contributor Author

vstinner commented Oct 13, 2015

Hi, any progress on this change?

@temoto

This comment has been minimized.

Copy link
Member

temoto commented Oct 13, 2015

Thank you, the fix is merged in master e3f8834

@temoto temoto closed this Oct 13, 2015
@vstinner

This comment has been minimized.

Copy link
Contributor Author

vstinner commented Oct 13, 2015

Wow, it's crazy how much I got from Travis because tests failed!

Please review my pull request #254 which fixes eventlet tests on Python 3. It's a regression introduced by the commit 299da78.

@temoto

This comment has been minimized.

Copy link
Member

temoto commented Oct 13, 2015

Yup, sorry, for some reason I wanted a green build this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.