alecthomas / voluptuous

CONTRIBUTIONS ONLY: Voluptuous, despite the name, is a Python data validation library.
https://pypi.org/project/voluptuous
BSD 3-Clause "New" or "Revised" License
1.82k stars 218 forks source link

Preserve Unicode strings when passed to utility functions #377

Closed svisser closed 5 years ago

svisser commented 5 years ago

First of all, best wishes for 2019.

This updates the string utility functions to return a Unicode string when a Unicode string is passed in. In Python 2 this would raise an error due to the use of str(v).

This is a change related to issue #374.

The tests also check for other types (int) to preserve existing functionality.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.07%) to 95.43% when pulling c8be8f18ee9a428a298dec2dc0416b5dbb001ca9 on svisser:fix/issue_374 into c2e1cfd3e1d01f07dfcc8b4ffeec3e06e04a4fa6 on alecthomas:master.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.02%) to 95.387% when pulling 2f8412a3d8cfd9ce8df5d46066415d8de2388949 on svisser:fix/issue_374 into 9644956fb57167bc2e91f47a34a1ee2b0b03072f on alecthomas:master.

alecthomas commented 5 years ago

One minor comment but overall LGTM 👍

alecthomas commented 5 years ago

Also, happy New Year!

svisser commented 5 years ago

That's fair, I have updated the commit - with the Python 2 check inlined as we hopefully won't need it anymore when Python 2 reaches end of life at the end of next year ;)