Skip to content

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

Merged
serhiy-storchaka merged 3 commits intopython:2.7from
serhiy-storchaka:fileio-write-unicode-2.7
Jan 15, 2019
Merged

[2.7] bpo-8765: Deprecate writing unicode to binary streams in Py3k mode.#11127
serhiy-storchaka merged 3 commits intopython:2.7from
serhiy-storchaka:fileio-write-unicode-2.7

Conversation

@serhiy-storchaka
Copy link
Copy Markdown
Member

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

@benjaminp
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Good point!


def testWriteUnicode(self):
with check_py3k_warnings():
self.f.write('')
Copy link
Copy Markdown
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