Skip to content

Commit cfb886c

Browse files
Backport PR #33241: tostring->tobytes (#33993)
Co-authored-by: jbrockmendel <[email protected]>
1 parent ac21311 commit cfb886c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/_libs/writers.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def convert_json_to_lines(arr: object) -> str:
107107
if not in_quotes:
108108
num_open_brackets_seen -= 1
109109

110-
return narr.tostring().decode('utf-8')
110+
return narr.tobytes().decode('utf-8')
111111

112112

113113
# stata, pytables

pandas/io/sas/sas.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ cdef class Parser:
436436
elif column_types[j] == column_type_string:
437437
# string
438438
string_chunk[js, current_row] = np.array(source[start:(
439-
start + lngt)]).tostring().rstrip(b"\x00 ")
439+
start + lngt)]).tobytes().rstrip(b"\x00 ")
440440
js += 1
441441

442442
self.current_row_on_page_index += 1

0 commit comments

Comments
 (0)