Skip to content

Conversation

@eduardoChaucaGallegos
Copy link
Contributor

This pull request updates the PySide patcher utilities to issue deprecation warnings when the obsolete QTextCodec.setCodecForCStrings() method is called, instead of silently ignoring the call. This helps developers identify and remove usage of this method before it is removed in the future.

Deprecation warning improvements:

  • Added a warnings.warn call in the setCodecForCStrings static method in QTextCodec within python/tank/util/pyside2_patcher.py, informing users that the method is obsolete, will be removed after September 2026, and should be removed from their code.
  • Added a similar warnings.warn call in the setCodecForCStrings static method in QTextCodec within python/tank/util/pyside6_patcher.py, with messaging tailored for Qt6/PySide6.

General code update:

  • Imported the warnings module in both python/tank/util/pyside2_patcher.py and python/tank/util/pyside6_patcher.py to support the new deprecation warnings. [1] [2]

@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.62%. Comparing base (3fed2c4) to head (886a6ff).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1083   +/-   ##
=======================================
  Coverage   79.61%   79.62%           
=======================================
  Files         198      198           
  Lines       20623    20624    +1     
=======================================
+ Hits        16420    16421    +1     
  Misses       4203     4203           
Flag Coverage Δ
Linux 79.08% <100.00%> (+<0.01%) ⬆️
Python-3.10 79.44% <100.00%> (+<0.01%) ⬆️
Python-3.11 79.34% <50.00%> (+<0.01%) ⬆️
Python-3.9 79.40% <100.00%> (+<0.01%) ⬆️
Windows 79.11% <100.00%> (+<0.01%) ⬆️
macOS 79.09% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eduardoChaucaGallegos eduardoChaucaGallegos requested a review from a team January 28, 2026 23:56
Copy link
Contributor

@carlos-villavicencio-adsk carlos-villavicencio-adsk left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines 102 to 103
"QTextCodec.setCodecForCStrings() is obsolete and was removed in Qt6/PySide6 "
"and will be removed after September 2026. "
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"QTextCodec.setCodecForCStrings() is obsolete and was removed in Qt6/PySide6 "
"and will be removed after September 2026. "
"QTextCodec.setCodecForCStrings() is obsolete and no longer exist since Qt5/PySide2. "
"This method will be removed from Toolkit after December 2026. "

Comment on lines 79 to 80
"QTextCodec.setCodecForCStrings() is obsolete and no longer exists in Qt5/PySide2 "
"and will be removed after September 2026. "
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"QTextCodec.setCodecForCStrings() is obsolete and no longer exists in Qt5/PySide2 "
"and will be removed after September 2026. "
"QTextCodec.setCodecForCStrings() is obsolete and no longer exist since Qt5/PySide2. "
"This method will be removed from Toolkit after December 2026. "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants