-
Notifications
You must be signed in to change notification settings - Fork 79
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
Ping 'count' param throws error for large values, and is signed. #87
Comments
It would be cool to have infinite ping using |
Integer (int) has no max limit in Python3.import sys
sys.maxsize
# 9223372036854775807 And sys.maxsize is not the max value of int, Python3's Not reproduce-able
Agreed
Agreed on this. For negative numbers, it should throw an error instead of just displaying default Expected Behaviour:ValueError:count must be greater than or equal to 0 Handling float count valuesFloat values should be rounded off from pythonping import ping
ping('127.0.0.1', count=2.1) Current Behaviour:
Expected Behaviour:
|
@z4id regarding sys.maxsize: fair enough, no need to set an upper limit. The PR I opened here did solve the large number and negative number issue for me - perhaps you could take a look and try it out on your system. |
@dabell-cc, that's great. I'll have a look on it. |
I will try to review this ASAP |
Describe the bug
The
ping()
function can't be called with a large value forcount
. It will throw an error.Setting
count
to a negative number does not result in an error (but it should).Seems the
count
variable is ended up a signed 16-bit int for some reason.To Reproduce
Steps to reproduce the behavior:
Large value error:
Accept negative number:
Expected behavior
Expect to be able to set
count
to a positive int 0 .. sys.maxsize.Large ping counts are helpful for long ping-flood tests to check for networking stability.
Expect error when setting count to a negative value.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: