You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
audio.signal.load_audio_file(filename, ...) checks if the input is a filehandle using if not isinstance(filename, str). However, if filename is represented as type unicode, this condition is true as well and we therefore conclude that the variable is a file handle and try to close the file, which results in an error.
Therefore, I suggest it would be safer to check for file handles using if hasattr(filename, 'read') or if isinstance(filename, file).
The text was updated successfully, but these errors were encountered:
audio.signal.load_audio_file(filename, ...)
checks if the input is a filehandle usingif not isinstance(filename, str)
. However, if filename is represented as type unicode, this condition is true as well and we therefore conclude that the variable is a file handle and try to close the file, which results in an error.Therefore, I suggest it would be safer to check for file handles using
if hasattr(filename, 'read')
orif isinstance(filename, file)
.The text was updated successfully, but these errors were encountered: