[2.7] bpo-32304: Fix distutils upload for tar files ending with b'\r' (GH-5264)#5331
Merged
Conversation
…thonGH-5264) Patch by Bo Bayles.. (cherry picked from commit 2fc98ae)
Member
|
Thanks for the backport. Could you also port the what’s new entry? |
merwok
reviewed
Jan 26, 2018
|
|
||
| # bpo-32304: archives whose last byte was b'\r' were corrupted due to | ||
| # normalization intended for Mac OS 9. | ||
| def test_upload_correct_cr(self): |
Member
There was a problem hiding this comment.
This is the test failure: https://travis-ci.org/python/cpython/jobs/333550360#L2640-L2647
Contributor
Author
There was a problem hiding this comment.
Yeah, I see what's going on - the cmd.show_response isn't the same in this version. There are some other differences in the test I'll smooth out shortly.
merwok
reviewed
Jan 28, 2018
|
|
||
| headers = dict(self.last_open.req.headers) | ||
| self.assertEqual(headers['Content-length'], '2170') | ||
| self.assertIn(b'long description\r', self.last_open.req.data) |
Member
There was a problem hiding this comment.
This test would not catch a regression, i.e. fail if the request data contains b'long description\r\n'.
Contributor
Author
There was a problem hiding this comment.
The size check earlier would signal the error, but I've added a new line to make it explicit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR brings #5264, which @merwok merged, to version 2.7.
https://bugs.python.org/issue32304