Message 57177 - Python tracker
I see several problems with this, but there's light at the end of the tunnel. (1) Don't use s#; it will allow null bytes in the string, which we don't want. (2) Put the entire trailing slash removal inside #ifdef MS_WINDOWS. (3) Careful! It seems the code you wrote would transform "C:/" into "C:" which isn't the same thing (the latter refers to the current directory on the C drive, while the former is the root of the C drive).