Python 3 bytes vs strings -


this may duplicate can't solve problem. line gives me error

typeerror: 'str' not support buffer interface .

unescaped = html.replace(r'\""', '"') 

does mean have write

unescaped = html.replace(bytes(r'\""', 'utf-8'), bytes('"', 'utf-8')) 

each time need replace string?

thank in advance.

you using literal values use bytes literal string, b prefix:

unescaped = html.replace(rb'\""', b'"') 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -