Skip to content

Commit

Permalink
Error on unreadable files, fixes #29
Browse files Browse the repository at this point in the history
  • Loading branch information
justin8 authored and sbraz committed Nov 14, 2016
1 parent cc48580 commit 938727f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pymediainfo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def parse(filename):
lib = CDLL("libmediainfo.dylib")
else:
lib = CDLL("libmediainfo.so.0")

# Test file is readable
with open(filename, "rb"):
pass
# Define arguments and return types
lib.MediaInfo_Inform.restype = c_wchar_p
lib.MediaInfo_New.argtypes = []
Expand Down

0 comments on commit 938727f

Please sign in to comment.