Skip to content
Advertisement

Tag: attributeerror

Python Configparser. Whitespace causes AttributeError

I recieve some files with .ini file with them. I have to recieve file names from [FILES] section. Sometimes there is an extra witespace in another section of .ini-file which raises exception in ConfigParser module The example of “bad” ini-file: My code(Python 3.7): I can’t influence on files I recieve so that is there any way to ignore this error?

How to clear this AttributeError “nonetype”?

I’m learning datastructure while compiling this mergesort linkedlist . I got this error. I tried so much but didn’t work. Can any one tell me what’s wrong? please . Traceback (most recent call last): File “C:Users**AppDataLocalProgramsPythonPython37merge_sort_ver_2.0 linked list.py”, line 122, in File “C:Users**AppDataLocalProgramsPythonPython37merge_sort_ver_2.0 linked list.py”, line 75, in merge_sort File “C:Users**AppDataLocalProgramsPythonPython37merge_sort_ver_2.0 linked list.py”, line 94, in merge AttributeError: ‘NoneType’ object

How to catch an AttributeError in Background through Decorator?

this is raising an AttributeError in the moment: AttributeError: ‘Class’ object has no attribute ‘dooo_stuff’ I want to catch this Attribute Error somehow with an Decorator in Background. So that i can inform the user that the class method name has changed. So will not work because that is not in Background. I want to change the Error Message above

Advertisement