What is the standard way to access external files in $HOME?

I have a Python script that used to work a few months ago, but is suddenly broken. It seems the behaviour of setting the $HOME variable has changed. Whereas $HOME used to be /home/teresaejunior, now I get /home/teresaejunior/snap/snapname/x53.

Maybe this is a bug in that if a program wants to access $HOME and sets plugs: [home], it expects to access the user’s files without further modifications to the source code…?

Anyway, if I set plugs: [home], what is the standard way to access the user’s files? I’ll be using /home/$USER as a workaround for now.

The symbolic links point to the xdg-user-dirs directories will be created by ubuntu/snapcraft-desktop-helper’s desktop-launch launcher if these directories are accessible.

None of them point to HOME, though:

teresaejunior@laptop ~> snap run --shell name.command
teresaejunior@laptop:/home/teresaejunior$ env | grep XDG
XDG_VTNR=7
XDG_SESSION_ID=c2
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/teresaejunior
XDG_MENU_PREFIX=xfce-
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CONFIG_DIRS=/etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg
XDG_SESSION_TYPE=x11
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=xubuntu
XDG_DATA_DIRS=/usr/share/xubuntu:/usr/share/xfce4:/usr/local/share:/usr/share:/var/lib/snapd/desktop:/usr/share
XDG_RUNTIME_DIR=/run/user/1000/snap.kml-maintenance
XDG_CURRENT_DESKTOP=XFCE
teresaejunior@laptop ~> snap version
snap    2.35
snapd   2.35
series  16
ubuntu  18.04
kernel  4.15.0-33-generic