-1

I'm working with Maya 2018 and there's a weird thing going on. When I select multiple vertices, faces or edges I get:

// Error: AttributeError: file <string> line 88: 'exceptions.RuntimeError' object has no attribute 'errno' // 
// Warning: Python callback failed // 

The problem with this in what I'm scripting is that when this warning/error appears, somehow it does not let me click on my custom GUI buttons. For example. I need to select a few vertices then click a button to save them into a custom attribute... Well I can't click that button right away, and I'm guessing it is because of this weird error.

Any ideas on what this is?

Mendel Reis
  • 55
  • 2
  • 14

1 Answers1

4

In line 88 of your script you're trying to use attribute errno of RuntimeError instance but this exception class has no such attribute.
Read documentation of exceptions before trying to handle them.

Atrribute errno is defined only in OSError and classes inheriting from it.
So apparently line 88 is part of try...except clause and in that line you're trying to use e.errno. You can't do that if the exception doesn't belong to OSError exceptions family.

ElmoVanKielmo
  • 10,907
  • 2
  • 32
  • 46
  • Well. I'm not using it at line 88.... my line 88 is: `code`( leftTableWidget = QWidget()) ... The documentation only says it is 'A numeric error code from the C variable errno' ... I get this might be a simple issue for you but you answer didn't really help how to solve it.... also there is no 'try except' in my code... where should i handle this error? – Mendel Reis Jan 31 '18 at 13:01
  • @MendelReis the documentation https://docs.python.org/3/library/exceptions.html#OSError describes `OSError` class and it's attribute `errno`. https://docs.python.org/3/library/exceptions.html#RuntimeError documentation doesn't mention attribute `errno` so it doesn't have it. Sometimes tools mess up the actual line numbers - please search for occurences of `errno` in your script and it would be the best if you could paste `try...except` block in which `errno` is used. Also does the traceback have only one line? If not, please include the traceback in your question. – ElmoVanKielmo Jan 31 '18 at 13:07
  • 1
    If there's no `try...except` block in your code, then the traceback should be longer than just `Error: AttributeError: file line 88: 'exceptions.RuntimeError' object has no attribute 'errno' //` - please include the full traceback. – ElmoVanKielmo Jan 31 '18 at 13:10
  • As far as my abilities let me understand, that is the whole trace back.. sorry. Do you work with maya? here's git hub [link](https://github.com/mreis/faceTweakRigger) with the whole script. you can run it in maya 2017 or 2018 and see if you get the error when selecting vertices. bit chances this is a silly thing indeed, but those silly things are the most annoying to beginners... Thank you. – Mendel Reis Jan 31 '18 at 13:35