This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test for writing dictionary rows to CSV
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, mjehanzeb, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2013-08-13 16:01 by mjehanzeb, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue18727.patch mjehanzeb, 2013-08-13 16:08 test for writing dictionary rows to CSV
issue18727_v2.patch mjehanzeb, 2013-08-14 20:11
issue18727_v3.patch mjehanzeb, 2013-08-19 01:26 update using StringIO.getvalue()
Messages (7)
msg195083 - (view) Author: Muhammad Jehanzeb (mjehanzeb) * Date: 2013-08-13 16:01
Test for writing dictionary rows to further enhance the test coverage of CSV lib.
msg195144 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-08-14 12:33
You can probably use a StringIO for the file object, no need to create a temporary file.
msg195211 - (view) Author: Muhammad Jehanzeb (mjehanzeb) * Date: 2013-08-14 20:11
Thanks Antoine,

Attached is the updated version of patch using StringIO
msg195270 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-08-15 18:27
Thanks. One more question: is there a reason you don't simply call getvalue() at the end (rather than seek(0) followed by several readline() calls)?
msg195592 - (view) Author: Muhammad Jehanzeb (mjehanzeb) * Date: 2013-08-19 01:26
Sure. Thanks for the comment. I was just trying to be consistent with other tests. However, I updated the patch based on your recommendation. Please have a look at the latest one.
msg217454 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-04-28 23:58
New changeset 2502843dbedf by Antoine Pitrou in branch 'default':
Issue #18727: improve test coverage of the csv module by testing for DictWriter.writerows.
http://hg.python.org/cpython/rev/2502843dbedf
msg217455 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-04-28 23:59
Hi Muhammad,
Sorry, I had forgotten about this issue. I have now committed the patch to 3.5. Thanks for your contribution!
History
Date User Action Args
2022-04-11 14:57:49adminsetgithub: 62927
2014-04-28 23:59:31pitrousetstatus: open -> closed
versions: + Python 3.5, - Python 3.4
messages: + msg217455

resolution: fixed
stage: patch review -> resolved
2014-04-28 23:58:41python-devsetnosy: + python-dev
messages: + msg217454
2013-08-19 01:26:27mjehanzebsetfiles: + issue18727_v3.patch

messages: + msg195592
2013-08-15 18:27:24pitrousetmessages: + msg195270
2013-08-14 20:11:24mjehanzebsetfiles: + issue18727_v2.patch

messages: + msg195211
2013-08-14 12:33:00pitrousetversions: + Python 3.4, - Python 3.3
nosy: + pitrou

messages: + msg195144

stage: patch review
2013-08-13 16:08:12mjehanzebsetfiles: + issue18727.patch
keywords: + patch
2013-08-13 16:01:15mjehanzebcreate