In python the \ character is an escape character, so you are escaping the " at the end of the string. This is kind of an edge case. However, removing that \ is functionally equivalent. If you intend to use this as a sub string in building a larger path, then adding format place holders will allow you to use this as you're trying.
In basically everything in Python and Java's standard library, you can just use forward slashes instead of backslashes and avoid any escaping problems entirely.
So, even on a 'raw' string, the backslash at the end acts as an escape? I'm having trouble making sense of that since it didn't do that with the other backslashes in the string. Any idea why only the last character seems to be a special case?
For those (like me) who are still having trouble understanding it, I just stumbled across this document that explains about this particular topic for Python in general. Why can't raw strings in Python end with a backslash?
It still seems odd to me. But I tend to remember odd things, so maybe that's good?