Pathlib relative_to issue on python 3.13+ #1312
Replies: 5 comments
-
|
Thanks for the report! I will see if I can find a possibility to make this work again - probably need to re-implement |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the docs reference. I never found that entry with all the search power (and LLMs) I could muster. Now at least I know how the problem manifests and how to work around it in the meantime. |
Beta Was this translation helpful? Give feedback.
-
|
Sorry - forgot to follow up on this. I had tried to make this work, but this would only fix half of it - I can get the fake path work with the real one, but not vice verse. I had the same problem before, and decided to leave it as is (as a limitation), as long as I haven't got a better idea how to handle this. |
Beta Was this translation helpful? Give feedback.
-
|
Fine with me. Now that we know what is causing it, we can generally work around it in our test code. |
Beta Was this translation helpful? Give feedback.
-
|
I have thought about this a bit more, but haven't found a sensible way to change this. This is the same limitation that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
pathlib relative_to fails with pyfakefs in testing. This only happens on python 3.13 and 3.14. 3.12 works fine with the test.
This code runs fine in production.
Note that the bug doesn't manifest itself if you do not have the dataclass and the sub-function called. This was the simplest reproducer I could come up with to showcase the error.
The bug still happens with pyfakefs 6.1.0
How To Reproduce
Your environment
Beta Was this translation helpful? Give feedback.
All reactions