Re: Getting Unicode decode error using lxml.iterparse

2018-05-23 Thread Peter Otten
digi...@gmail.com wrote: > I'm trying to read my iTunes library in Python using iterparse. My current > stub is: > parser.add_argument('infile', nargs='?', > type=argparse.FileType('r'), default=sys.stdin) > I'm getting an error on one part of the XML: > > > File "C:\Users\digit\Anaco

Re: Getting Unicode decode error using lxml.iterparse

2018-05-23 Thread Stefan Behnel
digi...@gmail.com schrieb am 23.05.2018 um 00:56: > I'm trying to read my iTunes library in Python using iterparse. My current > stub is: > > Snip > > import sys > import datetime > import xml.etree.ElementTree as ET > import argparse > import re > > class Library: > > unmars

Re: Getting Unicode decode error using lxml.iterparse

2018-05-23 Thread Stefan Behnel
dieter schrieb am 23.05.2018 um 08:25: > If the encoding is not specified, "lxml" will try to determine it > and finally defaults to "utf-8" (which seems to be the correct encoding > for your case). Being an XML parser, it does not do that. XML parsers are designed to reject non-wellformed content

Re: Getting Unicode decode error using lxml.iterparse

2018-05-22 Thread dieter
digi...@gmail.com writes: > I'm trying to read my iTunes library in Python using iterparse. My current > stub is: > ... > My input file (reduced to home in on the error) is: > > snip - > > > > > > 15078 > > NamePart 2. The Deat

Getting Unicode decode error using lxml.iterparse

2018-05-22 Thread digitig
I'm trying to read my iTunes library in Python using iterparse. My current stub is: Snip import sys import datetime import xml.etree.ElementTree as ET import argparse import re class Library: unmarshallers = { # collections "array": lambda x: [v.text for v in

Re: Unicode Decode Error

2010-10-11 Thread Ian Kelly
On Mon, Oct 11, 2010 at 3:44 PM, Pratik Khemka wrote: > I tried to solve it using this *wbk = xlwt.Workbook('utf-8')... *The > problem still persists. Is there a way I can solve this problem..? > > *Traceback (most recent call last): > File "C:\Documents and Settings\pkhemka\My Documents\merge_

RE: Unicode Decode Error

2010-10-11 Thread Pratik Khemka
This is the original full traceback. when I was getting the Unicode Decode Error.. Traceback (most recent call last): File "C:\Documents and Settings\pkhemka\My Documents\merge_py.py", line 315, i n wbk.save('p4_merge.xls') File "C:\Python25\lib\site-package

Re: Unicode Decode Error

2010-10-08 Thread Ian Kelly
On Fri, Oct 8, 2010 at 3:31 PM, Pratik Khemka wrote: > *UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position > 152: ordinal not in range(128)*. Can someone please help me with this > error > The error occurs in line *wbk.save(p4_merge.xls)*. I have used * > import xlwt*..Can some

Re: Unicode Decode Error

2010-10-08 Thread Chris Rebert
On Fri, Oct 8, 2010 at 2:31 PM, Pratik Khemka wrote: > UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 152: > ordinal not in range(128). Can someone please help me with  this error > The error occurs in line wbk.save(p4_merge.xls). I have used > import xlwt..Can someone just t

Unicode Decode Error

2010-10-08 Thread Pratik Khemka
UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 152: ordinal not in range(128). Can someone please help me with this error The error occurs in line wbk.save(p4_merge.xls). I have used import xlwt..Can someone just tell what do I need to do to get rid of this error. I read

Re: Unicode Decode Error

2009-04-09 Thread John Machin
On Apr 10, 12:40 am, MRAB wrote: > reetesh nigam wrote: > > Hi All, > > There is some special character in my database. > > and when try to show on my UI it says > > >     return codecs.utf_8_decode(input, errors, True) > > UnicodeDecodeError: 'utf8' codec can't decode byte 0xc4 in position > > 10

Re: Unicode Decode Error

2009-04-09 Thread MRAB
reetesh nigam wrote: Hi All, There is some special character in my database. and when try to show on my UI it says return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xc4 in position 10: unexpected end of data Can any one help to solve this p

Unicode Decode Error

2009-04-09 Thread reetesh nigam
Hi All, There is some special character in my database. and when try to show on my UI it says return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xc4 in position 10: unexpected end of data Can any one help to solve this problem -- http://mail.p