diff --git a/sphinx/locale/__init__.py b/sphinx/locale/__init__.py index d5ca91488..5c2caea9b 100644 --- a/sphinx/locale/__init__.py +++ b/sphinx/locale/__init__.py @@ -65,7 +65,7 @@ class _TranslationProxy(UserString, object): # for the encoding result def encode(self, encoding=None, errors=None): # type: ignore - # type: (unicode, unicode) -> str + # type: (unicode, unicode) -> bytes if encoding: if errors: return self.data.encode(encoding, errors) diff --git a/sphinx/util/images.py b/sphinx/util/images.py index 9abe748e4..321768670 100644 --- a/sphinx/util/images.py +++ b/sphinx/util/images.py @@ -78,7 +78,7 @@ def guess_mimetype_for_stream(stream, default=None): def guess_mimetype(filename='', content=None, default=None): - # type: (unicode, unicode, unicode) -> unicode + # type: (unicode, bytes, unicode) -> unicode _, ext = path.splitext(filename.lower()) if ext in mime_suffixes: return mime_suffixes[ext] @@ -123,7 +123,7 @@ def parse_data_uri(uri): def test_svg(h, f): - # type: (unicode, IO) -> unicode + # type: (bytes, IO) -> unicode """An additional imghdr library helper; test the header is SVG's or not.""" try: if '