bpo-29755: Fixed the lgettext() family of functions in the gettext module. by serhiy-storchaka · Pull Request #2266 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation8 Commits4 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

serhiy-storchaka

They now always return bytes.

@serhiy-storchaka

…dule.

They now always return bytes.

@mention-bot

@warsaw

LGTM, and thanks for submitting this! Some thoughts:

warsaw

Choose a reason for hiding this comment

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

A couple of additional suggestions were given, but I know you'll DTRT and what you have is already good, so I'll approve it in advance.

@serhiy-storchaka

I'm interesting in your suggestions. In any case I'm going to rewrite the docs (group the l*() functions for avoiding duplications).

@warsaw

Grouping the l* methods sounds like a great idea. I'd probably just put a reST admonition at the top of that section. Draft text:

.. warning:
   These `l*()` methods should be avoided in Python 3, because they return encoded bytes.
   It's much better to use alternatives which return Unicode strings instead, since most Python
   applications will want to manipulate human readable text as strings instead of bytes.  Further,
   it's possible that you may get unexpected Unicode-related exceptions if there are encoding
   problems with the translated strings.  It is possible that the `l*()` methods will be deprecated
   in future Python versions due to their inherent problems and limitations.

@serhiy-storchaka

@serhiy-storchaka

Thank you for your review @warsaw. Please look at the updated documentation since I'm not sure about my English.

@serhiy-storchaka

@warsaw

@serhiy-storchaka

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request

Jun 20, 2017

@serhiy-storchaka

…ext module. (pythonGH-2266)

They now always return bytes.

Updated the gettext documentation.. (cherry picked from commit 26cb465)

@bedevere-bot

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request

Jun 20, 2017

@serhiy-storchaka

…ext module. (pythonGH-2266)

They now always return bytes.

Updated the gettext documentation. (cherry picked from commit 26cb465)

@bedevere-bot

serhiy-storchaka added a commit that referenced this pull request

Jun 20, 2017

@serhiy-storchaka

…ext module. (GH-2266) (#2297)

They now always return bytes.

Updated the gettext documentation.. (cherry picked from commit 26cb465)

serhiy-storchaka added a commit that referenced this pull request

Jun 20, 2017

@serhiy-storchaka

…ext module. (GH-2266) (#2298)

They now always return bytes.

Updated the gettext documentation. (cherry picked from commit 26cb465)

Labels

type-bug

An unexpected behavior, bug, or error