Skip to content

Commit 75e0a14

Browse files
authored
Add files via upload
1 parent ba2d7ab commit 75e0a14

8 files changed

Lines changed: 56 additions & 8 deletions

PyWWW/pywwwget_chatgpt.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,13 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__, ht
18141814
httpversionout = httpversionout.decode("ascii", errors="replace")
18151815
httpmethodout = httpmethod
18161816
httpurlout = str(rebuilt_url)
1817-
httpheaderout = r.headers
1817+
httpheaderout = {
1818+
k.decode("ascii", errors="replace")
1819+
if isinstance(k, (bytes, bytearray)) else str(k):
1820+
v.decode("ascii", errors="replace")
1821+
if isinstance(v, (bytes, bytearray)) else str(v)
1822+
for k, v in r.headers.items()
1823+
}
18181824
httpheadersentout = headers
18191825

18201826
# Mechanize

PyWWW/pywwwget_deepseek.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,13 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__, ht
20142014
httpversionout = httpversionout.decode("ascii", errors="replace")
20152015
httpmethodout = httpmethod
20162016
httpurlout = str(rebuilt_url)
2017-
httpheaderout = r.headers
2017+
httpheaderout = {
2018+
k.decode("ascii", errors="replace")
2019+
if isinstance(k, (bytes, bytearray)) else str(k):
2020+
v.decode("ascii", errors="replace")
2021+
if isinstance(v, (bytes, bytearray)) else str(v)
2022+
for k, v in r.headers.items()
2023+
}
20182024
httpheadersentout = headers
20192025

20202026
# Mechanize

PyWWW/pywwwget_merged.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,13 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__, ht
18491849
httpversionout = httpversionout.decode("ascii", errors="replace")
18501850
httpmethodout = httpmethod
18511851
httpurlout = str(rebuilt_url)
1852-
httpheaderout = r.headers
1852+
httpheaderout = {
1853+
k.decode("ascii", errors="replace")
1854+
if isinstance(k, (bytes, bytearray)) else str(k):
1855+
v.decode("ascii", errors="replace")
1856+
if isinstance(v, (bytes, bytearray)) else str(v)
1857+
for k, v in r.headers.items()
1858+
}
18531859
httpheadersentout = headers
18541860

18551861
# Mechanize

PyWWW/pywwwget_nextver.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,13 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__, ht
17941794
httpversionout = r.http_version
17951795
httpmethodout = httpmethod
17961796
httpurlout = str(r.url)
1797-
httpheaderout = r.headers
1797+
httpheaderout = {
1798+
k.decode("ascii", errors="replace")
1799+
if isinstance(k, (bytes, bytearray)) else str(k):
1800+
v.decode("ascii", errors="replace")
1801+
if isinstance(v, (bytes, bytearray)) else str(v)
1802+
for k, v in r.headers.items()
1803+
}
17981804
httpheadersentout = r.request.headers
17991805

18001806

pywwwget_chatgpt.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,13 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__, ht
18141814
httpversionout = httpversionout.decode("ascii", errors="replace")
18151815
httpmethodout = httpmethod
18161816
httpurlout = str(rebuilt_url)
1817-
httpheaderout = r.headers
1817+
httpheaderout = {
1818+
k.decode("ascii", errors="replace")
1819+
if isinstance(k, (bytes, bytearray)) else str(k):
1820+
v.decode("ascii", errors="replace")
1821+
if isinstance(v, (bytes, bytearray)) else str(v)
1822+
for k, v in r.headers.items()
1823+
}
18181824
httpheadersentout = headers
18191825

18201826
# Mechanize

pywwwget_deepseek.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,13 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__, ht
20142014
httpversionout = httpversionout.decode("ascii", errors="replace")
20152015
httpmethodout = httpmethod
20162016
httpurlout = str(rebuilt_url)
2017-
httpheaderout = r.headers
2017+
httpheaderout = {
2018+
k.decode("ascii", errors="replace")
2019+
if isinstance(k, (bytes, bytearray)) else str(k):
2020+
v.decode("ascii", errors="replace")
2021+
if isinstance(v, (bytes, bytearray)) else str(v)
2022+
for k, v in r.headers.items()
2023+
}
20182024
httpheadersentout = headers
20192025

20202026
# Mechanize

pywwwget_merged.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,13 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__, ht
18491849
httpversionout = httpversionout.decode("ascii", errors="replace")
18501850
httpmethodout = httpmethod
18511851
httpurlout = str(rebuilt_url)
1852-
httpheaderout = r.headers
1852+
httpheaderout = {
1853+
k.decode("ascii", errors="replace")
1854+
if isinstance(k, (bytes, bytearray)) else str(k):
1855+
v.decode("ascii", errors="replace")
1856+
if isinstance(v, (bytes, bytearray)) else str(v)
1857+
for k, v in r.headers.items()
1858+
}
18531859
httpheadersentout = headers
18541860

18551861
# Mechanize

pywwwget_nextver.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,13 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__, ht
17941794
httpversionout = r.http_version
17951795
httpmethodout = httpmethod
17961796
httpurlout = str(r.url)
1797-
httpheaderout = r.headers
1797+
httpheaderout = {
1798+
k.decode("ascii", errors="replace")
1799+
if isinstance(k, (bytes, bytearray)) else str(k):
1800+
v.decode("ascii", errors="replace")
1801+
if isinstance(v, (bytes, bytearray)) else str(v)
1802+
for k, v in r.headers.items()
1803+
}
17981804
httpheadersentout = r.request.headers
17991805

18001806

0 commit comments

Comments
 (0)