Q:

No error when stepping through in debug mode but AttributeError otherwise

Example code
from pathlib import Path

for f in Path(<dir>).iterdir():
    print(f._str)

I'm using it to pass to a function but not even this works when running normally or debug without a breakpoint. Using a breakpoint and stepping through it prints everything out just fine (_str is the total path!

A:

I'm really not sure what you are trying to do or print, but, yes, this throws an AttributeError. Probably because, well, ._str is not an attribute of the Path class. 
from pathlib import Path

for f in Path('/tmp').iterdir():
    print(f._str)

AttributeError: _str

This does print the full path.
for f in Path('/tmp').iterdir():
    print(f)

/tmp/com.apple.launchd.0CERUFd5eE
/tmp/com.apple.launchd.JLaC2VPWPS
/tmp/com.apple.launchd.jyIh6h3f8I

If you want just the names of the files & directories, do print(f.name)

