From 4d13e71df53f2db6970c17339e1035af35deae15 Mon Sep 17 00:00:00 2001 From: Paolo Gatti Date: Wed, 6 Nov 2024 11:51:45 +0100 Subject: [PATCH] [IMP] base: "--shell-file" option override for $PYTHONSTARTUP The $PYTHONSTARTUP env variable can contain a python script that is used by Python shell at the start of any interactive session. fix this feature from being broken in python and ptpython include a new --shell-file= shell parameter to override the env variable $PYTHONSTARTUP group the two shell parameters in a new options group remove custom python shells' banners from the start of the session Python docs: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP Community PR: odoo/odoo#185075 task-4306704 --- content/developer/reference/cli.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/content/developer/reference/cli.rst b/content/developer/reference/cli.rst index c56b5aa2b0..597ccb31b5 100644 --- a/content/developer/reference/cli.rst +++ b/content/developer/reference/cli.rst @@ -695,6 +695,11 @@ interaction with the :ref:`orm ` and its functionalities. By default, the shell is running in transaction mode. This means that any change made to the database is rolled back when exiting the shell. To commit changes, use `env.cr.commit()`. + +.. option:: --shell-file + Specify a python script to be run after the start of the shell. + Overrides the environment variable PYTHONSTARTUP. + .. option:: --shell-interface (ipython|ptpython|bpython|python) Specify a preferred REPL to use in shell mode. This shell is started with the `env` variable