From 5f6c233b4839d49ca05e05402ed8720af4e6aa54 Mon Sep 17 00:00:00 2001 From: Borewit Date: Thu, 17 Aug 2017 19:40:28 +0200 Subject: [PATCH] Put assert isinstance(id_, text_type) in every function --- mutagen/wave.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mutagen/wave.py b/mutagen/wave.py index 1ff2036e..cd40dc89 100644 --- a/mutagen/wave.py +++ b/mutagen/wave.py @@ -160,6 +160,7 @@ def __init__(self, fileobj): def __contains__(self, id_): """Check if the RIFF/WAVE file contains a specific chunk""" + assert isinstance(id_, text_type) check_id(id_) return id_ in self.__wavChunks @@ -167,6 +168,7 @@ def __contains__(self, id_): def __getitem__(self, id_): """Get a chunk from the RIFF/WAVE file""" + assert isinstance(id_, text_type) check_id(id_) try: @@ -178,6 +180,7 @@ def __getitem__(self, id_): def __delitem__(self, id_): """Remove a chunk from the RIFF/WAVE file""" + assert isinstance(id_, text_type) check_id(id_) self.__wavChunks.pop(id_).delete() @@ -185,6 +188,7 @@ def __delitem__(self, id_): def insert_chunk(self, id_): """Insert a new chunk at the end of the RIFF/WAVE file""" + assert isinstance(id_, text_type) check_id(id_) self._fileobj.seek(self.__next_offset)