Skip to content

Fix Windows path handling for cloud storage #52

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

smbrandonjr
Copy link

Use posixpath.join instead of os.path.join to ensure consistent forward slashes for cloud storage paths across all platforms. This resolves the FileNotFoundError: b//o on Windows.

Description

This PR fixes an issue with path handling on Windows platforms. The problem occurs because os.path.join() uses backslashes (\) as path separators on Windows, but cloud storage systems like GCS require forward slashes (/).

Changes Made

  • Added a helper method _join_cloud_path to handle cloud storage path joining consistently across platforms
  • Used posixpath.join() instead of os.path.join() for all cloud storage path operations
  • Added debug logging to help diagnose path-related issues

Testing

Tested and confirmed working on Windows 11 Pro.

Issue

Fixes the FileNotFoundError: b//o error when using the library on Windows.

Use posixpath.join instead of os.path.join to ensure consistent
forward slashes for cloud storage paths across all platforms.
This resolves the FileNotFoundError: b//o on Windows.
Replace os.path.join with posixpath.join in dataset_fsreader.py to ensure
consistent forward slashes when accessing cloud storage on Windows.
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