We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1dd19d commit e19a0c6Copy full SHA for e19a0c6
pandas/_libs/parsers.pyx
@@ -316,6 +316,7 @@ cdef class TextReader:
316
uint64_t parser_start
317
list clocks
318
char *c_encoding
319
+ object encoding_errors_py
320
const char *encoding_errors
321
kh_str_starts_t *false_set
322
kh_str_starts_t *true_set
@@ -376,9 +377,10 @@ cdef class TextReader:
376
377
378
# set encoding for native Python and C library
379
self.c_encoding = NULL
- if not isinstance(encoding_errors, bytes):
380
+ if isinstance(encoding_errors, str):
381
encoding_errors = encoding_errors.encode("utf-8")
- self.encoding_errors = <const char*>encoding_errors
382
+ self.encoding_errors_py = encoding_errors
383
+ self.encoding_errors = <const char*>self.encoding_errors_py
384
385
self.parser = parser_new()
386
self.parser.chunksize = tokenize_chunksize
0 commit comments