Skip to content
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

Locale fr_FR : phone_number generate invalid values #1516

Closed
zerbusdetroy opened this issue Sep 22, 2021 · 3 comments · Fixed by #1560
Closed

Locale fr_FR : phone_number generate invalid values #1516

zerbusdetroy opened this issue Sep 22, 2021 · 3 comments · Fixed by #1560

Comments

@zerbusdetroy
Copy link
Contributor

  • Faker version: 8.12.1
  • OS: Mac OS

The phone_number default provider generate random numbers after the first 2 digits (01 ## ## ## ##, etc.).
A lot of combinaisons are not possible for the digits 3 and 4 depending of the first 2. The complete list is available here.

For example 0415919107 is valid while 0405919107 is not.

This make this provider incompatible with phonenumbers, a lib for phone number validations.

Steps to reproduce

  1. Faker("phone_number", locale="fr_FR").generate()

Expected behavior

0405919107 should never be generated because its invalid

Actual behavior

0405919107 can be generated

@fcurella
Copy link
Collaborator

Thank you for the report, @zerbusdetroy !

Do you have time to work on a Pull Request?

@zerbusdetroy
Copy link
Contributor Author

zerbusdetroy commented Sep 23, 2021 via email

@nicarl
Copy link
Contributor

nicarl commented Oct 22, 2021

I found another issue, phone numbers starting with 07 are not included (exist since 2010, so "relatively" new).

nicarl added a commit to nicarl/faker that referenced this issue Oct 22, 2021
French landline numbers (starting with 01, 02, 03, 04, 05) are limited to well-known area codes. This is taken into account when generating the phone numbers.

Mobile phone numbers starting with 07 are also added.

Fixes: joke2k#1516
nicarl added a commit to nicarl/faker that referenced this issue Oct 22, 2021
French landline numbers (starting with 01, 02, 03, 04, 05) are limited to well-known area codes. This is taken into account when generating the phone numbers.

Mobile phone numbers starting with 07 are also added.

Fixes: joke2k#1516
nicarl added a commit to nicarl/faker that referenced this issue Oct 23, 2021
French landline numbers (starting with 01, 02, 03, 04, 05) are limited to well-known area codes. This is taken into account when generating the phone numbers.

Mobile phone numbers starting with 07 are also added.

Fixes: joke2k#1516
fcurella pushed a commit that referenced this issue Oct 27, 2021
French landline numbers (starting with 01, 02, 03, 04, 05) are limited to well-known area codes. This is taken into account when generating the phone numbers.

Mobile phone numbers starting with 07 are also added.

Fixes: #1516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants