File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ PYTHONHASHSEED
178178PYTHONHOME
179179PYTHONINSPECT
180180PYTHONINTMAXSTRDIGITS
181+ PYTHONIOENCODING
181182PYTHONNODEBUGRANGES
182183PYTHONNOUSERSITE
183184PYTHONOPTIMIZE
Original file line number Diff line number Diff line change @@ -261,8 +261,17 @@ impl VirtualMachine {
261261 Ok ( ( ) )
262262 }
263263
264- fn import_utf8_encodings ( & mut self ) -> PyResult < ( ) > {
264+ fn import_ascii_utf8_encodings ( & mut self ) -> PyResult < ( ) > {
265265 import:: import_frozen ( self , "codecs" ) ?;
266+
267+ // Also register ascii encoding
268+ let ascii_module = import:: import_frozen ( self , "encodings_ascii" ) ?;
269+ let getregentry = ascii_module. get_attr ( "getregentry" , self ) ?;
270+ let codec_info = getregentry. call ( ( ) , self ) ?;
271+ self . state
272+ . codec_registry
273+ . register_manual ( "ascii" , codec_info. try_into_value ( self ) ?) ?;
274+
266275 // FIXME: See corresponding part of `core_frozen_inits`
267276 // let encoding_module_name = if cfg!(feature = "freeze-stdlib") {
268277 // "encodings.utf_8"
@@ -298,7 +307,7 @@ impl VirtualMachine {
298307 #[ cfg( not( feature = "threading" ) ) ]
299308 import:: import_frozen ( self , "_thread" ) ?;
300309 let importlib = import:: init_importlib_base ( self ) ?;
301- self . import_utf8_encodings ( ) ?;
310+ self . import_ascii_utf8_encodings ( ) ?;
302311
303312 #[ cfg( any( not( target_arch = "wasm32" ) , target_os = "wasi" ) ) ]
304313 {
You can’t perform that action at this time.
0 commit comments