[lxml-dev] Failure with custom resolvers and relative xsl:import

John Lovell jlovell at esd189.org
Mon Aug 18 22:50:38 CEST 2008


Stefan:

If you find a currently maintained pure Python way to add SSL, please
let us know.

John W. Lovell
Web Applications Engineer
Northwest Educational Service District
1601 R Avenue
Anacortes, WA 98221
(360) 299-4086
jlovell at nwesd.org
 
www.nwesd.org
Together We Can ...


-----Original Message-----
From: lxml-dev-bounces at codespeak.net
[mailto:lxml-dev-bounces at codespeak.net] On Behalf Of Stefan Behnel
Sent: Monday, August 18, 2008 1:17 PM
To: Sidnei da Silva
Cc: ML-Lxml-dev
Subject: Re: [lxml-dev] Failure with custom resolvers and relative
xsl:import

Hi,

Sidnei da Silva wrote:
> On Mon, Aug 18, 2008 at 4:04 AM, Stefan Behnel <stefan_ml at behnel.de>
wrote:
>> The problem here is that lxml currently only takes the .name 
>> attribute of a file object to determine the file name. The right 
>> thing to do would be to use
>> os.path.abspath(f.name) instead to retrieve the absolute path name of
the file.
>>
>> Using resolve_filename(filename) instead of 
>> resolve_file(open(filename)) provides a more efficient work around,
though.
> 
> Okay, I think that solves one of the problems, when the filename is 
> local. I suspect it won't solve the other problem I had, which was 
> when the file comes from urlopen(). Since the files are relatively 
> small though I can keep using resolve_string() for now.

I'm working on fixing this. However, do you really need something from
urlopen that lxml can't handle by itself? Any "HTTP GET" or "FTP get"
request should work when passed as an encoded URL. HTTP POSTs and
request options won't work, but they are pretty rarely used when
requesting pages. HTTPS also won't work, which I would consider more
important.

Stefan
_______________________________________________
lxml-dev mailing list
lxml-dev at codespeak.net
http://codespeak.net/mailman/listinfo/lxml-dev


More information about the lxml-dev mailing list