This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: glob() fails for network drive in cgi
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: mhammond Nosy List: bshoe282, mhammond
Priority: normal Keywords:

Created on 2002-06-19 15:29 by bshoe282, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Script1.cgi bshoe282, 2002-06-19 15:36 example of glob inconsistency
Messages (4)
msg11257 - (view) Author: Brian Schuweiler (bshoe282) Date: 2002-06-19 15:29
glob.glob() does not work when globbing a network 
mapped drive while running as a cgi script.  The method 
works fine when run as a normal python script (even for 
mapped drives), but does not work when run from a 
browser as a cgi script.  The glob returns an empty list 
as if the drive just isn't there.
msg11258 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2002-06-28 01:19
Logged In: YES 
user_id=14198

Assuming Windows.

This is almost certainly a permissions problem.  The IIS
server does not run CGI as a "regular" user, but as the
"system user".  The system user has no permissions to access
network resources, hence your problem.

Thus, this is not a Python problem.  You need to check the
IIS docs to see how, or even if, you can loosen the
permissions (and assuming you understand the implications of
doing so).

Unless i hear back in a few days that there is another
problem I will close this as invalid.
msg11259 - (view) Author: Brian Schuweiler (bshoe282) Date: 2002-06-28 18:28
Logged In: YES 
user_id=565626

Thanks for the response.  My initial thoughts were that it is a 
permissions problem.  What made me believe otherwise and 
log a bug was that no errors are thrown in the webserver and 
the glob does return something, but it is an empty set.  It 
seems as though the glob works, but there are no matches 
(even though there definitely are).  
msg11260 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2002-07-10 06:07
Logged In: YES 
user_id=14198

In your specific example, you use "z:" commenting it is a
mapped drive.  However, it is probably not mapped for the
system user, hence we see "file not found" rather than
"access denied.".  Drive mappings are stored per user, not
per machine.

You could try using r"\\server\\sharename" syntax, but I am
fairly certain any problems you face then will be permission
problems.  If you search comp.lang.python on google, you
will find this has indeed come up a few times and has always
been permissions.

Closing, but happy to reopen if you can demonstrate there is
some other problem.
History
Date User Action Args
2022-04-10 16:05:25adminsetgithub: 36769
2002-06-19 15:29:40bshoe282create