[python3] string comparison fixes