ich einen Apache-Server laufen lasse, die einen Rahmen ingeniousÜberschreibungs python3 Standard-Encoder, wenn Apache mit Server
Erste UnicodeDecodeError('ascii'
beim Lesen einer Datei mit hebräisch Zeichen genannt dient.
Ich habe gelesen, dass Sie die standardmäßige bevorzugte Kodierung von python3 mit Umgebungsvariablen ändern können.
SetEnv LC_ALL en_US.UTF-8
SetEnv LANG en_US.UTF-8
SetEnv LANGUAGE en_US.UTF-8
SetEnv PYTHONIOENCODING utf8
und starten Sie den Server mit sudo service httpd restart
und immer noch nicht funktioniert:
So habe ich die /etc/httpd/conf/httpd.conf
mit dem [setenv] [3] Verfahren bearbeitet.
Ich muss feststellen, dass die Software lokal arbeitet, wenn es nicht mit einem Apache-Server läuft, einfach python3.
locale.getpreferredencoding()
ist ANSI_X3.4-1968
nach dem Wechsel
hier ist der Inhalt der /etc/httpd/conf/httpd.conf
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin [email protected]
<Directory />
AllowOverride none
Require all denied
</Directory>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>
<IfModule mime_module>
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile On
# Supplemental configuration
LoadModule wsgi_module /usr/lib64/python3.5/site-packages/mod_wsgi/server/mod_wsgi-py35.cpython-35m-x86_64-linux-gnu.so
WSGIScriptAlias/"/usr/bin/inginious-webapp.production"
WSGIScriptReloading On
Alias /static/common /usr/lib/python3.5/site-packages/inginious/frontend/common/static/
Alias /static/webapp /usr/lib/python3.5/site-packages/inginious/frontend/webapp/static/
Alias /static/lti /usr/lib/python3.5/site-packages/inginious/frontend/lti/static/
SetEnv LC_ALL en_US.UTF-8
SetEnv LANG en_US.UTF-8
SetEnv LANGUAGE en_US.UTF-8
SetEnv PYTHONIOENCODING utf8
<Directory "/usr/bin">
<Files "inginious-webapp.production">
Require all granted
</Files>
</Directory>
<DirectoryMatch "/usr/lib/python3.5/site-packages/inginious/frontend/(.+)/static/">
Require all granted
</DirectoryMatch>
IncludeOptional conf.d/*.conf
wie kann ich debuggen diese weiter?
Danke für die Antwort. Ich habe keine Kontrolle über den Devops-Teil dieses Projekts, fürchte ich. aber danke für den Tipp bezüglich des Mod_wsgi-Daemon – WebQube