RDFLib / pyrdfa3

RDFa 1.1 distiller/parser library: can extract RDFa 1.1 (and RDFa 1.0, if properly set via a @version attribute) from (X)HTML, SVG, or XML in general. The module can be used to produce serialized versions of the extracted graph, or simply an RDFLib Graph.
http://www.w3.org/2012/pyRdfa/
Other
67 stars 22 forks source link

Removing reference to `file` which is not defined in Python 3 #36

Closed mwatts15 closed 2 years ago

mwatts15 commented 2 years ago
iherman commented 2 years ago

(Sorry to be late with this, @mwatts15, I do not really maintain this software any more...

The problem is that the package is used at places that still use python2. Legacy software and all that. Ie, the changes you propose may not work. What about

        if (PY3 and isinstance(input, str)) or (isinstance(input, StringIO) or isinstance(input, file)) :
            parse = xml.dom.minidom.parse
        else:
            parse = xml.dom.minidom.parseString

instead?

(I can make edit the library directly or you can amend the PR; as you prefer)

Thanks

iherman commented 2 years ago

Closing without merge, per #39 which solved it.