From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id BA01E385841F for ; Sun, 24 Jul 2022 05:40:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BA01E385841F Received: from fencepost.gnu.org ([2001:470:142:3::e]:52982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFUM4-0003G0-Ke; Sun, 24 Jul 2022 01:40:40 -0400 Received: from [87.69.77.57] (port=2149 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFUM3-0006X1-EU; Sun, 24 Jul 2022 01:40:40 -0400 Date: Sun, 24 Jul 2022 08:40:39 +0300 Message-Id: <83ilnngjag.fsf@gnu.org> From: Eli Zaretskii To: Kevin Buettner Cc: gdb-patches@sourceware.org, simark@simark.ca, pedro@palves.net In-Reply-To: <20220723212324.1028060-1-kevinb@redhat.com> (message from Kevin Buettner on Sat, 23 Jul 2022 14:23:25 -0700) Subject: Re: [PATCH v2] set/show python dont-write-bytecode fixes References: <20220723212324.1028060-1-kevinb@redhat.com> X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2022 05:40:42 -0000 > From: Kevin Buettner > Cc: Kevin Buettner , > Simon Marchi , > Eli Zaretskii , > Pedro Alves > Date: Sat, 23 Jul 2022 14:23:25 -0700 > > GDB uses the environment variable PYTHONDONTWRITEBYTECODE to > determine whether or not to write the result of byte-compiling > python modules when the "python dont-write-bytecode" setting > is "auto". Simon noticed that GDB's implementation doesn't > follow the Python documentation. > > At present, GDB only checks for the existence of this environment > variable. That is not sufficient though. Regarding > PYTHONDONTWRITEBYTECODE, this document... > > https://docs.python.org/3/using/cmdline.html > > ...says: > > If this is set to a non-empty string, Python won't try to write > .pyc files on the import of source modules. > > This commit fixes GDB's handling of PYTHONDONTWRITEBYTECODE by adding > an empty string check. > > This commit also corrects the set/show command documentation for > "python dont-write-bytecode". The current doc was just a copy > of that for set/show python ignore-environment. > > During his review of an earlier version of this patch, Eli Zaretskii > asked that the help text that I proposed for "set/show python > dont-write-bytecode" be expanded. I've done that in addition to > clarifying the documentation of this option in the GDB manual. > --- > gdb/doc/python.texi | 11 ++++++++--- > gdb/python/python.c | 32 +++++++++++++++++++++++++------- > 2 files changed, 33 insertions(+), 10 deletions(-) Thanks, the documentation parts are fine in this version.