An AttributeError
jest wywoływany, gdy używam przykładowy kod z dokumentacji Pythona (here). Przykładowy kod jest następujący:z os.scandir() podnosi AttributeError: __exit__
with os.scandir(path) as it:
for entry in it:
if not entry.name.startswith('.') and entry.is_file():
print(entry.name)
Rezultatem jest AttributeError
:
D:\Programming>test.py
Traceback (most recent call last):
File "D:\Programming\test.py", line 3, in <module>
with os.scandir() as it:
AttributeError: __exit__
Chociaż, przypisując os.scandir()
do zmiennej działa dobrze. Czy ktoś może mi powiedzieć, czego mi brakuje?
To wszystko. Nadal byłem na 3.5.2.3.6 działa idealnie, dzięki! –