Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee='https://github.com/merwok'closed_at=<Date2018-02-23.18:23:31.886>created_at=<Date2017-12-13.15:48:29.389>labels= ['type-security', '3.7', 'library']
title='Upload failed (400): Digests do not match on .tar.gz ending with x0d binary code'updated_at=<Date2018-02-23.18:23:31.884>user='https://github.com/llecaroz'
Upload failed (400): Digests do not match, found: 09f23b52764a6802a87dd753009c2d3d, expected: 972b8e9d3dc8cf6ba6b4b1ad5991f013
error: Upload failed (400): Digests do not match, found: 09f23b52764a6802a87dd753009c2d3d, expected: 972b8e9d3dc8cf6ba6b4b1ad5991f013
As this line is generic & run on all key/values, I clearly understand that this check was initially written to eliminate certainly some issues on values in text format.
But the mistake here, is that you are also changing the content of the 'content' key which contains the .tar.gz as value, and because you remove the ending 0D, you change the .tar.gz content to be uploaded. As consequence, the server will return a 400 error about a wrong digest/crc.
I was able to make the code working with all .tar.gz files by changing this line to:
With a such fix, the .tar.gz content will not see its ending \r to be removed & the computed CRC from the server will be the same as computed by md5(content).hexdigest() in upload.py