X Tutup
The Wayback Machine - https://web.archive.org/web/20241208104627/https://github.com/python/cpython/issues/121785
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

codecs.py: Legacy --disable-unicode branch #121785

Closed
srittau opened this issue Jul 15, 2024 · 1 comment
Closed

codecs.py: Legacy --disable-unicode branch #121785

srittau opened this issue Jul 15, 2024 · 1 comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@srittau
Copy link
Contributor

srittau commented Jul 15, 2024

Bug report

Bug description:

(Not a bug report, but there is no appropriate category when creating an issue.)

git HEAD as well as Python 3.12 has the following code in codecs.py:

cpython/Lib/codecs.py

Lines 1112 to 1126 in 8303d32

try:
strict_errors = lookup_error("strict")
ignore_errors = lookup_error("ignore")
replace_errors = lookup_error("replace")
xmlcharrefreplace_errors = lookup_error("xmlcharrefreplace")
backslashreplace_errors = lookup_error("backslashreplace")
namereplace_errors = lookup_error("namereplace")
except LookupError:
# In --disable-unicode builds, these error handler are missing
strict_errors = None
ignore_errors = None
replace_errors = None
xmlcharrefreplace_errors = None
backslashreplace_errors = None
namereplace_errors = None

Is --disable-unicode even a thing anymore or is the exception handler just dead code that should be removed?

CPython versions tested on:

3.12, CPython main branch

Operating systems tested on:

Linux

Linked PRs

@srittau srittau added the type-bug An unexpected behavior, bug, or error label Jul 15, 2024
@sobolevn
Copy link
Member

I cannot find any --disable-unicode docs / usages in our codebase. It is a python2.2a1 feature:

- configure supports a new option --enable-unicode, with the values
  ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
  type and supporting code is completely removed from the interpreter.

So, I guess, that you can delete this branch.

@sobolevn sobolevn added the stdlib Python modules in the Lib dir label Jul 15, 2024
srittau added a commit to srittau/cpython that referenced this issue Jul 15, 2024
serhiy-storchaka pushed a commit that referenced this issue Jul 15, 2024
It was only needed for non-Unicode Python builds,
which aren't supported anymore.
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
It was only needed for non-Unicode Python builds,
which aren't supported anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants
X Tutup