_min_max_length_errors bug on Python 3 (comparing None to int is not allowed in Python 3)