-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix not throwing the same error as CPython in test_pathlib.test_expanduser #5578
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
Fix not throwing the same error as CPython in test_pathlib.test_expanduser #5578
Conversation
…of a non-existent user Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
Thanks. If related tests don't exist in test_pwd, could you add the described test under |
Not sure what other tests I can add tbh.. |
@hbina I added a test file by copying the code you wrote. But when I ran the test on main branch, it didn't fail. That's maybe because I am on mac machine. Could you check if the test I added is failing without your patch on your machine, and add a commit message details that which environment causes that incompatibility? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for checking
…duser (RustPython#5578) * Fix not throwing the same error as CPython when trying to expanduser of a non-existent user Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com> * add pwd test * Skip pwd test on windows --------- Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com> Co-authored-by: Jeong YunWon <jeong@youknowone.org> Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
Given,
Currently, in CPython,
Whereas, in RustPython,
AFAIK, CPython doesn't care what kind of errors happen underneath.
See https://github.com/python/cpython/blob/a42168d316f0c9a4fc5658dab87682dc19054efb/Modules/pwdmodule.c#L270-L279