-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
PR: Add workaround for mode
argument in QTextCursor.movePosition (Pyside2)
#341
Conversation
…on() PySide2 does not accept the `mode` keyword argument in QTextCursor.movePosition() even though it is a valid optional argument as per C++ API. Fix this by monkeypatching. Notes: * The `mode` argument is called `arg__2` in PySide2 as per QTextCursor.movePosition.__doc__ and __signature__. Using `arg__2` as keyword argument works as intended, so does using a positional argument. Tested with PySide2 5.15.0, 5.15.2.1 and 5.15.3; older version, down to PySide 1, are probably affected as well [1]. * PySide2 5.15.0 and 5.15.2.1 silently ignore invalid keyword arguments, i.e. passing the `mode` keyword argument has no effect and doesn’t raise an exception. Older versions, down to PySide 1, are probably affected as well [1]. PySide2 5.15.3 raises an exception when `mode`or any other invalid keyword argument is passed. [1] https://bugreports.qt.io/browse/PYSIDE-185
mode
argument in QTextCursor.movePosition()mode
argument in QTextCursor.movePosition (Pyside2)
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.
Thanks @rear1019 for helping with this! LGTM 👍
Also, maybe could be worthy to open an issue over PySide @ccordoba12 @rear1019 ? The only one I found related to this is closed: https://bugreports.qt.io/browse/PYSIDE-185
I'm not sure they're still accepting bug reports against PySide2 since they've stopped providing LTS for open source users, but it could potentially be patched in the PySide2 conda packages. |
PySide6 is affected as well. At the very least, one gets an exception as with PySide2 >= 5.15.3 |
Please open a pull request to patch Pyside6 as well. |
* Arguments are called differently than they are in C++ interface * PySide2 < 5.15.3 doesn’t raise an exception for unknown kwarg * Also see [1] for a similar issue [1] spyder-ide/qtpy#341
* Arguments are called differently than they are in C++ interface * PySide2 < 5.15.3 doesn’t raise an exception for unknown kwarg * Also see [1] for a similar issue [1] spyder-ide/qtpy#341
* Arguments are called differently than they are in C++ interface * PySide2 < 5.15.3 doesn’t raise an exception for unknown kwarg * Also see [1] for a similar issue [1] spyder-ide/qtpy#341
The argument “[hv]Policy” is called “[hv]Data” in PySide2 and PySide2<5.15.3 doesn’t raise an exception for invalid keyword arguments (also see [1]). [1] spyder-ide/qtpy#341
See commit message/comment in code for details.