[issue37086] time.sleep error message misleading

2019-06-02 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +13652 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13768 ___ Python tracker ___

[issue37086] time.sleep error message misleading

2019-06-02 Thread Windson Yang
Windson Yang added the comment: I just create a PR for it. -- nosy: +Windson Yang ___ Python tracker ___ ___ Python-bugs-list

[issue37086] time.sleep error message misleading

2019-06-02 Thread Michele Angrisano
Change by Michele Angrisano : -- nosy: -mangrisano ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37086] time.sleep error message misleading

2019-05-30 Thread Justin Fay
Justin Fay added the comment: >From looking at the code for this (note I am not a C programmer so may have >gotten this wrong) _PyTime_FromObject first checks if the object is a float >using PyFloat_Check(obj) this is evident as passing nan to time.sleep raises a >ValueError with the

[issue37086] time.sleep error message misleading

2019-05-29 Thread Cheryl Sabella
Cheryl Sabella added the comment: While not exactly the same, issue35707 is also about time.sleep and floats. -- nosy: +cheryl.sabella ___ Python tracker ___

[issue37086] time.sleep error message misleading

2019-05-29 Thread Eric V. Smith
Eric V. Smith added the comment: I think it's reasonable to change the TypeError to say integer or float. That's what _PyTime_FromObject is looking for. -- nosy: +eric.smith ___ Python tracker

[issue37086] time.sleep error message misleading

2019-05-29 Thread Michele Angrisano
Michele Angrisano added the comment: The doc (3.7) says that the argument "may be a floating point number to indicate a more precise sleep time." I think that TypeError message is right because you can choose how much precision you need but it's optional. What do you think about that?

[issue37086] time.sleep error message misleading

2019-05-29 Thread Justin Fay
New submission from Justin Fay : Using python3.6 and calling `time.sleep` with an invalid argument the `TypeError` raised has the error message "TypeError: an integer is required". This is not the case as a float or integer is acceptable. Using python 2.7 the error message given is better