files.makedirs has no apparent effect
See original GitHub issuebad:
files.download(src=... dest=dl)
files.makedirs(local, exist_ok=True) # this has no effect
server.shell([
f"aunpack --extract-to={local} {dl}",
])
--> Starting operation: Files/Download (src=https://github.com/kovidgoyal/kitty/releases/download/v0.24.4/kitty-0.24.4-x86_64.txz, dest=/tmp/kitty-0.24.4-x86_64.txz)
[slash] No changes
--> Starting operation: Server/Shell (['aunpack --extract-to=/home/drewp/.local/kitty /tmp/kitty-0.24.4-x86_64.txz'])
[slash] tar: /home/drewp/.local/kitty: Cannot open: No such file or directory
[slash] tar: Error is not recoverable: exiting now
[slash] aunpack: xz ... | tar ...: non-zero return-code
[slash] Error
good:
files.download(src=... dest=dl)
files.makedirs(local, exist_ok=True)
server.shell([
f"mkdir -p {local}", # this workaround fixed it
f"aunpack --extract-to={local} {dl}",
])
--> Starting operation: Files/Download (src=https://github.com/kovidgoyal/kitty/releases/download/v0.24.4/kitty-0.24.4-x86_64.txz, dest=/tmp/kitty-0.24.4-x86_64.txz)
[slash] No changes
--> Starting operation: Server/Shell (['mkdir -p /home/drewp/.local/kitty', 'aunpack --extract-to=/home/drewp/.local/kitty /tmp/kitty-0.24.4-x86_64.txz'])
[slash] Success
–> Support information:
If you are having issues with pyinfra or wish to make feature requests, please
check out the GitHub issues at https://github.com/Fizzadar/pyinfra/issues .
When adding an issue, be sure to include the following:
System: Linux
Platform: Linux-5.13.0-30-generic-x86_64-with-glibc2.34
Release: 5.13.0-30-generic
Machine: x86_64
pyinfra: v1.7
Executable: env/bin/pyinfra
Python: 3.9.9 (CPython, GCC 10.3.0)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
os.makedirs wrongly catches extension-less files for directory ...
There is a file: readme and it has no extension. It gets caught in the os.makedirs(directory) claiming that the file exists.
Read more >Issue 5220: os.makedirs' mode argument has bad default value
My misunderstanding stemmed from recently coming across two widely-used packages which both pass mode=0750 to os.makedirs. I have no idea ...
Read more >os.makedirs() / os.mkdir() on Windows. No error, but ... - Reddit
Finally, I fixed it by replacing the relative path with the absolute path of the parent directory that I would like to execute...
Read more >Python | os.makedirs() method - GeeksforGeeks
os.makedirs() method in Python is used to create a directory recursively. ... path: A path-like object representing a file system path.
Read more >Why you should be using pathlib - Trey Hunner
I hope that this article will inspire you to use Python's pathlib module pretty much anytime you need to work with files in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Whoa, I never knew
__all__
was only to controlimport *
!Your fix sgtm.
Me either, only discovered it looking into this!
v2 + 1.7.1 include the fix as above.