cppclean icon indicating copy to clipboard operation
cppclean copied to clipboard

'NoneType' object has no attribute 'split'

Open endotermic opened this issue 7 years ago • 7 comments

Problem: File "...\cppclean\cpp\static_data.py", line 31, in print_warning for name in node.name.split(','): AttributeError: 'NoneType' object has no attribute 'split'

Possible solution: Additional check is needed.

Temporary fix For now I use "try: except: pass" around FOR loop

endotermic avatar Apr 05 '18 11:04 endotermic

fixed in pull request #133

endotermic avatar May 11 '18 05:05 endotermic

if node.name is of type None then program abort happens. I have no time to find out what triggers this issue but this little fix will not allow forbidden call to non existing method.

endotermic avatar May 11 '18 05:05 endotermic

I get a similar issue:

Traceback (most recent call last): File "/usr/local/bin/cppclean", line 145, in sys.exit(main()) File "/usr/local/bin/cppclean", line 138, in main quiet=args.quiet): File "/usr/local/lib/python2.7/dist-packages/cpp/static_data.py", line 117, in run _find_warnings(filename, lines, entire_ast, True) + File "/usr/local/lib/python2.7/dist-packages/cpp/static_data.py", line 64, in _find_warnings print_warning(node) File "/usr/local/lib/python2.7/dist-packages/cpp/static_data.py", line 31, in print_warning for name in node.name.split(','): AttributeError: 'NoneType' object has no attribute 'split'

bjaraujo avatar Nov 04 '18 10:11 bjaraujo

This issue is fixed in master branch. Maybe I missed something when fixed this bug?

вс, 4 нояб. 2018 г., 12:07 bjaraujo [email protected]:

I get a similar issue:

Traceback (most recent call last): File "/usr/local/bin/cppclean", line 145, in sys.exit(main()) File "/usr/local/bin/cppclean", line 138, in main quiet=args.quiet): File "/usr/local/lib/python2.7/dist-packages/cpp/static_data.py", line 117, in run _find_warnings(filename, lines, entire_ast, True) + File "/usr/local/lib/python2.7/dist-packages/cpp/static_data.py", line 64, in _find_warnings print_warning(node) File "/usr/local/lib/python2.7/dist-packages/cpp/static_data.py", line 31, in print_warning for name in node.name.split(','): AttributeError: 'NoneType' object has no attribute 'split'

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/myint/cppclean/issues/130#issuecomment-435656865, or mute the thread https://github.com/notifications/unsubscribe-auth/AGxHPMBQXJHhni74dV8B8FFoxiwXAf1Iks5urrxGgaJpZM4TIRot .

endotermic avatar Nov 04 '18 10:11 endotermic

No, this was using the latest released version. Does cppclean have a GUI? I think cppclean is very good but it listed so many issues I need some way of editing the files quickly.

bjaraujo avatar Nov 04 '18 11:11 bjaraujo

I am still using cppclean. I rolled back because the master also gave me issues. Now I just use --exclude option to exclude the problematic file.

bjaraujo avatar Nov 04 '18 11:11 bjaraujo

Cppclean don't have GUI. It would be very good if you would report bug on your issues.

вс, 4 нояб. 2018 г., 13:54 bjaraujo [email protected]:

I am still using cppclean. I rolled back because the master also gave me issues. Now I just use --exclude option to exclude the problematic file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/myint/cppclean/issues/130#issuecomment-435663368, or mute the thread https://github.com/notifications/unsubscribe-auth/AGxHPOva6BF9I-0O58O40VWQPFc_Acaiks5urtWAgaJpZM4TIRot .

endotermic avatar Nov 04 '18 13:11 endotermic