Package: python3-doc
Version: 3.11.8-1
Severity: minor
Dear Maintainer,
The documentation for curses.wrapper says:
Initialize curses and call another callable object, func, which
should be the rest of your curses-using application. If the
application raises an exception, this function will restore the
terminal to a sane state before re-raising the exception and
generating a traceback. The callable object func is then passed the
main window ‘stdscr’ as its first argument, followed by any other
arguments passed to wrapper(). Before calling func, wrapper() turns
on cbreak mode, turns off echo, enables the terminal keypad, and
initializes colors if the terminal has color support. On exit
(whether normally or by exception) it restores cooked mode, turns on
echo, and disables the terminal keypad.
I see several minor problems with this.
1) It doesn't say anything about what's returned on success. The code
has the line 'return func(…)', as expected of a wrapper, which is to
say that it will return whatever the wrapped function returns.
2) There's no code to "generat[e] a traceback". I guess the assumption
is that the re-raised assumption will not be caught, and Python will
do that; but using curses.wrapper that way is merely a suggestion
("func[…] should be the rest"…).
3) It says "re-raising the exception and generating a traceback. The
callable object func is then passed the main window". Despite saying
"then", this is not a linear sequence of events that can happen.
4) "On exit" is unclear about whether it's talking about function exit
or program exit.
- Michael
-- System Information:
Debian Release: trixie/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 6.8.12-amd64 (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-doc depends on:
ii python3.11-doc 3.11.9-1
python3-doc recommends no packages.
Versions of packages python3-doc suggests:
ii python3 3.11.8-1
pn python3-examples <none>
-- no debconf information
Acknowledgement sent
to Chris Hofstaedtler <[email protected]>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <[email protected]>.
(Sun, 23 Jun 2024 13:21:02 GMT) (full text, mbox, link).
Subject: Re: Bug#1074078: python3-doc: curses.wrapper() - unclear about
return value and other details
Date: Sun, 23 Jun 2024 15:19:22 +0200
On Sat, Jun 22, 2024 at 10:42:35PM +0000, Michael Gold wrote:
> Dear Maintainer,
[not speaking for the maintainer]
> The documentation for curses.wrapper says:
> [..]
If you want to see this fixed sooner than later, I'd suggest filing
this report upstream.
Acknowledgement sent
to Michael Gold <[email protected]>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <[email protected]>.
(Sun, 23 Jun 2024 16:39:05 GMT) (full text, mbox, link).
On Sun, Jun 23, 2024 at 15:19:22 +0200, Chris Hofstaedtler wrote:
> If you want to see this fixed sooner than later, I'd suggest filing
> this report upstream.
Thanks, but there doesn't seem to be any way to do this without signing
up for a Github account. The Python documentation mentions e-mailing
[email protected] as an alternate method, but that doesn't get "filed" in
the same sense, and I didn't get a response when I tried it in February.
-- Michael
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.