Reputation: 9627
Hi all I have this code:
data = data.split('&')
And I get the following error:
data = data.split('&') TypeError: Type str doesn't support the buffer API
How to split my string?
Upvotes: 9
Views: 11784
Reputation: 1122382
data
is a bytes
object. You can only use another bytes
value to split it, you can use a bytes
literal (starting with the b
prefix) to create one:
data.split(b'&')
Upvotes: 22