[issue43715] curses inch() and scrbkgd() documentation ommissions

2021-04-03 Thread Peter J. Farley III


New submission from Peter J. Farley III :

The documentation for the result values of curses functions inch() and 
scrbkgd() or how to use those result values are omitted entirely.  
Documentation should at least describe how to use the result values of these 
functions without necessarily describing the actual format of the results, 
which do differ depending on the implementation of curses being used.

A suggestion for the documentation change is attached.

A separate issue will be filed questioning the need to shift the pair number 
result of the curses.pair_number() function in the Windows terminal environment.

--
components: Extension Modules
files: curses-doc-change.txt
messages: 390136
nosy: pjfarleyiii
priority: normal
severity: normal
status: open
title: curses inch() and scrbkgd() documentation ommissions
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49930/curses-doc-change.txt

___
Python tracker 
<https://bugs.python.org/issue43715>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43716] curses.pair_number() function incorrect value under Windows

2021-04-03 Thread Peter J. Farley III


New submission from Peter J. Farley III :

curses.pair_number() result under Windows (console or Terminal window) value 
must be shifted by 16 bits to be valid to use as input to the 
curses.pair_content() function.

If the pair number result is not shifted, the call to curses.pair_content() 
fails with an overflow error:

Traceback (most recent call last):
  File "C:\Users\MyUser\test\curses-color.py", line 126, in 
curses.wrapper(main)
  File "C:\Python38\lib\curses\__init__.py", line 105, in wrapper
return func(stdscr, *args, **kwds)
  File "C:\Users\MyUser\test\curses-color.py", line 72, in main
fg, bg = curses.pair_content (pair)
OverflowError: signed short integer is greater than maximum

The attached curses program demonstrates the correct functioning using the pair 
value shift under Windows.  Comment out the "if" and shift lines to reproduce 
the overflow error.

Environment information:

Windows 10 (latest updates)
Windows cmd.exe window or Windows Terminal Version: 1.6.10571.0
Python 3.8.7
windows-curses 2.2.0

Also tested in:

Ubuntu 20.04 (WSL2)
ncurses6/focal,now 6.2-0ubuntu2 amd64

--
components: Extension Modules
files: curses-color-1.py
messages: 390137
nosy: pjfarleyiii
priority: normal
severity: normal
status: open
title: curses.pair_number() function incorrect value under Windows
versions: Python 3.8
Added file: https://bugs.python.org/file49931/curses-color-1.py

___
Python tracker 
<https://bugs.python.org/issue43716>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43716] curses.pair_number() function incorrect value under Windows

2021-04-09 Thread Peter J. Farley III


Peter J. Farley III  added the comment:

Thank you for responding.  I will pursue the issue with the windows-curses
and/or PDCurses team.

Peter

On Wed, Apr 7, 2021 at 12:57 PM Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka  added the comment:
>
> The curses module is not supported on Windows. windows-curses is a
> third-party library. Use the corresponding bug tracker to report an issue
> with windows-curses.
>
> --
>
>

--

___
Python tracker 
<https://bugs.python.org/issue43716>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43715] curses inch() and scrbkgd() documentation ommissions

2021-04-09 Thread Peter J. Farley III


Peter J. Farley III  added the comment:

Sorry, this was not meant as a patch.  I have no experience with git or
pulls and would not know where to start to do as you have asked.  The text
I provided was intended as model text for the python documentation
maintainer to type into whatever piece of python is used to describe those
two functions.

If I knew where to pull a source archive or zip and knew the place or
source member where that documentation is stored, I could generate a "diff
-u" style of patch, but that is the limit of my skill in that area.

Peter

On Thu, Apr 8, 2021 at 10:18 AM Mariatta  wrote:

>
> Mariatta  added the comment:
>
> Thanks for the patch, but I find it difficult to read in plain text. Can
> you create a pull request with the your suggested changes?
>
> --
> nosy: +Mariatta
>
> ___
> Python tracker 
> <https://bugs.python.org/issue43715>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue43715>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com