Mysterious xml.sax Encoding Exception

JKPeck JKPeck at gmail.com
Fri Feb 1 16:12:52 EST 2008


On Feb 1, 1:51 pm, "Martin v. Löwis" <mar... at v.loewis.de> wrote:
> > They sent me the actual file, which was created on Windows,  as an
> > email attachment.  They had also sent the actual dataset from which
> > the XML was generated so that I could generate it myself using the
> > same version of our app as the user has.  I did that but did not get
> > an exception.
>
> So are you sure you open the file in binary mode on Windows?
>
> Regards,
> Martin

In the real case, the xml never goes through a file but is handed
directly to the parser.  The api return a Python Unicode string
(utf-16).  For the file the user sent, if I open it in binary mode, it
still has a BOM; otherwise the BOM is removed.  But either version
works on my system.

The basic fact, though, remains, the same code works for me with the
same input but not for two particular users (out of hundreds).

Regards,
Jon



More information about the Python-list mailing list