Closed PreciousNyasulu closed 1 year ago
This library is a port of the Google phonenumbers library and as such we want functionality to match that library as closely as possible. I just checked and it seems the official library requires country codes to be correctly uppercased, so best that maintain that behavior here as well.
>>> import phonenumbers
>>> phonenumbers.parse("0979111111", "ec")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/rowanseymour/Nyaruka/rapidpro/.venv/lib/python3.10/site-packages/phonenumbers/phonenumberutil.py", line 2927, in parse
raise NumberParseException(NumberParseException.INVALID_COUNTRY_CODE,
phonenumbers.phonenumberutil.NumberParseException: (0) Missing or invalid default region.
converts the country code to upper case before parsing.