-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
python: accept path-like objects wherever file names are expected #24773
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
Conversation
22d7fb3
to
1bb2f2f
Compare
OpenCV team build OpenCV-Python package with Limited API option to reduce support matrix. The patch breaks it:
|
Fix for the versioning issue of limited API: #24837 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -701,6 +701,18 @@ bool pyopencv_to(PyObject* obj, String &value, const ArgInfo& info) | |||
return true; | |||
} | |||
std::string str; | |||
|
|||
#if ((PY_VERSION_HEX >= 0x03060000) && !defined(Py_LIMITED_API)) || (Py_LIMITED_API >= 0x03060000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update this check, because compilation fails in this configuration:
-- Python 3:
-- Interpreter: C:/utils/soft/python35-x64/python.exe (ver 3.5.4)
-- Libraries: C:/utils/soft/python35-x64/Libs/python35.lib (ver 3.5.4)
-- Limited API: YES (ver 0x03060000)
-- numpy: C:/utils/soft/python35-x64/lib/site-packages/numpy/core/include (ver 1.12.1)
-- install path: python/cv2/python-3
https://pullrequest.opencv.org/buildbot/builders/precommit_opencl/builds/100307
Merry Christmas, all 🎄
Implements #15731
Support is enabled for all arguments named
filename
orfilepath
(case-insensitive), or annotated withCV_WRAP_FILE_PATH
.Support is based on
PyOS_FSPath
, which is available in Python 3.6+. When running on older Python versions the arguments must have astr
value as before.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.