You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generating a float with max_value=1.0 and left_digits=1 raises a recursion error. This was not the behavior of previous releases.
Steps to reproduce
>>> from faker import Faker
>>> Faker().pyfloat(left_digits=1, max_value=1.0)
Traceback (most recent call last):
File "/home/luis/.pyenv/versions/3.10.4/lib/python3.10/code.py", line 90, in runcode
exec(code, self.locals)
File "<console>", line 1, in <module>
File "/home/luis/.cache/pypoetry/virtualenvs/csi-q5090HDc-py3.10/lib/python3.10/site-packages/faker/providers/python/__init__.py", line 217, in pyfloat
positive_number = self._safe_random_int(
File "/home/luis/.cache/pypoetry/virtualenvs/csi-q5090HDc-py3.10/lib/python3.10/site-packages/faker/providers/python/__init__.py", line 282, in _safe_random_int
return self._safe_random_int(orig_min_value, orig_max_value, positive)
File "/home/luis/.cache/pypoetry/virtualenvs/csi-q5090HDc-py3.10/lib/python3.10/site-packages/faker/providers/python/__init__.py", line 282, in _safe_random_int
return self._safe_random_int(orig_min_value, orig_max_value, positive)
File "/home/luis/.cache/pypoetry/virtualenvs/csi-q5090HDc-py3.10/lib/python3.10/site-packages/faker/providers/python/__init__.py", line 282, in _safe_random_int
return self._safe_random_int(orig_min_value, orig_max_value, positive)
[Previous line repeated 978 more times]
File "/home/luis/.cache/pypoetry/virtualenvs/csi-q5090HDc-py3.10/lib/python3.10/site-packages/faker/providers/python/__init__.py", line 279, in _safe_random_int
min_value = max(min_value, 0)
Expected behavior
Should return a float value < 1.0
Actual behavior
Raises RecursionError
The text was updated successfully, but these errors were encountered:
Generating a float with max_value=1.0 and left_digits=1 raises a recursion error. This was not the behavior of previous releases.
Steps to reproduce
Expected behavior
Should return a float value < 1.0
Actual behavior
Raises RecursionError
The text was updated successfully, but these errors were encountered: