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

test: is the leading slash breaking Windows tests? #1178

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

jpivarski
Copy link
Member

I'll try removing the slash, putting it back in, and if that's it, I'll exclude it on Windows.

It's making paths like

/C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_fsspec_writing_local_uri_24\some\path\my%E2%80%92file.root

which at some point become D:/C:. Right about here:

C:\Users\runneradmin\miniconda3\envs\test\lib\site-packages\uproot\sink\file.py:53: in __init__
    self._truncate_file(urlpath_or_file_like, **storage_options)
        self       = <uproot.sink.file.FileSink object at 0x00000295EDA4AFD0>
        storage_options = {}
        urlpath_or_file_like = '/C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_fsspec_writing_local_uri_24\\some\\path\\my%E2%80%92file.root'
C:\Users\runneradmin\miniconda3\envs\test\lib\site-packages\uproot\sink\file.py:80: in _truncate_file
    fs.mkdirs(parent_directory, exist_ok=True)
        cls        = <class 'uproot.sink.file.FileSink'>
        fs         = <fsspec.implementations.local.LocalFileSystem object at 0x00000295DEE2BC70>
        local_path = 'D:/C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/test_fsspec_writing_local_uri_24/some/path/my%E2%80%92file.root'
        parent_directory = 'D:/C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/test_fsspec_writing_local_uri_24/some/path'
        storage_options = {}
        urlpath    = '/C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_fsspec_writing_local_uri_24\\some\\path\\my%E2%80%92file.root'

The local_path returned by

fs, local_path = fsspec.core.url_to_fs(urlpath, **storage_options)

has D:/C:, and apparently that didn't happen before. Was there a recent change, @martindurant? (It looks like it might have been wrong before, correct now, and this Uproot test has to catch up.)

@jpivarski
Copy link
Member Author

Yes, I've seen enough test results to know that that was it. I think the correct fix is to test a leading \ on Windows and a leading / on Linux and MacOS.

Once this works, I'm going to merge it into main and from there, all of the active PRs so that some of them can get merged.

@jpivarski
Copy link
Member Author

ReadTheDocs is failing because it can't pull this commit from GitHub. ?!?!?!?!?! Okay, I'm just going to merge it, so that I can get this into all of the other PRs.

@jpivarski jpivarski disabled auto-merge March 20, 2024 18:19
@jpivarski jpivarski merged commit e727daa into main Mar 20, 2024
20 of 21 checks passed
@jpivarski jpivarski deleted the jpivarski/is-this-what-is-breaking-windows branch March 20, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant