$ chmod 0400 /tmp/test.dbf
$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbf
>>> t = dbf.Table("/tmp/test.dbf")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/dbf/ver_33.py", line 4761, in __init__
raise DbfError(str(e)) from None
dbf.ver_33.DbfError: [Errno 13] Permission denied: '/tmp/test.dbf'
It seems that the code uses "r+b" for opening files "read only", and "w+b" to
open them read-write, forgetting that the "+" stands for "update".
the reporter kindly tested that replacing the opening mode from r+b to rb makes it possible to open read-only files, and provided the attached patch to do so.