0

Expanding "~" using Pathlib gives the wrong path.

from pathlib import Path

ex = Path('~/Documents')
print(ex.expanduser())

I'm expecting "C:\Users{username}\Documents", but instead get "C:\WINDOWS\system32\config\systemprofile\Documents". Is there something wrong with my windows config?

Jordan Sim
  • 67
  • 9

1 Answers1

1

"C:\WINDOWS\system32\config\systemprofile" is the home directory for SYSTEM account. Are you running the script as serivce?

extratype
  • 92
  • 3