From 8c03f7bf8b2ef63eb1a7c6440d392680b77126b2 Mon Sep 17 00:00:00 2001 From: Matthew Hughes <34972397+matthewhughes934@users.noreply.github.com> Date: Mon, 13 Sep 2021 21:10:56 +0100 Subject: [PATCH] Fix warning in pytest (#4803) Escape backslashes in pydocs containing '\*' (markdown escape sequence). This removes the one warning I saw when running `pytest`: /mitmproxy/mitmproxy/http.py:97: DeprecationWarning: invalid escape sequence \* --- mitmproxy/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitmproxy/http.py b/mitmproxy/http.py index bc1f6c68a..8e82d6429 100644 --- a/mitmproxy/http.py +++ b/mitmproxy/http.py @@ -98,7 +98,7 @@ class Headers(multidict.MultiDict): # type: ignore *Args:* - *fields:* (optional) list of ``(name, value)`` header byte tuples, e.g. ``[(b"Host", b"example.com")]``. All names and values must be bytes. - - *\*\*headers:* Additional headers to set. Will overwrite existing values from `fields`. + - *\\*\\*headers:* Additional headers to set. Will overwrite existing values from `fields`. For convenience, underscores in header names will be transformed to dashes - this behaviour does not extend to other methods.