Fix ValueErrorsubstring not found on windows

Fix ValueError: substring not found on windows