miketeo/pysmb

smb.smb_structs.OperationFailure: Failed to list directory

asilaci opened this issue · 7 comments

Hi!

I receive error in case I want to go into a directory which name contains special character(s):

Failed to list HU\HUSZO\PE-SW_Engineering on Data: Unable to open directory.

When I want to list HU\HUSZO, it works without any issues and also the directory 'PE-SW_Engineering' also shown.

I gues this has to do with a special character.

Please check and let me know how to solve it.

Thanks in advance!

Hi, can you provide the special character, so that I can do some testing on my end?

Hi Teo,

Is there any restriction about level of directories?
I can not open any directories in level 3 even a simple one without any special characters.

Thanks for your feedback!

It could be a permission issue, or how you pass in your path parameter to the pysmb.

If you are using python2, you should pass in unicode strings instead of normal string for the path parameter.
For both python2 and python3, you will need to save your source file with magic comment (see PEP263).

There are quite a number of causes why the listing only works for some folder and not for all. It is difficult to troubleshoot without the error output.

Hi Michael,

I'm using python 3.69/3.7.3, but I'm not that point to save anything.

Please find the error output:
Output of HU_HUSZO_PE-SW_Engineering does not work.log

I also attach the output for the directory on level, which works correctly:
Output of HU_HUSZO works.log

You can see that I have permission to the required directory:
Permission exists

In case you need further information, please let me know.

Thanks in advance!

I have reviewed your logs. The error code returned by the remote server indicates "STATUS_PATH_NOT_COVERED" and is associated with DFS.

Unfortunately, pysmb does not support DFS (primarily because I don't have a DFS environment for development).

Issue found, ticket can be closed (usage of wrong windows share).