Skip to content

[2.7] bpo-8765: Deprecate writing unicode to binary streams in Py3k mode. #11127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Dec 12, 2018

@benjaminp
Copy link
Contributor

I wonder if t might be cheaper to check Py_TYPE(PyTuple_GET_ITEM(args, 0)) after doing the initial parsing?

@serhiy-storchaka
Copy link
Member Author

Good point!

@@ -101,6 +101,10 @@ def test_none_args(self):
self.assertEqual(self.f.readline(None), b"hi\n")
self.assertEqual(self.f.readlines(None), [b"bye\n", b"abc"])

def testWriteUnicode(self):
with check_py3k_warnings():
self.f.write('')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this file is using unicode_literals, it wouldn't hurt to write u"" here.

@serhiy-storchaka serhiy-storchaka merged commit 1462234 into python:2.7 Jan 15, 2019
@serhiy-storchaka serhiy-storchaka deleted the fileio-write-unicode-2.7 branch January 15, 2019 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants