SilentGhost added the comment:
Why are you using this type of encoding on this bytes object? It specifically
says in its description that "Existing backslashes are not escaped in any
way.". If you'd use unicode_escape instead, you would be able to round-trip
back to your original string.
New submission from YPf :
>>> path=r'C:\Users\Administrator\Desktop'
>>> path.encode('raw_unicode_escape')
b'C:\\Users\\Administrator\\Desktop'
>>> path.encode('raw_unicode_escape').decode('raw_unicode_escape')
Traceback (most recent call last):
File "", line 1, in