-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation issues for some Australian numbers #292
Comments
Odd, it works for me: Python 3.11.7 (main, Dec 8 2023, 14:22:46) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import phonenumbers
>>> parsed_number = phonenumbers.parse("+61461271797")
>>> phonenumbers.is_valid_number(parsed_number)
True
>>> phonenumbers.format_number(parsed_number, phonenumbers.PhoneNumberFormat.E164)
'+61461271797'
>>> phonenumbers.__version__
'8.13.32' |
Same result with an old Python 2 on a different OS (below). Is there any chance your library install has local modifications somehow? Python 2.7.18 (default, May 10 2022, 12:54:30)
[GCC Apple LLVM 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import phonenumbers
>>> parsed_number = phonenumbers.parse("+61461271797")
>>> phonenumbers.is_valid_number(parsed_number)
True
>>> phonenumbers.format_number(parsed_number, phonenumbers.PhoneNumberFormat.E164)
u'+61461271797'
>>> phonenumbers.__version__
'8.13.32' |
@daviddrysdale Thanks for the quick replies. I was also able to reproduce your steps locally and got the expected validation boolean back. That made me go back to the developer who reported the issue to me and we figured out that the tests he ran were in an old container running an older version of the package. |
We are escalating this to you as our FE validation (javascript) accepts the number, but our Python backend raises a validation error. This is blocking one of our customers from updating their profile.
After successfully parsing the E164 string
"+61461271797"
, an Australian (AU) mobile phone number, the call tophonenumbers.is_valid_number()
with the parsed number returnsFalse
.The validation for this Australian number succeeds on Google's Java version:
https://libphonenumber.appspot.com/phonenumberparser?number=%2B61461271797&country=AU
The issue occurs on the latest version
v8.13.32
but is present much further back. We tested down tov8.12.33
and it still returnsFalse
when testing for validity.Here is a code snippet reproducing the issue when passed the number above:
The text was updated successfully, but these errors were encountered: