python-pillow / python-pillow/Pillow
Change the exception type when parsing bad data
Open
@jleclanche is already working on this.
Since Jan 5, 2017.
Enhancement
- Dominant language
- Python
- Stars
- 13.8k
- Forks
- 2.5k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 89
Description
Right now PIL/Pillow recommends raising SyntaxError when dealing with bad data. Example in PaletteFile:
if len(s) > 100:
raise SyntaxError("bad palette file")
It'd be a lot nicer raising a custom exception. Abusing SyntaxError is nasty.
Contributor guide
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.
Assessment
This issue has not been assessed yet.