Change the exception type when parsing bad data

Open
#1,643 7 comments 1 reaction 1 assignee View on GitHub

Maintainers usually reply within 1 day

@jleclanche is already working on this.

Since Jan 5, 2017.

Assessment

This issue has not been assessed yet.

Description

Enhancement

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.

Dominant language
Python
Stars
14k
Forks
2.6k
Avg merge
1d 1h
Merged PRs (30d)
205

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-pillow/Pillow

All issues in python-pillow/Pillow

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.