Closed aaraney closed 1 month ago
Digging a bit more into this, python
3.12
's pathlib
added a __init__
implementation to pathlib.PurePath
(this is what all pathlib
types inherit from). pahtlib.PurePath.__init__
sets a few instance variables that previous versions of python didnt as they did not explicitly implement __init__
.
This explains why we are seeing this issue in 3.12
b.c. __init__
is not being called after __new__
.
https://github.com/NOAA-OWP/ngen-cal/blob/0f5843d713e76fb0a23eef6e25e4d75d789b2f7d/python/ngen_conf/src/ngen/config/path_pair/path_pair.py#L86
A change in
pathlib.PurePath
introduced inpython
3.12
seems to cause an issue when trying to call__str__
(or__repr__
) on aPathPair
instance. The face value solution is to explicitly "setup" thePosixPathPath
orWindowsPathPair
instance by calling it's__init__
method. I need to investigate why this is the case document any repercussions of this solution.