Using convert_os_errors to convert errno.ENAMETOOLONG to PathError results in unexpected keyword arguement 'exc' error. Seems that this line will set exc=exc_value however PathError does not take in exc parameter.
The following example code:
import errno
from fs.error_tools import convert_os_errors
from fs import errors as fserrors
try:
from fs import open_fs
f = open_fs('/tmp')
f.open('x'*500, mode='w')
except OSError as e:
with convert_os_errors("foo", "test"):
raise e
results in: TypeError: init() got an unexpected keyword argument 'exc'