diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-11-02 13:49:02 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-11-02 13:49:02 (GMT) |
commit | 43c336b1078f531f444681f4cbe1a0db2b85a6d9 (patch) | |
tree | 952f6d88a0cc35e53641d760e77feb7ee0b184ad /Lib/test | |
parent | faf1d06fb6636e6792330f9edaeb443a0b5cadf6 (diff) | |
parent | e6996ed5d9c3ce149a8384a625521ab5a0820ae3 (diff) | |
download | cpython-43c336b1078f531f444681f4cbe1a0db2b85a6d9.zip cpython-43c336b1078f531f444681f4cbe1a0db2b85a6d9.tar.gz cpython-43c336b1078f531f444681f4cbe1a0db2b85a6d9.tar.bz2 |
Merge 3.3.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_csv.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py index 55796a2..96f8aa7 100644 --- a/Lib/test/test_csv.py +++ b/Lib/test/test_csv.py @@ -197,6 +197,17 @@ class Test_Csv(unittest.TestCase): fileobj.seek(0) self.assertEqual(fileobj.read(), "a,b\r\nc,d\r\n") + @support.cpython_only + def test_writerows_legacy_strings(self): + import _testcapi + + c = _testcapi.unicode_legacy_string('a') + with TemporaryFile("w+", newline='') as fileobj: + writer = csv.writer(fileobj) + writer.writerows([[c]]) + fileobj.seek(0) + self.assertEqual(fileobj.read(), "a\r\n") + def _read_test(self, input, expect, **kwargs): reader = csv.reader(input, **kwargs) result = list(reader) |