Closed mgorny closed 3 years ago
Thank you for the repot @mgorny ! Would you mind submitting a Pull Request?
I actually hoped you know the code better and know where these paths are added. If you can tell me that, I can try. However, I'm really short on time these days.
@mgorny
I think the root of the problem is this line, where we're returning a Path
objects instead of a string.
I can write the Pull Request, but I'd like for you to try my changes to see if they fix your issue.
@fcurella We've started seeing this issue today the first time without any code changes or upgrades on Faker. The only change was the upgrade from Python 3.8.9 to 3.8.10 after which this issue started to happen.
Can confirm pinning Python to 3.8.9 (instead of 3.8.10) was a workaround for us too
After looking into it, we were running Faker 6.6.3 which didn't include the patch referenced by this issue. Pinning Faker to 8.1.2 fixed this for us on Python 3.8.10 (previously we didn't have Faker pinned as we're using it as a peer dependency of Factory Boy)
After importing
faker
, entries withPosixPath
objects are added as keys tosys.path_importer_cache
. However, the keys are supposed to be regularstr
s there, and the wrong type breaks software relying onstr
methods being available, e.g. astroid:Note that since Faker installs a pytest plugin, it is autoloaded by default in all programs' test suites.
Steps to reproduce
Expected behavior
The printed dict should only contain
str
keys.Actual behavior