Closed alanking closed 2 months ago
We could extract the path
member from a list of supported types (e.g. iRODSCollection
) and then raise
a TypeError
for other non-str
types... Or, just raise
a TypeError
for anything but the expected str
type.
If the wrong type is passed for any of the members of and
iRODSAccess
object, thecopy()
member function can fail on the call tocopy.deepcopy
: https://github.com/irods/python-irodsclient/blob/71d787fe1f79d81775d892c59f3e9a9f60262c78/irods/access.py#L67I think the checks should occur in
__init__
: https://github.com/irods/python-irodsclient/blob/71d787fe1f79d81775d892c59f3e9a9f60262c78/irods/access.py#L59-L64Currently, if a type such as an
iRODSCollection
is passed forpath
instead of astr
(the expected type), an Exception like this can be raised whencopy
is invoked:The stacktrace is not very clear and could be avoided with a well-placed type check earlier in the process.