mirror of
https://github.com/pypiserver/pypiserver
synced 2024-12-20 13:55:49 +01:00
Fix usage of string formatting in HTTPError (#310)
`HTTPError(code, message, format_args)` appears to be equivalent to `HTTPError(status=code, body=message, exception=format_args)` which is not what we want here. The string formatting can't be deferred like in logging library usage.
This commit is contained in:
parent
6589170cfb
commit
1efb991069
@ -174,9 +174,7 @@ def file_upload():
|
||||
):
|
||||
raise HTTPError(
|
||||
400,
|
||||
"Unrelated signature %r for package %r!",
|
||||
ufiles.sig,
|
||||
ufiles.pkg,
|
||||
"Unrelated signature %r for package %r!" % (ufiles.sig, ufiles.pkg)
|
||||
)
|
||||
|
||||
for uf in ufiles:
|
||||
@ -197,8 +195,8 @@ def file_upload():
|
||||
raise HTTPError(
|
||||
409,
|
||||
"Package %r already exists!\n"
|
||||
" You may start server with `--overwrite` option.",
|
||||
uf.raw_filename,
|
||||
" You may start server with `--overwrite` option."
|
||||
% uf.raw_filename,
|
||||
)
|
||||
|
||||
core.store(packages.root, uf.raw_filename, uf.save)
|
||||
|
Loading…
Reference in New Issue
Block a user