Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Problem with urllib2.urlopen() opening a local file

Reply
Thread Tools

Problem with urllib2.urlopen() opening a local file

 
 
deja user
Guest
Posts: n/a
 
      10-24-2009

I want to use urlopen() to open either a http://... file or a local
file File:C:/... I don't have problems opening and reading the file
either way. But when I run the script on a server (ArcGIS server),
the request won't complete if it was trying to open a local file.
Even though I call close() in either case, something seemed to be
preventing the script to complete if urlopen is trying to open a local
file. I wonder if there is anything else I should do in the code to
kill the file descriptor, or if it is a known issue that something is
leaking

When running the script standalone, this is not an issue.
 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      10-27-2009
En Sat, 24 Oct 2009 20:10:21 -0300, deja user <(E-Mail Removed)>
escribió:

> I want to use urlopen() to open either a http://... file or a local
> file File:C:/... I don't have problems opening and reading the file
> either way. But when I run the script on a server (ArcGIS server),
> the request won't complete if it was trying to open a local file.
> Even though I call close() in either case, something seemed to be
> preventing the script to complete if urlopen is trying to open a local
> file. I wonder if there is anything else I should do in the code to
> kill the file descriptor, or if it is a known issue that something is
> leaking
>
> When running the script standalone, this is not an issue.


I don't know about the ArcGIS server, but leaking a file descriptor
usually is not a reason to not finish a request. I'd look into the server
log files for any errors. The server might be configured to not allow
open() of arbitrary files, by example. This seems more an ArcGIS question
than a Python one.

Just to be sure, "local file" in this context means "local to the server",
ok? An url like "file://c:/path/..." (note the differences with yours) is
only meaningful if the server is running Windows, ok?

--
Gabriel Genellina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with opening Excel after opening Excel inside Microsoft Internet Controls fniles ASP General 0 04-26-2009 09:39 PM
Access local port or Running local exe file =?Utf-8?B?WVNVVA==?= ASP .Net 0 01-14-2006 12:41 AM
Playing a local mpeg file from a local HTML file... Lyndon HTML 1 07-25-2005 02:21 AM
Word file not opening from Adm -My recent docs but opening from file menu of Word Thaqalain Computer Support 0 06-30-2005 02:20 AM
Opening a local file in a browser Mark Rae ASP .Net 5 01-22-2005 06:19 PM



Advertisments