classification
Title: Runs normal as console script but falls as CGI
Type: behavior Stage:
Components: Interpreter Core, Library (Lib), Unicode Versions: Python 3.1, Python 3.2, 3rd party
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Nick.Rowan, eric.araujo, ezio.melotti, georg.brandl, petri.lehtinen
Priority: normal Keywords:

Created on 2011-11-03 03:22 by Nick.Rowan, last changed 2013-10-13 18:34 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
Test.py Nick.Rowan, 2011-11-03 03:22 CGI script
Messages (4)
msg146893 - (view) Author: Nick Rowan (Nick.Rowan) Date: 2011-11-03 03:22
There is a Python script that tries to print a message in Russian language. It's okay when script runs in console, but it causes DecodeUnicodeError if it invokes as CGI.
msg146906 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-11-03 08:41
How are you running the CGI script? Are you sure that the PYTHONIOENCODING environment variable isn't set by the HTTP server?
msg147475 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-12 11:27
The contents are valid UTF-8; the problem does not seem related to PYTHONIOENCODING (run “python3.2 Test.py | cat” so that stdout is not a tty; this used to be buggy in 2.x, hence PYTHONIOENCODING, but in 3.x the encoding of stdout is UTF-8 even in a pipeline).

Nick, we’ll need more info about your setup, as well as the full traceback.  Thanks!
msg199758 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2013-10-13 18:34
Closing due to lack of feedback.
History
Date User Action Args
2013-10-13 18:34:26georg.brandlsetstatus: pending -> closed

nosy: + georg.brandl
messages: + msg199758

resolution: out of date
2011-11-12 18:23:36petri.lehtinensetstatus: open -> pending
2011-11-12 11:27:53eric.araujosetnosy: + eric.araujo
messages: + msg147475
2011-11-03 08:41:00petri.lehtinensetnosy: + petri.lehtinen
messages: + msg146906
2011-11-03 03:22:14Nick.Rowancreate