[Tests] Escape backslashes in filename in webserver test

This commit is contained in:
Chase Sterling 2022-01-26 00:29:46 -05:00 committed by Calum Lind
parent 23f7c4dd6e
commit 4497c9bbcc
No known key found for this signature in database
GPG Key ID: 90597A687B836BA3
1 changed files with 2 additions and 1 deletions

View File

@ -34,7 +34,8 @@ class WebServerTestCase(WebServerTestBase, WebServerMockBase):
# UnicodeDecodeError: 'utf8' codec can't decode byte 0xe5 in position 0: invalid continuation byte
filename = get_test_data_file('filehash_field.torrent')
input_file = (
'{"params": ["%s"], "method": "web.get_torrent_info", "id": 22}' % filename
'{"params": ["%s"], "method": "web.get_torrent_info", "id": 22}'
% filename.replace('\\', '\\\\')
)
headers = {
b'User-Agent': ['Twisted Web Client Example'],