Skip to content

Use PurePosixPath instead of PosixPath for platform-independent compatibility (Windows fix) #716

@PaulH97

Description

@PaulH97

Hi,
I encountered an issue when running earthaccess on Windows. When trying to create a virtual xarray.Dataset using virtualizarr, I received the following error:

UnsupportedOperation: cannot instantiate ‘PosixPath’ on your system

Here’s the minimal code that triggered the issue:

import earthaccess
earthaccess.login()
results = earthaccess.search_data(
    count=2,
    temporal=("2023"),
    short_name="SWOT_L2_LR_SSH_Expert_2.0"
)
vds = earthaccess.open_virtual_dataset(results[0], access="indirect", load=False)

After investigating, I found that replacing PosixPath with PurePosixPath in your manifest.py file fixed the issue. This allows the code to run correctly on Windows.

If cross-platform compatibility is a goal, switching to PurePosixPath may be a simple fix to improve support for Windows users.

Thanks for your work on this great library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions