Skip to content

Commit

Permalink
Merge pull request #198 from mvantellingen/feature/fix-resolver-base-url
Browse files Browse the repository at this point in the history
Fix setting the base url for etree.Resolver.resolve_string
  • Loading branch information
scoder committed Jul 18, 2016
2 parents eb88652 + a4437df commit 989a253
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lxml/includes/xmlparser.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ cdef extern from "libxml/tree.h":
const_xmlChar* base
const_xmlChar* cur
const_xmlChar* end
const_char *filename

ctypedef struct xmlParserInputBuffer:
void* context
Expand Down
2 changes: 2 additions & 0 deletions src/lxml/parser.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ cdef xmlparser.xmlParserInput* _local_resolver(const_char* c_url, const_char* c_
data = doc_ref._data_bytes
c_input = xmlparser.xmlNewInputStream(c_context)
if c_input is not NULL:
if doc_ref._filename:
c_input.filename = <char *>tree.xmlStrdup(_xcstr(doc_ref._filename))
c_input.base = _xcstr(data)
c_input.length = python.PyBytes_GET_SIZE(data)
c_input.cur = c_input.base
Expand Down

0 comments on commit 989a253

Please sign in to comment.