Python3

Alan DeKok aland at deployingradius.com
Fri Nov 22 12:46:26 UTC 2024


On Nov 22, 2024, at 1:28 AM, Mullen, Daniel J via Freeradius-Users <freeradius-users at lists.freeradius.org> wrote:
> With FR 3.0.x and Python2, the python module didn't automatically register any system libraries.
> 
> In 3.2.6 with Python 3.9 (on RHEL9) the python3 module seems to automatically add the sys.path
> And at the front of the path.
> These first for are nowhere in my configuration but at runtime, that’s what the app reports as the path.
> 
> /usr/lib64/python39.zip
> /usr/lib64/python3.9/lib-dynload
> /usr/lib64/python3.9/site-packages
> /usr/lib/python3.9/site-packages
> # our code
> /etc/raddb/mods-config/python3
> # application specific packages
> /etc/raddb/lib/python3.9/site-packages
> 
> And indeed, FR is using the packages out the the /usr/lig64
> 
> Is there a way to force the old behavior?
> Namely that only the paths declared in python_path are included and in the order specified.

  Hmm... it looks like the python_path is used only if an undocumented "cext_compat = no" flag is set.

  I don't know enough about the python3 module to say more, tho.  But the source code is available, and you can walk through it to see when it sets python_path.

  Alan DeKok.



More information about the Freeradius-Users mailing list