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

CI fails on Windows for test_delete_from_hub and test_xgetsize_private due to new-line character #6856

Closed
albertvillanova opened this issue May 2, 2024 · 1 comment · Fixed by #6857
Assignees
Labels
bug Something isn't working

Comments

@albertvillanova
Copy link
Member

albertvillanova commented May 2, 2024

CI fails on Windows for test_delete_from_hub after the merge of:

This is weird because the CI was green in the PR branch before merging to main.

FAILED tests/test_hub.py::test_delete_from_hub - AssertionError: assert [CommitOperat...\r\n---\r\n')] == [CommitOperat...in/*\n---\n')]
  
  At index 1 diff: CommitOperationAdd(path_in_repo='README.md', path_or_fileobj=b'---\r\nconfigs:\r\n- config_name: cats\r\n  data_files:\r\n  - split: train\r\n    path: cats/train/*\r\n---\r\n') != CommitOperationAdd(path_in_repo='README.md', path_or_fileobj=b'---\nconfigs:\n- config_name: cats\n  data_files:\n  - split: train\n    path: cats/train/*\n---\n')
  
  Full diff:
    [
        CommitOperationDelete(
            path_in_repo='dogs/train/0000.csv',
            is_folder=False,
        ),
        CommitOperationAdd(
            path_in_repo='README.md',
  -         path_or_fileobj=b'---\nconfigs:\n- config_name: cats\n  data_files:\n '
  ?                                                                       --------
  +         path_or_fileobj=b'---\r\nconfigs:\r\n- config_name: cats\r\n  data_f'
  ?                               ++          ++                     ++
  -                         b' - split: train\n    path: cats/train/*\n---\n',
  ?                                                                   ^^^^^^ -
  +                         b'iles:\r\n  - split: train\r\n    path: cats/train/*\r'
  ?                           ++++++++++                ++                        ^
  +                         b'\n---\r\n',
        ),
    ]
@albertvillanova albertvillanova added the bug Something isn't working label May 2, 2024
@albertvillanova albertvillanova self-assigned this May 2, 2024
@albertvillanova albertvillanova changed the title CI fails on Windows for test_delete_from_hub CI fails on Windows for test_delete_from_hub and test_xgetsize_private May 2, 2024
@albertvillanova
Copy link
Member Author

After investigation, I have found that when a local file is uploaded to the Hub, the new line character is no longer transformed to "\n": on Windows machine now it is kept as "\r\n".

Any idea why this changed?
CC: @lhoestq

@albertvillanova albertvillanova changed the title CI fails on Windows for test_delete_from_hub and test_xgetsize_private CI fails on Windows for test_delete_from_hub and test_xgetsize_private due to new-line character May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant