Skip to content

cgitb uses the locale encoding for log files #85312

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

Closed
serhiy-storchaka opened this issue Jun 27, 2020 · 2 comments
Closed

cgitb uses the locale encoding for log files #85312

serhiy-storchaka opened this issue Jun 27, 2020 · 2 comments
Labels
3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 41140
Nosy @vsajip, @ethanfurman, @serhiy-storchaka

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 = None
created_at = <Date 2020-06-27.11:31:23.835>
labels = ['3.8', 'type-bug', 'library', '3.9', '3.10']
title = 'cgitb uses the locale encoding for log files'
updated_at = <Date 2020-07-20.20:50:31.444>
user = 'https://github.com/serhiy-storchaka'

bugs.python.org fields:

activity = <Date 2020-07-20.20:50:31.444>
actor = 'Rhodri James'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2020-06-27.11:31:23.835>
creator = 'serhiy.storchaka'
dependencies = []
files = []
hgrepos = []
issue_num = 41140
keywords = []
message_count = 1.0
messages = ['372463']
nosy_count = 3.0
nosy_names = ['vinay.sajip', 'ethan.furman', 'serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue41140'
versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

@serhiy-storchaka
Copy link
Member Author

If logdir is not None the exception handler in cgitb tries to save the description of an error in that directory using the locale encoding. It will fail if the description contains non-encodable characters.

We should either use corresponding error handlers (e.g. 'xmlcharrreplace' for html and 'backslashreplace' for text) for handling encoding errors or use the UTF-8 encoding.

@serhiy-storchaka serhiy-storchaka added 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jun 27, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@hugovk
Copy link
Member

hugovk commented Apr 11, 2022

I think we can close this? The cgitb module is deprecated in 3.11 and set for removal in 3.13.

See PEP 594 – Removing dead batteries from the standard library, #91217 and #32410.

@hugovk hugovk closed this as completed Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants