You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue where I'm running pyelftools and need to interrupt processing. I'm calling pyelftools from a Celery task. Celery cancels tasks by raising an celery.exceptions.Terminated exception. pyelftools unfortunately catches this and as a result, my task does not get cancelled.
As a fix, all occurences of except Exception should be changed to catch more specific exceptions, such as IOError, ValueError etc.
Any chance someone familiar with the pyelftools internals could determine which exceptions actually need to be caught and make the changes? Here's a list.
$ git grep --line-number "except Exception"
elftools/construct/core.py:238: except Exception as e:
elftools/construct/core.py:352: except Exception as ex:
elftools/construct/core.py:357: except Exception as ex:
elftools/construct/core.py:903: except Exception:
elftools/construct/debug.py:113: except Exception:
elftools/construct/debug.py:124: except Exception:
The text was updated successfully, but these errors were encountered:
I have an issue where I'm running pyelftools and need to interrupt processing. I'm calling pyelftools from a Celery task. Celery cancels tasks by raising an celery.exceptions.Terminated exception. pyelftools unfortunately catches this and as a result, my task does not get cancelled.
As a fix, all occurences of except Exception should be changed to catch more specific exceptions, such as IOError, ValueError etc.
I did not track which of the exceptions I'm hitting yet, but here's one example of offending try-except: https://github.com/eliben/pyelftools/blob/master/elftools/construct/core.py#L352
Any chance someone familiar with the pyelftools internals could determine which exceptions actually need to be caught and make the changes? Here's a list.
The text was updated successfully, but these errors were encountered: