When a single area is extracted from the output of description_for_number, that's interpreted as if it were a state.
|
elif len(area) == 1 and area[0]: |
|
state = area[0].lower().strip() |
|
state = td.normalized_states['US'].get(state, None) |
Here's an example where a phone from Philadelphia, PA thinks state is philadelphia instead of pennsylvania and fails to find it in normalized_states. Because of this, all the US timezone IDs will be returned for this number.
This behaviour is still present in phonenumbers latest version (8.13.1)
Example:
import phonenumbers
from phonenumbers.geocoder import description_for_number
from tztrout import tz_ids_for_phone
phone_number = "+14455000001"
tz_ids = tz_ids_for_phone(phone_number, "US")
print(tz_ids) # contains all of the US timezones
phone = phonenumbers.parse(phone_number, "US")
area = description_for_number(phone, "en").split(',')
print(area) # ["Philadelphia"]