From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MIJIBYpo3GInUBkAWB0awg (envelope-from ) for ; Sat, 23 Jul 2022 17:30:50 -0400 Received: by simark.ca (Postfix, from userid 112) id 112671E5EA; Sat, 23 Jul 2022 17:30:50 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=sHU2D8NO; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A0F451E222 for ; Sat, 23 Jul 2022 17:30:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 34EA23857C4A for ; Sat, 23 Jul 2022 21:30:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34EA23857C4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1658611849; bh=y6y0nrig6Az0/Aa8GTGdsLUvuU2W8mPgM4jHaEutKyA=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=sHU2D8NOSLb7SUmA/+PllzItI1H0e8KLJ/OpHEOeT/wt8GZ4QTY6DRPhi4I6ovfku ltezdF7ACkY4Ln1mxXnc5TBwa34KB5Nx7WMvN10xFDfrcoTNNf66zx72fg5sn/03Ec 9HHmWLJHhaNk+TusH9jczNqApHB/TssJPUrD8zXU= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id B5AC23858C39 for ; Sat, 23 Jul 2022 21:30:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B5AC23858C39 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-237-PcjWouvqPha6Hq6PaSVl_g-1; Sat, 23 Jul 2022 17:30:28 -0400 X-MC-Unique: PcjWouvqPha6Hq6PaSVl_g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7C848032FB; Sat, 23 Jul 2022 21:30:27 +0000 (UTC) Received: from f35-zws-1 (unknown [10.2.16.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 36F15404C6E8; Sat, 23 Jul 2022 21:30:27 +0000 (UTC) Date: Sat, 23 Jul 2022 14:30:25 -0700 To: Eli Zaretskii Subject: Re: [PATCH] set/show python dont-write-bytecode fixes Message-ID: <20220723143025.6fe4b0cd@f35-zws-1> In-Reply-To: <83y1wkiaja.fsf@gnu.org> References: <20220720191447.1014407-1-kevinb@redhat.com> <96a7e665-5700-349c-dfc5-50e59ab78fa5@palves.net> <20220721160832.3a1d4b3c@f35-zws-1> <83v8rplkfs.fsf@gnu.org> <20220722183722.57d34c34@f35-zws-1> <83y1wkiaja.fsf@gnu.org> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: , From: Kevin Buettner via Gdb-patches Reply-To: Kevin Buettner Cc: simark@simark.ca, pedro@palves.net, gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On Sat, 23 Jul 2022 09:54:33 +0300 Eli Zaretskii wrote: > > Date: Fri, 22 Jul 2022 18:37:22 -0700 > > From: Kevin Buettner > > > > My understanding of things is that in order to effectively use 'set > > python dont-write-bytecode', it must be placed in an early > > initialization file, i.e. those run via the --early-init-eval-command > > or -eix options. If the command were placed in some other > > initialization file, it might well be run before the embedded Python > > interpreter is run for the first time, yet still not take effect due > > to the command being executed after Python initialization. > > > > Another way to make sure that the command takes effect is to > > use one of the following options on the GDB command line: > > > > --early-init-eval-command 'set python dont-write-bytecode on' > > > > or: > > > > -eiex 'set python dont-write-bytecode on' > > Maybe we should say in the doc string that these are the only ways of > changing this setting so it has effect? Done. > > > Finally should we mention the PYTHONDONTWRITEBYTECODE environment > > > variable? > > > > It is already documented in the GDB manual. Should it also be > > mentioned in the help text? > > That was my question. > > > Another fly in the ointment is that the 'python ignore-environment' > > setting also affects how dont-write-bytecode behaves when it's set to > > 'auto'. If ignore-environment is 'on', then PYTHONDONTWRITEBYTECODE > > is ignored. > > > > This seems like a lot of detail to place in the help text. > > Maybe we should try saying all that, and then decide whether the > resulting text is too long? Done, though hopefully in a concise manner. > > I just noticed that, regarding the "auto" setting, the GDB manual says > > "... in this mode Python will check the environment variable > > PYTHONDONTWRITEBYTECODE to see if it should write out byte-code or > > not." What it doesn't say is what settings the environment variable > > must have in order to cause byte-code compilation to be suppressed. > > It turns out that any value other than non-existence or the > > empty string will enable the supression of byte-code compilation. > > I.e. using "PYTHONDONTWRITEBYTECODE=no" might not do what the user > > expects. So, it seems to me that we might update the manual to > > make this clear. (I can include that in the v2 patch if you agree.) > > I agree. Thanks. I've made some changes to the GDB manual too. These changes, including the ones you asked for in your earlier email, are in the v2 patch. See: https://sourceware.org/pipermail/gdb-patches/2022-July/191030.html Kevin