I'm having difficulties parsing filepaths sent as arguments:

If I type:


I get


0bviously the \0 in the folder name is upsetting the formatting. I can correct it with the following:


which gives


My problem is, how do I achieve the same result with sys.argv, namely: os.path.normpath(sys.argv[1]) I can't find a way for feeding sys.argv in a raw mode into os.path.normpath() to avoid issues with folders starting with zero!

Ok, I solved my problem by not using os.path.normpath(). If I use it before calling os.path.split(), the lowest folder will be assumed to be a file, because the trailing \ has been removed