[Python] Appears when using iterdir () etc. [Errno 20] Not a directory:'*** / .DS_Store'

When I use iterdir () etc. in Python, I get an error like the title. It comes out when a function cannot be executed due to a hidden file called .DS_Store, which is unique to the Mac. The workaround is to just delete the .DS_Store.

What is .DS_Store in the first place?

.DS_Store is a file for the Finder to record folder settings. Reference site

Coping

You can use the viewfinder or the command line to erase it.

On the command line Go to the folder that contains the disturbing .DS_Store

find . -name ".DS_Store" -delete

Erase with. Reference site

It's finished.

Recommended Posts

[Python] Appears when using iterdir () etc. [Errno 20] Not a directory:'*** / .DS_Store'
What to do when [Errno 2] No such file or directory appears in Python
There is a pattern that the program did not stop when using Python threading
A memo when creating a directed graph using Graphviz in Python
Python list is not a list
Create a directory with python
I got a TypeError:'int' object is not iterable when using keras
Half-width katakana characters are not garbled when using python + selenium execute_script
I get a can't set attribute when using @property in python
A note on using tab completion when running Python interactively on Windows
When a Python beginner tried using Bottle, it worked unexpectedly easily.
A memorandum when using beautiful soup
Precautions when using pit in Python
I made a Line-bot using Python!
Create a python GUI using tkinter
[Python] Be careful when using print
Precautions when creating a Python generator
Precautions when using phantomjs from python
When using MeCab with virtualenv python
Precautions when using six with Python 2.5
[VS Code] ~ Tips when using python ~
When using regular expressions in Python
When writing a program in Python
Check points when MIDI does not work in a program using SDL_mixer
A memo when setting up a Docker container for using JUMAN ++, KNP, python
A useful note when using Python for the first time in a while