Patchwork D7283: mail: suppress a pytype error that's just experimentally wrong

login
register
mail settings
Submitter phabricator
Date Nov. 8, 2019, 4:48 p.m.
Message ID <9fea8069fb7ad3480000e2b121690ab0@localhost.localdomain>
Download mbox | patch
Permalink /patch/42970/
State Not Applicable
Headers show

Comments

phabricator - Nov. 8, 2019, 4:48 p.m.
Closed by commit rHG3b31ee5388f3: mail: suppress a pytype error that&#039;s just experimentally wrong (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7283?vs=17653&id=17788

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7283/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7283

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -279,7 +279,9 @@ 
     '''Return MIME message.
     Quoted-printable transfer encoding will be used if necessary.
     '''
-    cs = email.charset.Charset(charset)
+    # Experimentally charset is okay as a bytes even if the type
+    # stubs disagree.
+    cs = email.charset.Charset(charset)  # pytype: disable=wrong-arg-types
     msg = email.message.Message()
     msg.set_type(pycompat.sysstr(b'text/' + subtype))