File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,7 @@ cdef class TextReader:
316
316
uint64_t parser_start
317
317
list clocks
318
318
char * c_encoding
319
+ object encoding_errors_py
319
320
const char * encoding_errors
320
321
kh_str_starts_t * false_set
321
322
kh_str_starts_t * true_set
@@ -376,9 +377,10 @@ cdef class TextReader:
376
377
377
378
# set encoding for native Python and C library
378
379
self .c_encoding = NULL
379
- if not isinstance (encoding_errors, bytes ):
380
+ if isinstance (encoding_errors, str ):
380
381
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
382
384
383
385
self .parser = parser_new()
384
386
self .parser.chunksize = tokenize_chunksize
You can’t perform that action at this time.
0 commit comments