summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-09-10 20:45:34 +0900
committerGitHub <noreply@github.com>2018-09-10 20:45:34 +0900
commitd9c308a2996b8fb3197931b58fd60befd801dc4b (patch)
tree408e23e443f31cb259941e656bc4624ac1240e03
parent4e48019b902040e790f4283a6a5834e84f4ab267 (diff)
parent38709af87bbcd2cb62eab9e552be64552e570326 (diff)
downloadsphinx-git-d9c308a2996b8fb3197931b58fd60befd801dc4b.tar.gz
Merge pull request #5406 from jdufresne/bytes-type
Correct some unicode/str types to bytes
-rw-r--r--sphinx/locale/__init__.py2
-rw-r--r--sphinx/util/images.py4
2 files changed, 3 insertions, 3 deletions
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 '<svg' in h.decode('utf-8').lower():