Skip to content

Commit e19a0c6

Browse files
committed
makes it work
1 parent d1dd19d commit e19a0c6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/_libs/parsers.pyx

+4-2
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)