mentorship-backend
mentorship-backend copied to clipboard
OSError in Windows not being caught
Describe the bug
When there is some invalid argument, we expect it to be caught by python under ValueError.
But In the case of passing invalid timestamp in test test_dao_create_mentorship_relation_with_good_args_but_invalid_timestamp.
It get's caught on other OS, but for Windows It throws OSError (Another Exception) which is not getting caught by ValueError.
To Reproduce (Steps for windows only)
- Run python unittests (there should be one test failure)
- See the error
Expected behavior The test should pass and no test should have been failed.
Screenshots

Desktop (please complete the following information):
- OS: Windows
Hi @anitab-org/mentorship-managers , please have a look at this issue I'm facing some issue while checking it out on my laptop
@isabelcosta I would like to work on this issue!
@BadduCoder I have assigned you, let me know if you have any questions.
Hey @BadduCoder , what's the status for your PR?
@adi-001 You can work on this issue if you want, I am pretty busy with multiple things on my hand.
@devkapilbansal @gaurivn can you reproduce this issue locally , I don't get this error .
Closing as the issue no longer exists
Reopening as the error still exists 👀
Thank you @vj-codes for reopening this ticket after spotting this issue 💪🏾 I took a brief look at the PR https://github.com/anitab-org/mentorship-backend/pull/621 which was closed and it was almost there, it just needed a few changes.
Also looking at https://docs.python.org/3/library/datetime.html#datetime.date.fromtimestamp, I noticed that after python 3.3, this function throws either OverflowError or OSError, so I guess ValueError does not make sense at this time we are using python 3 > 3.3.
I'll leave it to the contributor who works on this to lead the implementation :)
cc @anitab-org/mentorship-maintainers