When executing a Python 3 script in a symbolic directory, I want to get the non-dereferenced path of the current directory. However, the default behavior of pathlib returns the derefenced path:
$ mkdir test1
$ ln -s test1 test2
$ cd test2
$ pwd
/home/myuser/test2
$ ipython3
Python 3.7.0 (default, Oct 9 2018, 10:31:47)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.1.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from pathlib import Path
In [2]: str(Path.cwd())
/home/myuser/test1
The behavior I want is to get "/home/myuser/test2" as that's where the 'script' (interpreter in this case) was executed from, preferably using pathlib.