-
-
Notifications
You must be signed in to change notification settings - Fork 226
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
Phony.normalize exception on '000000' and 'hello' #37
Comments
Thanks for reporting. What was your expectation? |
Either a more sensible error message or |
Since I don't want Phony to become the Swiss knife of telephone numbers, the behavior of this method is actually undefined if anything else than a E164 normalizable number is passed in, meaning a number that does not contain enough information to turn it into a E164 number. "+41/44+555///12...34" would be normalizable, while "00000" is not. When I wrote it, However, in another issue #35 I am working on adding a Why is the combination important? Currently, if you normalize an almost-E164 number, it will not fail. It only fails if it is too short or too un-numerical. So actually, normalize will fail only sometimes. Again, the behavior is simply undefined. And it's not a method that can be used to test for ok-ness, just for normalizing noisy E164 numbers. I need to think about this one a bit. If you have some good ideas, please let me know. If not, I will write again here if I make progress. In the meantime, please rescue. |
I've just released version 1.6.6 which includes an experimental |
Thanks, I can now deploy phony to production :) |
I'm glad to hear it, Gleb! Please update to the latest version please. Version 1.6.6 is too strict regarding plausibility of numbers. Closing this now – please reopen or open another issue should there be more. |
The text was updated successfully, but these errors were encountered: