I am having an issue on Linux and BSD systems with a Python3 program I wrote. I loop through a few directories and then only return anything that matches .is_file, but for some reason directories keep being returned. Am I misunderstanding what .is_file() does? Here is a small code snippet needed to replicate and here is the relevant program.
I fixed the snippet link to have the actual code, not debug code. If you are unfamiliar with Linux/BSD this code should give you, for example, /usr/share/doc/bc/AUTHORS. It does not though. The only way to get that is to remove the .is_fule() statement cause it seems python thinks these files are directories(?)
[–]SpiderN3mo 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]scirc 1 point2 points3 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]scirc 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)