Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV line recovery forces Windows line endings #1597

Closed
sinus-x opened this issue Aug 14, 2020 · 1 comment · Fixed by #2280
Closed

CSV line recovery forces Windows line endings #1597

sinus-x opened this issue Aug 14, 2020 · 1 comment · Fixed by #2280
Labels
bug Indicates an unexpected problem or unintended behavior component: core help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@sinus-x
Copy link
Contributor

sinus-x commented Aug 14, 2020

The recover_line_csv() function is joining data with \r\n, redgardless of the source file newlines:

tempdata = '\r\n'.join(self.tempdata) + '\r\n' if self.tempdata else ''

This means that bot test are failing even though the parsing succeeded, because the raw values do not match: there is a new CR byte. As a workaround, bot tests are replacing newlines in their test files to account for that, which is not ideal solution.

"raw": utils.base64_encode(SAMPLE_FILE.replace('\n', '\r\n')),

@ghost ghost added bug Indicates an unexpected problem or unintended behavior component: core labels Aug 19, 2020
@ghost
Copy link

ghost commented Aug 19, 2020

Yes, ideally the use line ending is detected in ParserBot.parse_csv and ParserBot.parse_csv_dict and then saved in the class or somewhere else.

@sebix sebix added the help wanted Indicates that a maintainer wants help on an issue or pull request label Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: core help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants