I’m working on a personal CLI automation project that uses virtualenv to create python virtual environments in directories for me (among loads of other things there’s no point describing here).
Anyway, I ran into a very tricky to solve bug(?) which turned out to be to do with how pathlib resolves a virtual environment’s python.
I’ve attached a succinct example using the REPL where I create a pathlib.Path object representing the currently active virtual environment’s python executable. All appears well and as expected.
But when I call .resolve() on that path, it returns a Path of my global system python (I don’t actually use my system python, I have pyenv instead).
I’ve tried googling and looking through bug trackers etc and can’t seem to find anything related.
I have fixed the problem in my project by resolving paths elsewhere and it works fine, just wondered if anyone can shed any light on this?