Reputation: 525
I'm trying to access a network path using the following:
open(r"\\path\to\network")
However I am getting the following error:
Traceback (most recent call last):
File "install.py", line 9, in <module>
connect_to_network_path("\\path\to\network")
File "install.py", line 6, in connect_to_network_path
return open(pathname)
IOError: [Errno 13] Permission denied: '\\path\to\network'
Now hang on, before you chalk this down as a permissions thing let me explain why I'm asking this question. You see I'm an administrator for one, for two, if I use a different language I can access the path, for example Ruby:
irb(main):001:0> Dir.entries("\\\\path\\to\\network")
=> [".", "..", "- BOOT MEDIA", "1_Do_not_use", "1_lync", "1_Reports", "3M DB
Whiteboard for VETS", "508 Compliance Software", "Accessaphone", "Activation
"Adobe Master Folder", "Air Card_Net Gear 341 U", "Altova", "Apple", "ArcGIS
ktop for ASP", "AutoCad", "Avaya", "Barracuda PST Enterprise", "BESClientDep
, "BigFix client", ...]
irb(main):002:0> Dir.chdir("\\\\path\\to\\network")
=> 0
So my question is this, what could be causing Python to be blocked, and not Ruby, and is there anything I can do about this?
Upvotes: 1
Views: 494
Reputation: 27714
You're trying to open()
a directory. Use os.listdir()
to list the directory contents.
Upvotes: 1