◐ Shell
reader mode source ↗
Skip to content

bpo-46659: Update the test on the mbcs codec alias#31168

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:mbcs_alias
Feb 6, 2022
Merged

bpo-46659: Update the test on the mbcs codec alias#31168
vstinner merged 2 commits into
python:mainfrom
vstinner:mbcs_alias

Conversation

@vstinner

@vstinner vstinner commented Feb 6, 2022

Copy link
Copy Markdown
Member

Move the test on the "mbcs" codec alias from test_site to
test_codecs. Moreover, the test now uses
locale.getpreferredencoding(False) rather than
locale.getdefaultlocale() to get the ANSI code page.

https://bugs.python.org/issue46659

encodings registers the _alias_mbcs() codec search function before
the search_function() codec search function. Previously, the
_alias_mbcs() was never used.

Fix the test_codecs.test_mbcs_alias() test: use the current ANSI code
page, not a fake ANSI code page number.

Remove the test_site.test_aliasing_mbcs() test: the alias is now
implemented in the encodings module, no longer in the site module.
@vstinner vstinner merged commit 04dd60e into python:main Feb 6, 2022
@vstinner vstinner deleted the mbcs_alias branch February 6, 2022 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants