Patches item #1767398, was opened at 2007-08-03 19:11
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1767398&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: None
Group: Python 3000
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Adam Hupp (hupp)
Assigned to: Nobody/Anonymous (nobody)
Summary: test_csv struni fixes + unicode support in _csv

Initial Comment:
This patch fixes test_csv.py for the struni branch and modifies _csv.c to 
support unicode strings.

Changes:

 1. The test_csv.py failures caused by bytes/str conflicts have been resolved.  

 2. Uses of mkstemp have been replaced with TemporaryFile in a 'with' block. 

 3. The _csv.c module now uses unicode for string handling.   I've uncommented 
the unicode read tests in test_csv.py, and added tests for writing unicode 
content and a unicode delimiter.

All tests are now passing on my system (linux).

----------------------------------------------------------------------

>Comment By: Skip Montanaro (montanaro)
Date: 2007-08-05 08:07

Message:
Logged In: YES 
user_id=44345
Originator: NO

Adam,

I've spent some time looking at this patch.  Bear in mind this is my first
foray into Py3k.  Still, I'm confused about what's going on here.  I'm
hoping you can help me understand the changes.  In parse_save_field, you
replaced PyString_FromStringAndSize with PyUnicode_FromUnicode, however in
get_nullchar_as_None you replaced it with PyUnicode_DecodeASCII.

When I execute the csv tests there are a number of assertion errors
related to the default delimiter.  The traceback goes something like this:

FAIL: test_writer_kw_attrs (__main__.Test_Csv)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_csv.py", line 88, in test_writer_kw_attrs
    self._test_kw_attrs(csv.writer, StringIO())
  File "Lib/test/test_csv.py", line 75, in _test_kw_attrs
    self.assertEqual(obj.dialect.delimiter, ':')
AssertionError: s'\x00' != ':'

Any idea how to solve that?  It looks to me like some Unicode buffer might
be getting interpreted as a char *, but I'm not sure.

Skip


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1767398&group_id=5470
_______________________________________________
Patches mailing list
Patches@python.org
http://mail.python.org/mailman/listinfo/patches

Reply via email to