I'm supposed to ask the user to enter a directory and if the directory doesn't exist, we tell them and then make a directory for them.
This is my code so far. It acts in the same way whether or not the directory whose path is entered actually exists. This occurs when using pathlib on windows. Bug Reported Issue35692
import pathlib
from pathlib import Path
def directory():
p = Path(input("Enter file path: "))
if p.exists:
print('Exists')
return p
else:
print('Directory does not exist. Making directory for you.')
p.mkdir()
directory()