Skip to content

Fix python re warning#26579

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
FantasqueX:fix-re-warning-1
Dec 6, 2024
Merged

Fix python re warning#26579
asmorkalov merged 1 commit intoopencv:4.xfrom
FantasqueX:fix-re-warning-1

Conversation

@FantasqueX
Copy link
Copy Markdown
Contributor

There are four warnings when build objc with Python 3.12+

2024-12-05T10:16:37.8418499Z   C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\objc\generator\gen_objc.py:1124: SyntaxWarning: invalid escape sequence '\*'
2024-12-05T10:16:37.8420255Z     toWrite.append(re.sub('\*\s*@param ', '* @param ', line))
2024-12-05T10:16:37.8464005Z   C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\objc\generator\gen_objc.py:1516: SyntaxWarning: invalid escape sequence '\}'
2024-12-05T10:16:37.8469048Z     return re.sub(re.compile('texttt{(.*?)\}', re.DOTALL), lambda x: 'texttt{' + escape_underscore(x.group(1)) + '}', str)
2024-12-05T10:16:37.8471247Z   C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\objc\generator\gen_objc.py:1520: SyntaxWarning: invalid escape sequence '\s'
2024-12-05T10:16:37.8476158Z     if re.search("\\\\fork\s*{", tex):
2024-12-05T10:16:37.8478651Z   C:\GHA-OCV-6\_work\opencv\opencv\opencv\modules\objc\generator\gen_objc.py:1522: SyntaxWarning: invalid escape sequence '\s'
2024-12-05T10:16:37.8483224Z     if re.search("\\\\vecthreethree\s*{", tex):

https://docs.python.org/3/library/re.html

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov self-requested a review December 6, 2024 05:49
@opencv-alalek opencv-alalek added the pr: needs rebase Rebase patch (and squash fixup commits) on the top of target branch label Dec 6, 2024
Copy link
Copy Markdown
Contributor

@opencv-alalek opencv-alalek left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Please rebase changes on 4.x branch: https://github.com/opencv/opencv/wiki/Branches

  • Validated generated result from these targets (no changes on Python 3.11):
    • gen_opencv_objc_source_osx
    • gen_opencv_objc_source_ios
    • gen_opencv_objc_source_visionos

@FantasqueX FantasqueX changed the base branch from 5.x to 4.x December 6, 2024 09:17
@FantasqueX FantasqueX changed the title Fix python re warning and remove python2 import Fix python re warning Dec 6, 2024
@FantasqueX
Copy link
Copy Markdown
Contributor Author

Rebase done

@opencv-alalek opencv-alalek removed the pr: needs rebase Rebase patch (and squash fixup commits) on the top of target branch label Dec 6, 2024
@asmorkalov asmorkalov self-assigned this Dec 6, 2024
@asmorkalov
Copy link
Copy Markdown
Contributor

Hm.., I see merge conflict on CI and the builds we not triggered well:

Auto-merging CMakeLists.txt
CONFLICT (content): Merge conflict in CMakeLists.txt
Auto-merging cmake/OpenCVFindLibsPerf.cmake
Auto-merging doc/tutorials/introduction/macos_install/macos_install.markdown
CONFLICT (content): Merge conflict in doc/tutorials/introduction/macos_install/macos_install.markdown
Auto-merging modules/core/include/opencv2/core/mat.hpp
Auto-merging modules/imgproc/src/drawing.cpp
Auto-merging modules/imgproc/src/precomp.hpp
Auto-merging modules/imgproc/test/test_contours.cpp
Auto-merging modules/objc/generator/gen_objc.py
Automatic merge failed; fix conflicts and then commit the result.

Could you rebase and ensure conflicts of touch the commit to re-trigger CI again?

@FantasqueX FantasqueX force-pushed the fix-re-warning-1 branch 2 times, most recently from 30abca6 to ed9d64c Compare December 6, 2024 11:56
@FantasqueX
Copy link
Copy Markdown
Contributor Author

Rebased on current 4.x HEAD. Is that correct?

@asmorkalov asmorkalov merged commit 7fbf3c1 into opencv:4.x Dec 6, 2024
@asmorkalov asmorkalov added this to the 4.11.0 milestone Dec 6, 2024
@FantasqueX FantasqueX mentioned this pull request Dec 9, 2024
6 tasks
@asmorkalov asmorkalov mentioned this pull request Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants