The following issues were found
test/mitmproxy/data/addonscripts/load_error.py
2 issues
Line: 1
Column: 1
def load(_):
raise ValueError()
Reported by Pylint.
Line: 1
Column: 1
def load(_):
raise ValueError()
Reported by Pylint.
examples/addons/shutdown.py
2 issues
Line: 11
Column: 1
and then send a HTTP request to trigger the shutdown:
curl --proxy localhost:8080 http://example.com/path
"""
from mitmproxy import ctx, http
def request(flow: http.HTTPFlow) -> None:
# a random condition to make this example a bit more interactive
if flow.request.pretty_url == "http://example.com/path":
Reported by Pylint.
Line: 14
Column: 1
from mitmproxy import ctx, http
def request(flow: http.HTTPFlow) -> None:
# a random condition to make this example a bit more interactive
if flow.request.pretty_url == "http://example.com/path":
ctx.log.info("Shutting down everything...")
ctx.master.shutdown()
Reported by Pylint.
test/mitmproxy/data/addonscripts/tcp_stream_modify.py
2 issues
Line: 1
Column: 1
def tcp_message(flow):
message = flow.messages[-1]
if not message.from_client:
message.content = message.content.replace(b"foo", b"bar")
Reported by Pylint.
Line: 1
Column: 1
def tcp_message(flow):
message = flow.messages[-1]
if not message.from_client:
message.content = message.content.replace(b"foo", b"bar")
Reported by Pylint.
test/mitmproxy/data/addonscripts/same_filename/addon.py
2 issues
Line: 1
Column: 1
foo = 42
Reported by Pylint.
Line: 1
Column: 1
foo = 42
Reported by Pylint.
release/hooks/hook-mitmproxy.addons.onboardingapp.py
2 issues
Line: 1
Column: 1
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('mitmproxy.addons.onboardingapp')
Reported by Pylint.
Line: 1
Column: 1
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('mitmproxy.addons.onboardingapp')
Reported by Pylint.
test/helper_tools/loggrep.py
2 issues
Line: 1
Column: 1
#!/usr/bin/env python3
import fileinput
import sys
import re
if __name__ == "__main__":
if len(sys.argv) < 3:
print(f"Usage: {sys.argv[0]} port filenames")
sys.exit()
Reported by Pylint.
Line: 12
Column: 5
sys.exit()
port = sys.argv[1]
matches = False
for line in fileinput.input(sys.argv[2:]):
if re.match(r"^\[|(\d+\.){3}", line):
matches = port in line
if matches:
print(line, end="")
Reported by Pylint.
release/hooks/hook-mitmproxy.py
2 issues
Line: 1
Column: 1
hiddenimports = ["mitmproxy.script"]
Reported by Pylint.
Line: 1
Column: 1
hiddenimports = ["mitmproxy.script"]
Reported by Pylint.
release/hooks/hook-mitmproxy.tools.web.py
2 issues
Line: 1
Column: 1
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('mitmproxy.tools.web')
Reported by Pylint.
Line: 1
Column: 1
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('mitmproxy.tools.web')
Reported by Pylint.
mitmproxy/io/__init__.py
2 issues
Line: 1
Column: 1
from .io import FlowWriter, FlowReader, FilteredFlowWriter, read_flows_from_paths
__all__ = [
"FlowWriter", "FlowReader", "FilteredFlowWriter", "read_flows_from_paths"
]
Reported by Pylint.
Line: 1
Column: 1
from .io import FlowWriter, FlowReader, FilteredFlowWriter, read_flows_from_paths
__all__ = [
"FlowWriter", "FlowReader", "FilteredFlowWriter", "read_flows_from_paths"
]
Reported by Pylint.
mitmproxy/net/check.py
2 issues
Line: 1
Column: 1
import ipaddress
import re
# Allow underscore in host name
# Note: This could be a DNS label, a hostname, a FQDN, or an IP
from typing import AnyStr
_label_valid = re.compile(br"[A-Z\d\-_]{1,63}$", re.IGNORECASE)
Reported by Pylint.
Line: 42
Column: 1
return False
def is_valid_port(port: int) -> bool:
return 0 <= port <= 65535
Reported by Pylint.