Skip to content

Commit de7f146

Browse files
committed
preload utf8 and ascii encodings in context
1 parent 608e19d commit de7f146

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

graalpython/lib-graalpython/_codecs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ def code_page_decode(code_page, string, errors=None, final=False):
327327
sys.path.append(sys.graal_python_stdlib_home)
328328
try:
329329
import encodings
330+
# we import the below two encodings, because they are often used so it's
331+
# useful to have them available preloaded
332+
import encodings.ascii
333+
import encodings.utf_8
330334
finally:
331335
assert len(sys.path) == 1
332336
sys.path.pop()

0 commit comments

Comments
 (0)