Skip to content

Conversation

@wmazur-splunk
Copy link

At least you will know why loading the library fails

At least you will know why loading the library fails
return ctypes.CDLL(lib)
except OSError as err:
logging.warning(err)
pass

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove this line now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Suggested change
pass

return ctypes.CDLL(lib)
except OSError as err:
logging.warning(err)
pass
Copy link
Contributor

@cclauss cclauss May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Suggested change
pass

ahupp added a commit that referenced this pull request May 26, 2024
@ahupp
Copy link
Owner

ahupp commented May 26, 2024

Sorry for the delay, I definitely have sympathy for how frustrating it is to debug a swallowed exception. I've rebased this on recent changes and merged as a9e6276.

@ahupp ahupp closed this May 26, 2024
ddelange added a commit to ddelange/python-magic that referenced this pull request May 26, 2024
…bi3-wheels

* 'master' of https://github.com/ahupp/python-magic:
  log warning on ctypes load error, adapted from ahupp#279
  smartos support, adapted from ahupp#132
  rename no_json test to avoid duplicate function definitions
  handle unknown platforms gracefully in loader.py
  Clean up loader.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants