Skip to content
Myr

Adding header name to exception

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Adds the name of the header to the invalid header exception raised on TypeError.

authored by mgasvoda · committed by GitHub · parent 1c2022c · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:requests/utils.py+2 added-2 removed
866 unmodified lines
867 try:868 if not pat.match(value):869 raise InvalidHeader("Invalid return character or leading space in header: %s" % name)870 except TypeError:871 raise InvalidHeader("Header value %s must be of type str or bytes, "872 "not %s" % (value, type(value)))871 raise InvalidHeader("Header %s value %s must be of type str or bytes, "872 "not %s" % (name, value, type(value)))873874875def urldefragauth(url):876 """
28 unmodified lines