File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -1835,10 +1835,7 @@ def test_upload_fails_with_existing_filename_diff_content(self,
1835
1835
pretend .call ('help' , _anchor = 'file-name-reuse' )
1836
1836
]
1837
1837
assert resp .status_code == 400
1838
- assert resp .status == (
1839
- "400 The filename or contents already exist. "
1840
- "See /the/help/url/"
1841
- )
1838
+ assert resp .status == "400 File already exists. See /the/help/url/"
1842
1839
1843
1840
def test_upload_fails_with_diff_filename_same_blake2 (self ,
1844
1841
pyramid_config ,
@@ -1897,10 +1894,7 @@ def test_upload_fails_with_diff_filename_same_blake2(self,
1897
1894
pretend .call ('help' , _anchor = 'file-name-reuse' )
1898
1895
]
1899
1896
assert resp .status_code == 400
1900
- assert resp .status == (
1901
- "400 The filename or contents already exist. "
1902
- "See /the/help/url/"
1903
- )
1897
+ assert resp .status == "400 File already exists. See /the/help/url/"
1904
1898
1905
1899
def test_upload_fails_with_wrong_filename (self , pyramid_config ,
1906
1900
db_request ):
Original file line number Diff line number Diff line change @@ -1097,11 +1097,16 @@ def file_upload(request):
1097
1097
return Response ()
1098
1098
elif is_duplicate is not None :
1099
1099
raise _exc_with_message (
1100
- HTTPBadRequest , "The filename or contents already exist. "
1101
- "See " +
1102
- request .route_url (
1103
- 'help' , _anchor = 'file-name-reuse'
1104
- )
1100
+ HTTPBadRequest ,
1101
+ # Note: Changing this error message to something that doesn't
1102
+ # start with "File already exists" will break the
1103
+ # --skip-existing functionality in twine
1104
+ # ref: https://github.com/pypa/warehouse/issues/3482
1105
+ # ref: https://github.com/pypa/twine/issues/332
1106
+ "File already exists. See " +
1107
+ request .route_url (
1108
+ 'help' , _anchor = 'file-name-reuse'
1109
+ )
1105
1110
)
1106
1111
1107
1112
# Check to see if the file that was uploaded exists in our filename log
You can’t perform that action at this time.
0 commit comments