Merge pull request #5802 from jdufresne/write-text-bytes

Remove unnecessary bytes type check from path.write_text()
This commit is contained in:
Takeshi KOMIYA 2018-12-16 10:07:55 +09:00 committed by GitHub
commit 480015c531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,8 +152,6 @@ class path(text_type):
"""
Writes the given `text` to the file.
"""
if isinstance(text, bytes):
text = text.decode(encoding)
with open(self, 'w', encoding=encoding, **kwargs) as f:
f.write(text)