python - Ignoring escape sequences -


i'm using python 2.6 , have variable contains string (i have sent thorugh sockets , want it). problem following error:

typeerror: file() argument 1 must encoded string without null bytes, not str

after looked found out problem string i'm sending contains '\0' isn't literal string can edit double backslash or adding 'r' before hand, there way tell python ignore escape sequences , treat whole thing string?

(for example - don't want python treat sequence \0 null char, rather want treated backslash char followed 0 char)

considering comments looks incorrectly used pil/pillow api, namely image.open function requires file name instead of file data.


Comments

Popular posts from this blog

angularjs - Redirect to a new template in angular js -

Oracle SQL. How to select specific IDs where value of columns specify criteria? -

Desktop Launcher for Python Script Starts Program in Wrong Path (Linux) -