File tree Expand file tree Collapse file tree 3 files changed +317
-259
lines changed Expand file tree Collapse file tree 3 files changed +317
-259
lines changed Original file line number Diff line number Diff line change @@ -1256,11 +1256,13 @@ def file_upload(request):
1256
1256
#
1257
1257
# [1] https://packaging.python.org/specifications/binary-distribution-format/
1258
1258
if not parsed_filename_parts [0 ] == project .normalized_name :
1259
+ escaped_normalized_project_name = project .normalized_name .replace ("-" , "_" )
1260
+ help_url = request .help_url (_anchor = "invalid-file-name" )
1259
1261
raise _exc_with_message (
1260
1262
HTTPBadRequest ,
1261
- "Invalid filename: Start filename for project {!r} with {!r}." . format (
1262
- project . name , project . normalized_name . replace ( "-" , "_" )
1263
- ) ,
1263
+ f "Invalid filename: Start filename for project { project . name !r} "
1264
+ f"with { escaped_normalized_project_name !r } . "
1265
+ f"See { help_url } for more information" ,
1264
1266
)
1265
1267
1266
1268
# Check the content type of what is being uploaded
You can’t perform that action at this time.
0 commit comments