Double backslashes in IE
Following up on my problem with getting errors in the expression _.getitem(file.filename) when using IE, I've learned that IE "sees" the filename as something like 'C:\\CSF\\BUS581\\581F203H1BJS.doc'. The double backslashes are making it an invalid filename. I've put on my Python thinking cap, figuring I can write a script that takes care of that. But string.replace(x, r"\\", r"\") doesn't work. The raw single slash escapes the final double quote and gives an error. Any suggestions?
Karl, even with raw strings the last character can not be a \. string.replace(x, '\\\\', '\\') should work better Horak, Karl wrote:
Following up on my problem with getting errors in the expression _.getitem(file.filename) when using IE, I've learned that IE "sees" the filename as something like 'C:\\CSF\\BUS581\\581F203H1BJS.doc'. The double backslashes are making it an invalid filename. I've put on my Python thinking cap, figuring I can write a script that takes care of that. But string.replace(x, r"\\", r"\") doesn't work. The raw single slash escapes the final double quote and gives an error. Any suggestions?
participants (2)
-
Chris Beaven -
Horak, Karl