Skip to content

fixes platform-dependent expectation for Multi30k mocked test. #1593

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

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

erip
Copy link
Contributor

@erip erip commented Feb 8, 2022

Tests currently fail on Windows because multi30k doesn't strip newlines and therefore the file is read with carriage returns: "ABCD\r\n" != "ABC\n". This fixes the bug by stripping newlines from Multi30k to be consistent with other datasets.

Technically this is a BC and users can revert it in userland code by appending os.linesep to each line as needed.

@parmeet
Copy link
Contributor

parmeet commented Feb 8, 2022

Thanks @erip for the catch. I looked at other tests that are doing the same, but are not failing because the newline is stripped. Per our discussions in this PR #1559, I wonder if we should instead strip newline from Multi30K dataset as well?

@erip
Copy link
Contributor Author

erip commented Feb 8, 2022

That would certainly be less kludgy! 🤣 I've repurposed this PR.

@erip erip force-pushed the hotfix/multi30k-test branch from 990f981 to e2b1550 Compare February 8, 2022 15:43
Copy link
Contributor

@parmeet parmeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix.

@parmeet parmeet merged commit da34de2 into pytorch:main Feb 8, 2022
@erip erip deleted the hotfix/multi30k-test branch February 8, 2022 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants