summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-11-02 13:49:02 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-11-02 13:49:02 (GMT)
commit43c336b1078f531f444681f4cbe1a0db2b85a6d9 (patch)
tree952f6d88a0cc35e53641d760e77feb7ee0b184ad /Lib/test
parentfaf1d06fb6636e6792330f9edaeb443a0b5cadf6 (diff)
parente6996ed5d9c3ce149a8384a625521ab5a0820ae3 (diff)
downloadcpython-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.py11
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)