jborean93 / smbprotocol

Python SMBv2 and v3 Client
MIT License
320 stars 73 forks source link

Wrong raw_type when deleting a directory #269

Closed kiarn closed 7 months ago

kiarn commented 7 months ago

Hello,

Thanks for this library, it's a wonderful tool !

I run sometimes on the following error when deleting a directory:

    smbclient.rmdir(chunk_dir)
  File "/usr/local/lib/python3.10/dist-packages/smbclient/_os.py", line 522, in rmdir
    _delete(SMBDirectoryIO, path, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/smbclient/_os.py", line 1013, in _delete
AttributeError: 'function' object has no attribute 'FILE_TYPE'

If I print the raw_type parameter of the _delete function, I get in this situation a new function <function credit_wrapper.<locals>.new_func at 0x7fe0cb46eb90> instead of SMBDirectoryIO, and I don't understand why.

Do you have an idea why this occurs ?

Thanks !

Arnaud

kiarn commented 7 months ago

The problem was in my own code, sorry for the convenience ! :)