On Tue, 2010-11-30 at 12:28 -0800, goldtech wrote:
> I'm trying to parse an xml file using SAX. About half-way through a
> file I get this error:
> Traceback (most recent call last):
> File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework
> \scriptutils.py", line 325, in RunScript
>
goldtech wrote:
> I tried this but nothing changed, I thought this might convert it and
> then I'd paerse the new file - didn't work:
>
> uc = open(r'E:\sc\ppb4.xml').read().decode('utf8')
> ascii = uc.decode('ascii')
> mex9 = open( r'E:\scrapes\ppb5.xml', 'w' )
> mex9.write(ascii)
This doesn't m
goldtech, 30.11.2010 22:15:
Think I found it, for example:
line = 'my big string'
line.encode('ascii', 'ignore')
I processed the problem strings during parsing with this and it works
now.
That's not the right way of dealing with encodings, though. You should open
the file with a well defined
can't check right now but are you sure it's the parser and not
this line
d.write(csv+"\n")
that's failing?
what is d?
--
http://mail.python.org/mailman/listinfo/python-list
snip...
>
> I'm just as stumped as I was when you first asked this question 13
> minutes ago. ;-)
>
> regards
> Steve
>
snip...
Hi Steve,
Think I found it, for example:
line = 'my big string'
line.encode('ascii', 'ignore')
I processed the problem strings during parsing with this and it works
n
On 11/30/2010 3:43 PM, goldtech wrote:
> Hi,
>
> I'm trying to parse an xml file using SAX. About half-way through a
> file I get this error:
>
> Traceback (most recent call last):
> File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework
> \scriptutils.py", line 325, in RunScript
> e
Hi,
I'm trying to parse an xml file using SAX. About half-way through a
file I get this error:
Traceback (most recent call last):
File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework
\scriptutils.py", line 325, in RunScript
exec codeObject in __main__.__dict__
File "E:\sc\b2.py",
Hi,
I'm trying to parse an xml file using SAX. About half-way through a
file I get this error:
Traceback (most recent call last):
File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework
\scriptutils.py", line 325, in RunScript
exec codeObject in __main__.__dict__
File "E:\sc\b2.py",