Skip to content

gh-62824: add alias for iso-8859-8-i and -e to iso_8859_8 #32279

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
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/encodings/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@
'iso_8859_8' : 'iso8859_8',
'iso_8859_8_1988' : 'iso8859_8',
'iso_ir_138' : 'iso8859_8',
'iso_8859_8_i' : 'iso8859_8',
'iso_8859_8_e' : 'iso8859_8',

# iso8859_9 codec
'csisolatin5' : 'iso8859_9',
Expand Down
8 changes: 8 additions & 0 deletions Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import contextlib
import io
import locale
import os
import sys
import unittest
import encodings
Expand Down Expand Up @@ -2842,6 +2843,13 @@ def test_aliases(self):
info = codecs.lookup(alias)
self.assertEqual(info.name, expected_name)

def test_alias_modules_exist(self):
encodings_dir = os.path.dirname(encodings.__file__)
for value in encodings.aliases.aliases.values():
codec_file = os.path.join(encodings_dir, value + ".py")
self.assertTrue(os.path.isfile(codec_file),
"Codec file not found: " + codec_file)

def test_quopri_stateless(self):
# Should encode with quotetabs=True
encoded = codecs.encode(b"space tab\teol \n", "quopri-codec")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix aliases for ``iso8859_8`` encoding. Patch by Dave Goncalves.