Bugs item #1599055, was opened at 2006-11-18 20:47 Message generated for change (Comment added) made by shday You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1599055&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Stephen Day (shday) Assigned to: Nobody/Anonymous (nobody) Summary: csv module does not handle '\x00' Initial Comment: The following from an interactive session failed instead of just returning the '\x00': >>> r = csv.reader(['a,line,with,a,null,\x00,byte']) >>> r.next() Traceback (most recent call last): File "<pyshell#31>", line 1, in -toplevel- r.next() Error: string with NUL bytes >>> ---------------------------------------------------------------------- >Comment By: Stephen Day (shday) Date: 2006-11-19 12:08 Message: Logged In: YES user_id=948502 Originator: YES I've been using the csv module to parse data coming from a serial port of a lab instrument. Occasionally the instrument transmits a lone /x00 (maybe when the power cycles, I'm not sure). Anyhow, I'm now using a try-except statement to catch the error. I guess my answer to your question is that I think the module should handle whatever string you pass it. Is there a specific reason not to handle /x00? ---------------------------------------------------------------------- Comment By: Georg Brandl (gbrandl) Date: 2006-11-19 10:09 Message: Logged In: YES user_id=849994 Originator: NO Why do you think a CSV reader should support null bytes? CSV is a text format, not a binary one. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1599055&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com