Re: _csv.Error: string with NUL bytes

2007-05-03 Thread John Machin
On May 4, 3:40 am, [EMAIL PROTECTED] wrote: > On Thu, May 03, 2007 at 10:28:34AM -0700, [EMAIL PROTECTED] wrote: > > On May 3, 10:12 am, [EMAIL PROTECTED] wrote: > > > On Thu, May 03, 2007 at 09:57:38AM -0700, fscked wrote: > > > > > As Larry said, this most likely means there are null bytes in the

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I'm guessing that your file is in UTF-16, then -- Windows seems to do > that a lot. It kind of makes it *not* a CSV file, but oh well. Try > > print open("test.csv").decode('utf-16').read().replace("\0", > ">>>NUL<<<") > > I'm not terribly unicode-savvy, so I'll

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread dustin
On Thu, May 03, 2007 at 10:28:34AM -0700, [EMAIL PROTECTED] wrote: > On May 3, 10:12 am, [EMAIL PROTECTED] wrote: > > On Thu, May 03, 2007 at 09:57:38AM -0700, fscked wrote: > > > > As Larry said, this most likely means there are null bytes in the CSV > > > > file. > > > > > > Ciao, > > > >

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread IAmStarsky
On May 3, 10:12 am, [EMAIL PROTECTED] wrote: > On Thu, May 03, 2007 at 09:57:38AM -0700, fscked wrote: > > > As Larry said, this most likely means there are null bytes in the CSV > > > file. > > > > Ciao, > > > Marc 'BlackJack' Rintsch > > > How would I go about identifying where it is? >

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread dustin
On Thu, May 03, 2007 at 09:57:38AM -0700, fscked wrote: > > As Larry said, this most likely means there are null bytes in the CSV file. > > > > Ciao, > > Marc 'BlackJack' Rintsch > > How would I go about identifying where it is? A hex editor might be easiest. You could also use Python:

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread fscked
> for boxid, mac, activated, hw_ver, sw_ver, heartbeat, name, > > address, phone, country, city, in csvreader: > > _csv.Error: string with NUL bytes > > Exit code: 1 , 0001h > > As Larry said, this most likely means there are null bytes in the CSV file. > > Ciao,

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, fscked wrote: > The traceback is as follows: > > Traceback (most recent call last): > File "createXMLPackage.py", line 35, in ? > for boxid, mac, activated, hw_ver, sw_ver, heartbeat, name, > address, phone, country, city, in csvrea

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread fscked
mainbox.attrib["boxid"] = boxid indent(root) ElementTree(root).write('test.xml', encoding='UTF-8') The traceback is as follows: Traceback (most recent call last): File "createXMLPackage.py", line 35, in ? for boxid, mac, activated, hw_ver, sw_ver, heartbeat, name, address, phone, country, city, in csvreader: _csv.Error: string with NUL bytes Exit code: 1 , 0001h -- http://mail.python.org/mailman/listinfo/python-list

Re: _csv.Error: string with NUL bytes

2007-05-03 Thread Larry Bates
fscked wrote: > Anyone have an idea of what I might do to fix this? I have googled adn > can only find some random conversations about it that doesn't make > sense to me. > > I am basically reading in a csv file to create an xml and get this > error. > > I don't see any empty values in any fields

_csv.Error: string with NUL bytes

2007-05-03 Thread fscked
Anyone have an idea of what I might do to fix this? I have googled adn can only find some random conversations about it that doesn't make sense to me. I am basically reading in a csv file to create an xml and get this error. I don't see any empty values in any fields or anything... -- http://ma