Mercurial > hg-stable
comparison hgext/lfs/blobstore.py @ 49430:192949b68159 stable
lfs: fix interpolation of int and %s in an exception case
Seen in the wild in a server log when MS antivirus was quarantining a file on
the client side.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 20 Oct 2022 12:05:17 -0400 |
parents | 642e31cb55f0 |
children | abf471862b8e 250d9c8aaf10 |
comparison
equal
deleted
inserted
replaced
49429:c7c437f35687 | 49430:192949b68159 |
---|---|
168 # producing the response (but the server has no way of telling us | 168 # producing the response (but the server has no way of telling us |
169 # that), and we really don't need to try to write the response to | 169 # that), and we really don't need to try to write the response to |
170 # the localstore, because it's not going to match the expected. | 170 # the localstore, because it's not going to match the expected. |
171 if content_length is not None and int(content_length) != size: | 171 if content_length is not None and int(content_length) != size: |
172 msg = ( | 172 msg = ( |
173 b"Response length (%s) does not match Content-Length " | 173 b"Response length (%d) does not match Content-Length " |
174 b"header (%d): likely server-side crash" | 174 b"header (%d): likely server-side crash" |
175 ) | 175 ) |
176 raise LfsRemoteError(_(msg) % (size, int(content_length))) | 176 raise LfsRemoteError(_(msg) % (size, int(content_length))) |
177 | 177 |
178 realoid = hex(sha256.digest()) | 178 realoid = hex(sha256.digest()) |