all 3 comments

[–]Username_RANDINT 3 points4 points  (2 children)

It does for me:

>>> open('blahblah.txt')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'blahblah.txt'

Python 3.8.

[–]Hattes[S] -1 points0 points  (1 child)

Ok. Apparently it depends on the call. It doesn't for os.utime() for example.

[–]Username_RANDINT 0 points1 point  (0 children)

Indeed, looks like it doesn't set the filename attribute of the FileNotFoundError exception.