Debian Bug report logs - #1074078
python3-doc: curses.wrapper() - unclear about return value and other details

version graph

Package: python3-doc; Maintainer for python3-doc is Matthias Klose <[email protected]>; Source for python3-doc is src:python3-defaults (PTS, buildd, popcon).

Reported by: Michael Gold <[email protected]>

Date: Sat, 22 Jun 2024 22:45:02 UTC

Severity: minor

Found in version python3-defaults/3.11.8-1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Matthias Klose <[email protected]>:
Bug#1074078; Package python3-doc. (Sat, 22 Jun 2024 22:45:04 GMT) (full text, mbox, link).


Acknowledgement sent to Michael Gold <[email protected]>:
New Bug report received and forwarded. Copy sent to Matthias Klose <[email protected]>. (Sat, 22 Jun 2024 22:45:04 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Michael Gold <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: python3-doc: curses.wrapper() - unclear about return value and other details
Date: Sat, 22 Jun 2024 22:42:35 +0000
[Message part 1 (text/plain, inline)]
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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to [email protected], Matthias Klose <[email protected]>:
Bug#1074078; Package python3-doc. (Sun, 23 Jun 2024 13:21:02 GMT) (full text, mbox, link).


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).


Message #10 received at [email protected] (full text, mbox, reply):

From: Chris Hofstaedtler <[email protected]>
To: Michael Gold <[email protected]>, [email protected]
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.




Information forwarded to [email protected], Matthias Klose <[email protected]>:
Bug#1074078; Package python3-doc. (Sun, 23 Jun 2024 16:39:05 GMT) (full text, mbox, link).


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).


Message #15 received at [email protected] (full text, mbox, reply):

From: Michael Gold <[email protected]>
To: Chris Hofstaedtler <[email protected]>
Cc: [email protected]
Subject: Re: Bug#1074078: python3-doc: curses.wrapper() - unclear about return value and other details
Date: Sun, 23 Jun 2024 16:30:20 +0000
[Message part 1 (text/plain, inline)]
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
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 15:31:01 2025; Machine Name: bembo

Debian Bug tracking system

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/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.