# HG changeset patch # User Amine Sehili # Date 1718831192 -7200 # Node ID 6c33626d0bff2eb5d8f76ee0eb2b8504377904c8 # Parent 79bd3de43a5b2b82e90a990fe6e49874470c84dd Convert pathlib.Path to str to open with wave diff -r 79bd3de43a5b -r 6c33626d0bff auditok/io.py --- a/auditok/io.py Wed Jun 19 22:48:54 2024 +0200 +++ b/auditok/io.py Wed Jun 19 23:06:32 2024 +0200 @@ -834,7 +834,7 @@ if large_file: return WaveAudioSource(filename) - with wave.open(filename) as fp: + with wave.open(str(filename)) as fp: channels = fp.getnchannels() srate = fp.getframerate() swidth = fp.getsampwidth() diff -r 79bd3de43a5b -r 6c33626d0bff tests/test_io.py --- a/tests/test_io.py Wed Jun 19 22:48:54 2024 +0200 +++ b/tests/test_io.py Wed Jun 19 23:06:32 2024 +0200 @@ -248,6 +248,12 @@ [ (False, BufferAudioSource, -1, False), # large_file_false_negative_size (False, BufferAudioSource, None, False), # large_file_false_None_size + ( + False, + BufferAudioSource, + None, + True, + ), # large_file_false_None_size_Path (True, RawAudioSource, -1, False), # large_file_true_negative_size (True, RawAudioSource, None, False), # large_file_true_None_size (True, RawAudioSource, -1, True), # large_file_true_negative_size_Path @@ -255,6 +261,7 @@ ids=[ "large_file_false_negative_size", "large_file_false_None_size", + "large_file_false_None_size_Path", "large_file_true_negative_size", "large_file_true_None_size", "large_file_true_negative_size_Path", @@ -286,6 +293,12 @@ [ (False, BufferAudioSource, -1, False), # large_file_false_negative_size (False, BufferAudioSource, None, False), # large_file_false_None_size + ( + False, + BufferAudioSource, + None, + True, + ), # large_file_false_None_size_Path (True, WaveAudioSource, -1, False), # large_file_true_negative_size (True, WaveAudioSource, None, False), # large_file_true_None_size (True, WaveAudioSource, -1, True), # large_file_true_negative_size_Path @@ -293,6 +306,7 @@ ids=[ "large_file_false_negative_size", "large_file_false_None_size", + "large_file_false_None_size_Path", "large_file_true_negative_size", "large_file_true_None_size", "large_file_true_negative_size_Path",