FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-156347: Fix the documentation of curses `window.encoding` by fedonman · Pull Request #156352 · python/cpython · GitHub

/ cpython Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 1 addition & 2 deletions Doc/howto/curses.rst
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
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ the next subsection.
The :meth:`~curses.window.addstr` method takes a Python string or
bytestring as the value to be displayed. The contents of bytestrings
are sent to the terminal as-is. Strings are encoded to bytes using
the value of the window's :attr:`~window.encoding` attribute; this defaults to
the default system encoding as returned by :func:`locale.getencoding`.
the encoding of the current locale (see :func:`locale.getencoding`).

The :meth:`~curses.window.addch` methods take a character, which can be
either a string of length 1, a bytestring of length 1, or an integer.
Expand Down
6 changes: 5 additions & 1 deletion Doc/library/curses.rst
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
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,11 @@ Other

.. attribute:: window.encoding

Encoding used to encode method arguments (Unicode strings and characters).
Encoding used to encode and decode method arguments and results
(Unicode strings and characters) on a narrow build. It is not used on a
build linked against a wide-character version of the underlying curses
library, where strings are passed to curses as wide characters and the
encoding of the current locale determines the bytes.
The encoding attribute is inherited from the parent window when a subwindow
is created, for example with :meth:`window.subwin`.
By default, current locale encoding is used (see :func:`locale.getencoding`).
Expand Down
Loading

Back | FazBrowse Home | New Git URL