-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: type object 'Path' has no attribute '_flavour' #553
Comments
The call stack does not match your |
Sorry, I have edited it now. |
Just for the record: the problem here is that while the |
I'm am getting this error in 2022. NOTE: I'm using Python 3.7.3 on Debian 10 Buster for my unit testing, and my real code runs on Python 2.7.16 (with pathlib2) on a Debian 10 Buster embedded system (yes, I know 2.7 is unmaintained - the migration to Python 3 is on my wish list). Is there a 3rd party (updated) version of pathlib.Path which can be used as an alternative, perhaps? I noticed Thanks :) |
I can confirm installing |
@BrendanSimon - this specific problem has been fixed with the commit that closed this issue - it had to do with If I understand this correctly, your problem was using |
@mrbean-bremen I guess this problem still remains. In case of pyfakesfs usage when you try to construct a Path The reason is located here
This leads to more or less this call when using the pyfakefs
The error is indicated like this:
For sake of completion (I already tried to reload some modules but it won't work ...)
|
I was able to narrow down this problem. It seems to occur because Pydantic constructs its models with the original path cls and pyfakefs is later patching it. if I subclass the model in my unitest it works, because the validators get built with the patched Path version internally.
|
Ah yes, this is a known limitation. |
Describe the bug
pathlib claims that Path has no _flavour when module is marked for skip. When the module is not marked for skip it works just fine.
How To Reproduce
I have the following setup:
test.py:
my_file.py:
Your enviroment
The output is as follows:
The text was updated successfully, but these errors were encountered: