Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org>
To: Simon Marchi <simark@simark.ca>
Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v3] Handle Python 3.11 deprecation of PySys_SetPath and Py_SetProgramName
Date: Wed, 20 Jul 2022 12:19:54 -0700	[thread overview]
Message-ID: <20220720121954.5997f802@f35-zws-1> (raw)
In-Reply-To: <5013d7ce-5e1e-ade9-d41f-32a15e1a5de8@simark.ca>

On Mon, 18 Jul 2022 11:49:48 -0400
Simon Marchi <simark@simark.ca> wrote:

> > @@ -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?

I agree.

I've pushed the v3 deprecation patch and have posted a new/separate
patch which fixes the problem you spotted.  It also fixes the set/show
python dont-write-bytecode command documentation.

See:

https://sourceware.org/pipermail/gdb-patches/2022-July/190912.html

Kevin


      reply	other threads:[~2022-07-20 19:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 21:58 Kevin Buettner via Gdb-patches
2022-07-18 15:28 ` Tom Tromey
2022-07-18 15:49 ` Simon Marchi via Gdb-patches
2022-07-20 19:19   ` Kevin Buettner via Gdb-patches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220720121954.5997f802@f35-zws-1 \
    --to=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=simark@simark.ca \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox