Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runs normal as console script but falls as CGI #57538

Closed
NickRowan mannequin opened this issue Nov 3, 2011 · 4 comments
Closed

Runs normal as console script but falls as CGI #57538

NickRowan mannequin opened this issue Nov 3, 2011 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) stdlib Python modules in the Lib dir topic-unicode type-bug An unexpected behavior, bug, or error

Comments

@NickRowan
Copy link
Mannequin

NickRowan mannequin commented Nov 3, 2011

BPO 13329
Nosy @birkenfeld, @ezio-melotti, @merwok, @akheron
Files
  • Test.py: CGI script
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2013-10-13.18:34:26.376>
    created_at = <Date 2011-11-03.03:22:14.136>
    labels = ['interpreter-core', 'type-bug', 'library', 'expert-unicode']
    title = 'Runs normal as console script but falls as CGI'
    updated_at = <Date 2013-10-13.18:34:26.375>
    user = 'https://bugs.python.org/NickRowan'

    bugs.python.org fields:

    activity = <Date 2013-10-13.18:34:26.375>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-10-13.18:34:26.376>
    closer = 'georg.brandl'
    components = ['Interpreter Core', 'Library (Lib)', 'Unicode']
    creation = <Date 2011-11-03.03:22:14.136>
    creator = 'Nick.Rowan'
    dependencies = []
    files = ['23602']
    hgrepos = []
    issue_num = 13329
    keywords = []
    message_count = 4.0
    messages = ['146893', '146906', '147475', '199758']
    nosy_count = 5.0
    nosy_names = ['georg.brandl', 'ezio.melotti', 'eric.araujo', 'petri.lehtinen', 'Nick.Rowan']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue13329'
    versions = ['3rd party', 'Python 3.1', 'Python 3.2']

    @NickRowan
    Copy link
    Mannequin Author

    NickRowan mannequin commented Nov 3, 2011

    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.

    @NickRowan NickRowan mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) stdlib Python modules in the Lib dir topic-unicode type-bug An unexpected behavior, bug, or error labels Nov 3, 2011
    @akheron
    Copy link
    Member

    akheron commented Nov 3, 2011

    How are you running the CGI script? Are you sure that the PYTHONIOENCODING environment variable isn't set by the HTTP server?

    @merwok
    Copy link
    Member

    merwok commented Nov 12, 2011

    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!

    @birkenfeld
    Copy link
    Member

    Closing due to lack of feedback.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) stdlib Python modules in the Lib dir topic-unicode type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants