Augmentor icon indicating copy to clipboard operation
Augmentor copied to clipboard

'OSError' object has no attribute 'message'

Open gpavanb-osi opened this issue 5 years ago • 6 comments

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

gpavanb-osi avatar Sep 02 '19 05:09 gpavanb-osi

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

mdbloice avatar Sep 02 '19 07:09 mdbloice

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.

gpavanb-osi avatar Sep 03 '19 05:09 gpavanb-osi

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 avatar Sep 11 '19 08:09 mdbloice

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

gpavanb-osi avatar Sep 11 '19 08:09 gpavanb-osi

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.

mdbloice avatar Sep 11 '19 08:09 mdbloice

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

What is the workaround?

hanss0n avatar Mar 29 '21 14:03 hanss0n