Commit 5b97fda3 authored by Yong Tang's avatar Yong Tang Committed by Rasmus Munk Larsen
Browse files

Fix unicode string conversion issue in Python 2 (#16168)



* Fix unicode string conversion issue in Python 2

This fix tries to address the issue raised in 16149 where
the unicode string conversion with Python 2 does not match
the behavior with Python 3.

The issue was that in Python 3, TensorFlow tries to
do a unicode conversion in UTF8 while in Python 2
the default conversion was used.

This fix addresses the issue so that behaviors of TensorFlow
with Python 2 and Python 3 match.

This fix fixes 16149.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Format py_func.cc with clang-foramt -i --style=Google

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Add test case for unicode string conversion issue in Python 2

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Update NULL -> `nullptr`

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
parent 7c53bc7f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment