fix newline stripping in plain text readers#174
Closed
pmeier wants to merge 1 commit intometa-pytorch:mainfrom
Closed
fix newline stripping in plain text readers#174pmeier wants to merge 1 commit intometa-pytorch:mainfrom
pmeier wants to merge 1 commit intometa-pytorch:mainfrom
Conversation
This was referenced Jan 20, 2022
Contributor
Author
|
The other failure is valid and will be fixed in pytorch/vision#5227 |
NivekT
approved these changes
Jan 20, 2022
Contributor
NivekT
left a comment
There was a problem hiding this comment.
LGTM! Thanks for fixing this!
Contributor
|
@NivekT has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
ejguan
pushed a commit
to ejguan/data
that referenced
this pull request
Jan 21, 2022
Summary: Fixes meta-pytorch#173 Note that the [input to `strip`](https://docs.python.org/3/library/stdtypes.html#str.strip) > is a string specifying the **set of characters** to be removed. [Emphasis mine] Thus, stripping works something like ```python for char in chars: string.replace(char, "") ``` rather than ```python string.replace(chars, "") ``` This means that always stripping `"\r\n"` is harmless even if the line terminator is only `"\n"` or `\"r"`. Pull Request resolved: meta-pytorch#174 Reviewed By: ejguan Differential Revision: D33684458 Pulled By: NivekT fbshipit-source-id: 9821b77d60d3afe038ae698965beefe319783aa1
ejguan
added a commit
that referenced
this pull request
Jan 21, 2022
Summary: Fixes #173 Note that the [input to `strip`](https://docs.python.org/3/library/stdtypes.html#str.strip) > is a string specifying the **set of characters** to be removed. [Emphasis mine] Thus, stripping works something like ```python for char in chars: string.replace(char, "") ``` rather than ```python string.replace(chars, "") ``` This means that always stripping `"\r\n"` is harmless even if the line terminator is only `"\n"` or `\"r"`. Reviewed By: ejguan Differential Revision: D33684458 Pulled By: NivekT fbshipit-source-id: 9821b77d60d3afe038ae698965beefe319783aa1 [ghstack-poisoned]
ejguan
added a commit
that referenced
this pull request
Jan 21, 2022
Summary: Fixes #173 Note that the [input to `strip`](https://docs.python.org/3/library/stdtypes.html#str.strip) > is a string specifying the **set of characters** to be removed. [Emphasis mine] Thus, stripping works something like ```python for char in chars: string.replace(char, "") ``` rather than ```python string.replace(chars, "") ``` This means that always stripping `"\r\n"` is harmless even if the line terminator is only `"\n"` or `\"r"`. Reviewed By: ejguan Differential Revision: D33684458 Pulled By: NivekT fbshipit-source-id: 9821b77d60d3afe038ae698965beefe319783aa1 ghstack-source-id: 37a119b Pull Request resolved: #176
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #173
Note that the input to
stripThus, stripping works something like
rather than
This means that always stripping
"\r\n"is harmless even if the line terminator is only"\n"or\"r".