[PATCH v2] set/show python dont-write-bytecode fixes

Eli Zaretskii eliz@gnu.org
Sun Jul 24 05:40:39 GMT 2022


> From: Kevin Buettner <kevinb@redhat.com>
> Cc: Kevin Buettner <kevinb@redhat.com>,
> 	Simon Marchi <simark@simark.ca>,
> 	Eli Zaretskii <eliz@gnu.org>,
> 	Pedro Alves <pedro@palves.net>
> 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.


More information about the Gdb-patches mailing list