$ make lint
poetry run pylint requests_har
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
$ make test
poetry run pytest
======================================================= test session starts ========================================================
platform darwin -- Python 3.11.6, pytest-7.4.4, pluggy-1.5.0
rootdir: /Users/jeff_hung/wc/NoteBrainer/requests_har
plugins: pylama-8.4.1
collected 1 item
tests/test_har.py . [100%]
======================================================== 1 passed in 0.15s =========================================================
Instead of the deprecated
cgi.parse_header()
, useemail.message.EmailMessage
to parseContent-Type
header and extract charset.The Problem
See PEP 594, the
cgi
module is deprecated since version 3.11 and will be removed in version 3.13.Thus creating the following lint error:
And test warning:
The mitigation, as suggested in
cgi.parse_header()
document, is to useemail.message.EmailMessage
instead.See also:
After Fix