python-pillow / python-pillow/Pillow

Change the exception type when parsing bad data

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

@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

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.