[Pythonmac-SIG] trouble with NSXMLDocument

Jack Nutting jnutting at gmail.com
Thu Nov 10 11:15:54 CET 2005


Hi gang,

I wanted to play around with NSXMLDocument a bit, and figured PyObjC would
be a good way to do it. Unfortunately, I get strange errors.

>>> doc, error = Foundation.NSXMLDocument.alloc
().initWithContentsOfURL_options_error_(u"asdfkjsda.svg", 0)
2005-11-10 11:03:20.618 python[1018] *** -[OC_PythonUnicode absoluteURL]:
selector not recognized [self = 0x370db0]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: NSInvalidArgumentException - *** -[OC_PythonUnicode
absoluteURL]: selector not recognized [self = 0x370db0]

Note that the "asdfkjsda.svg" file is in the same directory where I started
python. I tried using a file URL instead, but both "file://asdfkjsda.svg"
and "file:///Users/jnutting/Documents/svg/shapes/asdfkjsda.svg" give me the
same result, as does wrapping the string in unicode(string, 'utf-8') instead
of just prepending it with 'u'.

Running framework python 2.4.1, mac os 10.4.3, PyObjC 1.3.7 (from the
installer package for 2.4.1/10.3; is it odd that there's not a 1.3.7 for
2.4.1/10.4, or should the one I've got work OK?)

--
// jack
// http://www.nuthole.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20051110/1200ccf7/attachment.html


More information about the Pythonmac-SIG mailing list