-
Notifications
You must be signed in to change notification settings - Fork 93
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
Spec for fake os.strerror() #202
Comments
This is a very sensible thing to do - setting 3.4 milestone. |
@jmcgeheeiv - please check if this is what you had in mind. |
Fixed by this commit, please reopen if something is missing. |
As pyfakefs users know, it is very useful for errors and exceptions to mention "fake file system".
While fixing a bug in fakefs related to exceptions, I noticed a nice way to add "fake file system" to the canonical error messages returned by
os.strerror()
.In fake
os
, defineos.strerror()
as something like this:where the
os.strerror()
used within the function is the realos.strerror()
.The English grammar of this message should be correct in all cases. Meanwhile, we can guarantee that
startswith()
can be used to detect the error message for both the real and fake file systems:Then, all occurrences of literal string messages within pyfakefs should be replaced with the fake
os.strerror()
.The text was updated successfully, but these errors were encountered: