ZeroDivisionError in Python-2.7.3/Lib/colorsys.py
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
Research direction
In Python-2.7.3/Lib/colorsys.py, inspect rgb_to_hls around lines 72–77 and reproduce the zero-denominator case. Apply the requested handling there and check the corresponding Python 3 library implementation, then verify rgb_to_hls returns the expected tuple without raising ZeroDivisionError.
Written by the indexing model from the issue text.
Description
line 77 in rgb_to_hls divides by 2.0-maxc-minc which is sometimes zero.
Fix by inserting before line 74
if (2.0-maxc-minc) == 0:
return(0.0, l, 0.0)
similar to lines 72-73.
Error also exists in python 3 library.
- Dominant language
- Python
- Stars
- 3
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from enthought/Python-2.7.3
-
Test Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
enthought/Python-2.7.3#10 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
All issues in enthought/Python-2.7.3
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100