From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id t+N8LDGB1WJxqhUAWB0awg (envelope-from ) for ; Mon, 18 Jul 2022 11:50:09 -0400 Received: by simark.ca (Postfix, from userid 112) id A77761E5EA; Mon, 18 Jul 2022 11:50:09 -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=WPWeiJMa; 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=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham 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 58AB01E222 for ; Mon, 18 Jul 2022 11:50:09 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 040073858438 for ; Mon, 18 Jul 2022 15:50:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 040073858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1658159408; bh=1R16hSRa2Wr/tshvqSPysg4Dfxm+mpw4eH31cXoZ0i4=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=WPWeiJMafr5FsyZrg9YRyd8aqBwPfDaVgRbu5B81TWw/p6ITPte0Agq7PSJr9LH8K PSgAOAGtuJVgOimEFKWz5q9cJyu3t6ZvsIfnYZlWA/w2uZ5ALpBS9tRa38C7mxRf1v Hw6IJfzhCfqewLQEJRpWAKaHjdFyjJXwPNNgAJA0= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 245893858D28 for ; Mon, 18 Jul 2022 15:49:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 245893858D28 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A0C6D1E222; Mon, 18 Jul 2022 11:49:48 -0400 (EDT) Message-ID: <5013d7ce-5e1e-ade9-d41f-32a15e1a5de8@simark.ca> Date: Mon, 18 Jul 2022 11:49:48 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v3] Handle Python 3.11 deprecation of PySys_SetPath and Py_SetProgramName Content-Language: en-US To: Kevin Buettner , gdb-patches@sourceware.org References: <20220715215814.246906-1-kevinb@redhat.com> In-Reply-To: <20220715215814.246906-1-kevinb@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > @@ -1849,6 +1855,24 @@ show_python_dont_write_bytecode (struct ui_file *file, int from_tty, > value); > } > > +/* Return value to assign to PyConfig.write_bytecode or, when > + negated (via !), Py_DontWriteBytecodeFlag. Py_DontWriteBytecodeFlag > + is deprecated in Python 3.12. */ > + > +static int > +python_write_bytecode () > +{ > + int wbc = 0; > + > + if (python_dont_write_bytecode == AUTO_BOOLEAN_AUTO) > + wbc = (!python_ignore_environment > + && getenv ("PYTHONDONTWRITEBYTECODE") != nullptr) ? 0 : 1; I think it predates your patch (so, orthogonal), but the Python doc says: If this is set to a non-empty string, Python won’t try to write .pyc files on the import of source modules. So I think we would need a "non-empty string" check here? Simon