question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PySide6 DeprecationWarning of exec_

See original GitHub issue

Hi,

exec_ function is deprecated in PySide6, so the common PyQt5/PySide2 code gets deprecated warning when QT_API=pyside6.

DeprecationWarning: 'exec_' will be removed in the future. Use 'exec' instead.
  sys.exit(app.exec_())

On the other hand, PyQt6 removes exec_ but QtPy provides exec_ for the compatibility. (#259) As a result, DeprecationWarning of exec_ occurs only when QT_API=pyside6. Which should this DeprecationWarning be addressed by QtPy or the user application? Note that print_ function of PySide6 may have the same problem.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
kumattaucommented, Nov 26, 2021

I sent PR: #287 to fix this issue.

2reactions
kumattaucommented, Nov 26, 2021

Note that print_ function of PySide6 may have the same problem.

I mistook about the print_ function of PySide6. Unlike exec_, PySide6/PySide2 does not have print function. They have print_ function only.

The summary is as follows.

Qt Bindings PyQt5 PyQt6 PySide2 PySide6
exec_ v v deprecated
exec v v v
print_ v v v
print v v

I think QtPy don’t have to do anything about print and print_ of PySide6 because print_ is available on PyQt5/PyQt6/PySide2/PySide6. (when QT_API=pyqt6, QtPy already has mapped print to print_)

Read more comments on GitHub >

github_iconTop Results From Across the Web

DeprecationWarning not mentioned in the documentation
I tried to migrate a few hundred lines of code to PySide6, errors coming up, and these reports have not been mentioned in...
Read more >
DeprecationWarning: Function when moving app (removed ...
DeprecationWarning : Function when moving app (removed titlebar) - PySide6 · The warning is telling you that the function may be removed in...
Read more >
PyQt6 vs PySide6: What's the difference between the two ...
Python 3 removed the exec keyword, freeing the name up to be used. As a result from PyQt6 .exec() calls are named just...
Read more >
Deprecation Warning for Enum Access · Issue #352 - GitHub
I noticed here that enums were promoted for PyQt6 , but not PySide6 . Is there a reason for that? I'm wondering because...
Read more >
Enable the exec() functions (I7375e106) · Gerrit Code Review
Enable the exec() functions With Qt6, PySide dropped support for Python 2.7, ... The current change prints: Deprecation Warning: 'exec_' will be removed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found