Skip to content
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

bpo-41091: Remove recommendation in curses module documentation to initialize LC_ALL and encode strings #21159

Closed

Conversation

manueljacob
Copy link

@manueljacob manueljacob commented Jun 25, 2020

The recommendation to call locale.setlocale(locale.LC_ALL, '') is
problematic as it initializes all locale categories to the user
settings, which might be unintended and is not necessary for curses to
work correctly. Initializing LC_CTYPE is sufficient for nl_langinfo() to
return the correct encoding. Current versions of Python initialize
LC_CTYPE at interpreter startup. Therefore calling locale.setlocale()
should not be necessary at all.

The curses module automatically encodes strings. Therefore the
recommendation to manually encode strings is outdated.

https://bugs.python.org/issue41091

…itialize LC_ALL and encode strings

The recommendation to call `locale.setlocale(locale.LC_ALL, '')` is
problematic as it initializes all locale categories to the user
settings, which might be unintended and is not necessary for curses to
work correctly. Initializing LC_CTYPE is sufficient for nl_langinfo() to
return the correct encoding. Current versions of Python initialize
LC_CTYPE at interpreter startup. Therefore calling locale.setlocale()
should not be necessary at all.

The curses module automatically encodes strings. Therefore the
recommendation to manually encode strings is outdated.
@iritkatriel
Copy link
Member

This was removed in #91732.

@iritkatriel iritkatriel closed this Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge docs Documentation in the Doc dir needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants