# “bpy.path.abspath” not working properly [duplicate]

So I currently have this string: "//..\Desktop\vine.png" However, to use it when loading an image I need the \ to be \\ , so: "//..\\Desktop\\vine.png"

path = "//..\Desktop\vine.png"


I've tried using

bpy.path.abspath(path)


however this is what it throws back at me:

For some reason it changes the "v" to "x0b" and doesn't change the last \ to a \\

Anyone have any ideas why this might be? Or any other methods to change the \ to \\

• I did some more tests, it seems like it doesn't work if the image starts with following letters: v, n, b, x, f, a, u – Nils Söderman May 12 '15 at 11:46
• use path = "//..\Desktop\\vine.png" or path = r"//..\Desktop\vine.png" – Jaroslav Jerryno Novotny May 12 '15 at 12:04
• the path is generated, do you know if there is a way to use the r if path is a variable? like: bpy.path.abspath(r + path) ? – Nils Söderman May 12 '15 at 12:18
• s = s.replace("\\", "\\\\") -- stackoverflow.com/questions/7262828/… – zeffii May 12 '15 at 12:20