This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sharmila
Recipients sharmila
Date 2007-10-18.01:58:13
SpamBayes Score 0.08894528
Marked as misclassified No
Message-id <1192672695.43.0.309092072224.issue1290@psf.upfronthosting.co.za>
In-reply-to
Content
I try to load the data in the testdata.txt file into a dom.

I tried 
import xml.dom.minidom as dom
data = open('testdata.txt','r').read()
mydom = dom.parseString(data)
I get the following error

>>> mydom.firstChild.childNodes
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2022' in 
position 18: ordinal not in range(128)


So I tried decoding the data and using it but it failed again.

>>> mydom2 = dom.parseString(data.decode('utf-8'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/_xmlplus/dom/minidom.py", line 
1925, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.5/site-packages/_xmlplus/dom/expatbuilder.py", 
line 942, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.5/site-packages/_xmlplus/dom/expatbuilder.py", 
line 223, in parseString
    parser.Parse(string, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u014d' in 
position 173: ordinal not in range(128)


I am willing to fix this myself if I'm given the permission.
Files
File name Uploaded
testdata.txt sharmila, 2007-10-18.01:58:13
History
Date User Action Args
2007-10-18 01:58:16sharmilasetspambayes_score: 0.0889453 -> 0.08894528
recipients: + sharmila
2007-10-18 01:58:15sharmilasetspambayes_score: 0.0889453 -> 0.0889453
messageid: <1192672695.43.0.309092072224.issue1290@psf.upfronthosting.co.za>
2007-10-18 01:58:15sharmilalinkissue1290 messages
2007-10-18 01:58:14sharmilacreate