Skip to content
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

'OSError' object has no attribute 'message' #196

Open
gpavanb-osi opened this issue Sep 2, 2019 · 6 comments
Open

'OSError' object has no attribute 'message' #196

gpavanb-osi opened this issue Sep 2, 2019 · 6 comments
Labels

Comments

@gpavanb-osi
Copy link

Python : 3.7.4
OS : Mac OSX 10.14.3
Bug : 'OSError' object has no attribute 'message' when using sample method
Solution : message is deprecated in latest Python version. One must use msg while catching such exceptions

@mdbloice
Copy link
Owner

mdbloice commented Sep 2, 2019

Hi @gpavanb-osi, thanks for making the issue. What code are you running to make this error appear?

@gpavanb-osi
Copy link
Author

Hi @mdbloice, I'm running p.sample, which seems to be working without issues for a certain subset of my data set and fails with the above error for others. Unfortunately, I cannot share the dataset here.

Interestingly, the error disappears once I specify a save_format to PNG in my case.

@mdbloice
Copy link
Owner

Ok, well I am guessing that there is something up with the images that causes an exception, which then triggers a further exception as the keyword message is not understood by Python 3.7. Perhaps using PNG as the save format is the best workaround for now, I will work on replacing message with msg for compatibility with later versions of Python and maybe that fixes your issue (but I doubt that, as the message/msg issue is probably not the root cause of the error you are experiencing). Sorry I can't be of any more help.

@mdbloice mdbloice added the bug label Sep 11, 2019
@gpavanb-osi
Copy link
Author

No worries. There is a workaround for the time being.

@mdbloice
Copy link
Owner

Ok fine, in a next version I will fix the message/msg problem, maybe that sorts it out, maybe not. Anyway, thanks for making the issue.
Marcus.

@hanss0n
Copy link

hanss0n commented Mar 29, 2021

No worries. There is a workaround for the time being.

What is the workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants