Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation warning on python 3.7 #114

Closed
knaveofdiamonds opened this issue Oct 1, 2019 · 2 comments · Fixed by pybind/pybind11#1334
Closed

Deprecation warning on python 3.7 #114

knaveofdiamonds opened this issue Oct 1, 2019 · 2 comments · Fixed by pybind/pybind11#1334

Comments

@knaveofdiamonds
Copy link

knaveofdiamonds commented Oct 1, 2019

Importing osmium and running with warnings turned on or running under pytest produces the following deprecation warning on python 3.7.4 and 3.7.3:

_frozen_importlib:219: DeprecationWarning: __int__ returned non-int (type bool).  The ability to return an instance of a strict subclass of int is deprecated, and may be removed in a future version of Python.

To replicate, create a file foo.py with:

import osmium

And then run python -Wd foo.py.

I can't see anything obvious in any of the python code, maybe this is something in the C++ bindings (which I don't know much about)?

@lonvia
Copy link
Member

lonvia commented Oct 1, 2019

The problem is with the bool-typed enum classes osmium:geom:use_nodes and osmium:geom:direction. pybind11 seems to not properly translate them into their underlying type. There is a similar issue about char-typed enums and a PR with a fix for it. So I guess this needs digging into pybind11.

@lonvia
Copy link
Member

lonvia commented Mar 22, 2022

I can confirm that this is fixed with the latest pybind11 versions.

@lonvia lonvia closed this as completed Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants