File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,7 @@ cdef class TextReader:
316316 uint64_t parser_start
317317 list clocks
318318 char * c_encoding
319+ object encoding_errors_py
319320 const char * encoding_errors
320321 kh_str_starts_t * false_set
321322 kh_str_starts_t * true_set
@@ -376,9 +377,10 @@ cdef class TextReader:
376377
377378 # set encoding for native Python and C library
378379 self .c_encoding = NULL
379- if not isinstance (encoding_errors, bytes ):
380+ if isinstance (encoding_errors, str ):
380381 encoding_errors = encoding_errors.encode(" utf-8" )
381- self .encoding_errors = < const char * > encoding_errors
382+ self .encoding_errors_py = encoding_errors
383+ self .encoding_errors = < const char * > self .encoding_errors_py
382384
383385 self .parser = parser_new()
384386 self .parser.chunksize = tokenize_chunksize
You can’t perform that action at this time.
0 commit comments