Internal Error - utf8 value in request - wsgi-python(django)

Hi there,
at the moment I use Litespeed 5.4.11 - Cpanel v92.0.6 - Cloudlinux 7.9.
I deployed a Django project with Cloudlinux Python App interface and its work like a charm, except during handling utf8 requests
for example when I make a request like :تست
i face with this error:

Internal Error
The server encountered an unexpected condition which prevented it from fulfilling the request.

and raised this error at app level log:

2021-02-19 13:55:59.137486 [ERROR] [UID:2001][6653] wsgiAppHandler pApp->start_response() return NULL.
Traceback (most recent call last):
  File "/home1/user/virtualenv/name/3.8/lib/python3.8/site-packages/django/core/handlers/", line 130, in __call__
  File "/home1/user/virtualenv/name/3.8/lib/python3.8/site-packages/django/core/handlers/", line 175, in get_script_name
    script_url = get_bytes_from_wsgi(environ, 'SCRIPT_URL', '') or get_bytes_from_wsgi(environ, 'REDIRECT_URL', '')
  File "/home1/user/virtualenv/name/3.8/lib/python3.8/site-packages/django/core/handlers/", line 200, in get_bytes_from_wsgi
    return value.encode('iso-8859-1')
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 6-13: ordinal not in range(256)
but there is not any error log at the webserver level.
when I switch the webserver to Apache, the problem will be solved
I think it's relevant with Python Bug that fixed at LSWS 5.4.3 release:

BUGFIX Fixed a problem with utf-8 characters in request URLs for Python applications.
sorry for my bad English <3


LiteSpeed Staff

Thanks for the bug report.
Looks it need some update to the lswsgi binary to apply correct encoding. Please try the following commands
tar xvfz wsgi-lsapi-1.9.tgz
cd wsgi-lsapi-1.9
sed -i -e "s#/opt/rh/devtoolset-7/root/usr/bin/##" Makefile
make 1>/dev/null 2>&1
cp lswsgi /opt/alt/python38/bin/
see if it fixes the problem or not.