Skip to content

Conversation

@goravaa
Copy link

@goravaa goravaa commented Mar 23, 2025

This pull request addresses a Windows compatibility issue in the copy() function. I encountered errors on Windows due to the absence of rsync (which is typically not installed by default), while Windows usually has scp available. To resolve this, the function now:

Checks the platform and rsync availability:
Uses Python’s platform module and shutil.which() to detect if the script is running on Windows or if rsync is missing.

Applies a fallback mechanism:
If running on Windows or if rsync is not available, the function builds and executes an scp command for file transfers.

Conditional use of sudo:
On non-Windows systems, the command prepends sudo (via a sudo_prefix variable) to the rsync command to ensure proper permissions. On Windows, sudo is skipped.

Inline comments for clarity:
Added comments throughout the function to explain these changes.

These modifications ensure that the file copy operations work correctly across both Windows and Unix-like systems. This change fixes the issue I faced on Windows by using a more suitable tool (scp) when rsync is not available while preserving the existing functionality on other platforms.

@kristopolous
Copy link
Contributor

I merge this from the vast-ai cli ... i can look into doing that fix there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants