Skip to content

Commit 4d13e71

Browse files
committed
[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=<filename> 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
1 parent 9368181 commit 4d13e71

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

content/developer/reference/cli.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,11 @@ interaction with the :ref:`orm <reference/orm>` and its functionalities.
695695
By default, the shell is running in transaction mode. This means that any change made to the
696696
database is rolled back when exiting the shell. To commit changes, use `env.cr.commit()`.
697697

698+
699+
.. option:: --shell-file <init_script.py>
700+
Specify a python script to be run after the start of the shell.
701+
Overrides the environment variable PYTHONSTARTUP.
702+
698703
.. option:: --shell-interface (ipython|ptpython|bpython|python)
699704

700705
Specify a preferred REPL to use in shell mode. This shell is started with the `env` variable

0 commit comments

Comments
 (0)