def _write_file(longname, contents): self.write_file(longname, contents) import win32api shortname = extended_path_undo( win32api.GetShortPathName(extended_path(longname))) self.assertExists(shortname) return shortname
def volume_from_file(file_name): # strip \\?\ split_path = os.path.splitdrive(extended_path_undo(file_name)) volume = split_path[0] if volume and volume[-1] != os.sep: volume += os.sep return volume