[GH-ISSUE #25] Windows OS folder generation bug #10

Closed
opened 2026-05-06 12:36:11 +02:00 by BreizhHardware · 1 comment

Originally created by @Lauro235 on GitHub (May 29, 2023).
Original GitHub issue: https://github.com/patrickchugh/terravision/issues/25

It looks like windows os need to have folder names wrapped with ':' in quotation marks or escape them with a '\'

  File "C:\Users\user\terravision\modules\fileparser.py", line 40, in find_tf_files
    source_location = gitlibs.clone_files(source, temp_dir.name)

  File "C:\Users\user\terravision\modules\gitlibs.py", line 169, in clone_files
    os.makedirs(module_cache_path)
  File "<frozen os>", line 225, in makedirs
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\user\\.terravision\\module_cache\\https:__github.com_futurice_terraform-examples.git__aws_aws_static_site'
Originally created by @Lauro235 on GitHub (May 29, 2023). Original GitHub issue: https://github.com/patrickchugh/terravision/issues/25 It looks like windows os need to have folder names wrapped with ':' in quotation marks or escape them with a '\\' ```txt File "C:\Users\user\terravision\modules\fileparser.py", line 40, in find_tf_files source_location = gitlibs.clone_files(source, temp_dir.name) File "C:\Users\user\terravision\modules\gitlibs.py", line 169, in clone_files os.makedirs(module_cache_path) File "<frozen os>", line 225, in makedirs NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\user\\.terravision\\module_cache\\https:__github.com_futurice_terraform-examples.git__aws_aws_static_site' ```
Author
Owner

@patrickchugh commented on GitHub (May 29, 2023):

Can you try to add this line after line 139 in modules\gitlibs.py ?

reponame = sourceURL.replace(":", "_")

<!-- gh-comment-id:1567266081 --> @patrickchugh commented on GitHub (May 29, 2023): Can you try to add this line after line 139 in modules\gitlibs.py ? ` reponame = sourceURL.replace(":", "_")`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/terravision#10
No description provided.