Message370380
Currently, the csv library calls str() on each value it writes. This can lead to surprising behavior, see issue40762 for example.
On the other hand, for writing the documentation says that the values must be strings or numbers.
The proposed "strict" argument would raise a TypeError if the supplied values are not strings, numbers, or None.
See https://github.com/python/cpython/blob/ba1c2c85b39fbcb31584c20f8a63fb87f9cb9c02/Modules/_csv.c#L1203 for where str() is called.
The documentation should be changed to note that None is allowed. Currently, None results in an empty string. I'm not proposing to change this, just document it as one of the allowed types.
How to check for "value is a number" needs to be decided. |
|
Date |
User |
Action |
Args |
2020-05-30 12:31:33 | eric.smith | set | recipients:
+ eric.smith |
2020-05-30 12:31:33 | eric.smith | set | messageid: <1590841893.39.0.979050889653.issue40825@roundup.psfhosted.org> |
2020-05-30 12:31:33 | eric.smith | link | issue40825 messages |
2020-05-30 12:31:32 | eric.smith | create | |
|