UnicodeDecodeError in python3 module with binary input

Hermann.Lauer at uni-heidelberg.de Hermann.Lauer at uni-heidelberg.de
Wed Dec 6 09:14:52 UTC 2023


Dear All,

while using the python3 module with 3.2.1 I got the following errors:

mod_populate_vptuple:402, vp->da->name: User-Password
python_error_log:209, Exception type: <class 'UnicodeDecodeError'>, Exception value: 'utf-8' codec can't decode byte 0xb3 in position 0: invalid start byte
do_python_single:496, authorize - mod_populate_vps failed
do_python_single:675, authorize - RLM_MODULE_FAIL

The cause is a switch whichs software mangles the User-Password to binary garbage.

Is this handling of binary values in the python module favorable? To my feeling it would be
cleaner to convert to bytes (instead of a string). Then python can handle binary data well.

Or make the conversion using replacement character/ignoring encoding errors.

The switch will be fixed, so this is only a design question.

Thanks for all your great work,
greetings
  Hermann

-- 
Administration/Zentrale Dienste, Interdiziplinaeres 
Zentrum fuer wissenschaftliches Rechnen der Universitaet Heidelberg
IWR; INF 205; 69120 Heidelberg; Tel: (06221)54-14405 Fax: -14427
Email: Hermann.Lauer at iwr.uni-heidelberg.de


More information about the Freeradius-Users mailing list