[MRG+1] Doc: binary mode is required for exporters #2564
Merged
Conversation
While XmlItemExporter works with text files, I'm not sure it is intentional. For example, 'encoding' argument doesn't work properly with XmlItemExporter + text files. |
docs/topics/exporters.rst
Outdated
@@ -281,7 +281,8 @@ CsvItemExporter | |||
CSV columns and their order. The :attr:`export_empty_fields` attribute has | |||
no effect on this exporter. | |||
|
|||
:param file: the file-like object to use for exporting the data. | |||
:param file: the file-like object to use for exporting the data. It's ``write`` method should |
kmike
Feb 14, 2017
Member
its
its
elacuesta
Feb 14, 2017
Author
Member
oops
oops
Right, the following:
Fails in python 2, it seems like the binary mode is more consistent. I'll add the note to the |
Codecov Report
@@ Coverage Diff @@
## master #2564 +/- ##
=======================================
Coverage 83.59% 83.59%
=======================================
Files 161 161
Lines 8812 8812
Branches 1296 1296
=======================================
Hits 7366 7366
Misses 1200 1200
Partials 246 246 Continue to review full report at Codecov.
|
Looks good, thanks @elacuesta! |
Thanks to you and @TDominiqueWilliams |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Closes #2553
I leftXmlItemExporter
out of the modifications, it's the only class which does not seem to have problems writing to eitherbytes
orstr
streams (io.BytesIO
orio.StringIO
, for instance).outputs:
/cc @kmike