GoogleCloudPlatform / GoogleCloudPlatform/gsutil
WARNING: The following characters are invalid in Windows file and directory names: /:*?"<>| when using gcloud storage cp
- Dominant language
- Python
- Stars
- 918
- Forks
- 335
- PR merge metrics
- No merged PRs in 30d
Description
When using `gcloud storage cp --recursive "gs://some-bucket/orgs" .` on Windows, the copy operation of some (random) files fail with the following errors even though my file paths are not using any of the invalid characters on Windows:
```
WARNING: The following characters are invalid in Windows file and directory names: /:*?"<>|
Renaming \\?\C:\some\dir\data\123\456\some\data\123-abc-456-xyz_.gstmp to \\$3\C$1\some\dir\data\123\456\some\data\123-abc-456-xyz_.gstmpERROR: Task 'file://.\\data\\123\\456\\some\\data\\123-abc-456-xyz' failed: FileNotFoundError(2, 'The network path was not found.')
```
This causes these files to be missing from the copy operation.
I'm using the following versions:
```
Google Cloud SDK 566.0.0
bq 2.1.31
core 2026.04.24
gcloud-crc32c 1.0.0
gsutil 5.36
```
Contributor guide
Research direction
Start with the `gcloud storage cp --recursive` command on Windows using the versions reported in the issue, and reproduce the failed copy and rename. Trace the handling of the temporary `.gstmp` path and Windows filename validation; done means all files copy successfully without the invalid-character warning or FileNotFoundError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100