Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert_os_errors error when converting errno.ENAMETOOLONG to PathError #453

Closed
isaacHuh opened this issue Mar 11, 2021 · 1 comment · Fixed by #474
Closed

convert_os_errors error when converting errno.ENAMETOOLONG to PathError #453

isaacHuh opened this issue Mar 11, 2021 · 1 comment · Fixed by #474
Labels
Milestone

Comments

@isaacHuh
Copy link

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'

@althonos
Copy link
Member

Thanks! I've updated PathError so that it can be passed an exception. The fix will be available in the next release (v2.4.13).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants