pywinauto 0.6.5 with Python 3.7 showing deprecation warnings from common_controls.py
See original GitHub issueI recently upgraded pywinauto to test with Python 3.7 (previous setup was pywinauto 0.6.4 with Python 2,7). In this new setup I am seeing a large number of DeprecationWarnings being output to the terminal from …\pywinauto\controls\common_controls.py.
e.g.,
..\testPyWinAutoPython37\venvTestPython37\lib\site-packages\pywinauto\controls\common_controls.py:776: DeprecationWarning: Method .ItemCount() is deprecated, use .item_count() instead.
return self.get_header_control().ItemCount()
..\testPyWinAutoPython37\venvTestPython37\lib\site-packages\pywinauto\controls\common_controls.py:776: DeprecationWarning: Method .ItemCount() is deprecated, use .item_count() instead.
return self.get_header_control().ItemCount()
..\testPyWinAutoPython37\venvTestPython37\lib\site-packages\pywinauto\controls\common_controls.py:179: DeprecationWarning: ListView item properties "text", "state", "image" and "indent" are deprecated! Use methods text(), state(), image() and indent().
'Use methods text(), state(), image() and indent().', DeprecationWarning)
..\testPyWinAutoPython37\venvTestPython37\lib\site-packages\pywinauto\controls\common_controls.py:776: DeprecationWarning: Method .ItemCount() is deprecated, use .item_count() instead.
return self.get_header_control().ItemCount()
..\testPyWinAutoPython37\venvTestPython37\lib\site-packages\pywinauto\controls\common_controls.py:179: DeprecationWarning: ListView item properties "text", "state", "image" and "indent" are deprecated! Use methods text(), state(), image() and indent().
'Use methods text(), state(), image() and indent().', DeprecationWarning)
..\testPyWinAutoPython37\venvTestPython37\lib\site-packages\pywinauto\controls\common_controls.py:776: DeprecationWarning: Method .ItemCount() is deprecated, use .item_count() instead.
I’ve googled how to suppress these warnings, but none of the suggestions I’ve seen so far have worked (e.g., suggestions here How to ignore deprecation warnings in Python)
Any advice on how to stop these warnings from being output to the terminal during run of scripts that use pywinauto?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
pywinauto Documentation - Read the Docs
pywinauto is a set of python modules to automate the Microsoft Windows GUI. ... misc_examples.py Show some exceptions and how to get control ......
Read more >Error while importing the pywinauto module - Stack Overflow
This is bug in Python 3.8.1 and 3.7.6. Downgrade to earlier Python version. Python 3.8.2 will revert the wrong code.
Read more >PEP 565 – Show DeprecationWarning in __main
In Python 2.7 and Python 3.2, the default warning filters were updated to hide DeprecationWarning by default, such that deprecation warnings in development ......
Read more >Who should see Python deprecation warnings? - LWN.net
Nick Coghlan observed that Python 3.6 does not warn about the use of those names, calling it " a fairly major oversight/bug "....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

BTW, we recently made additional clean ups in commaon_controls.py (see rev: 3b66563b05be9f3061a8be33ef00f0019ed12567). @parlar , you could check it with the current sources from the trunk.
Good catch! I’ll consider this as a high priority for next update release.
This workaround should disable warnings:
If it doesn’t help, you may need to clear all filters by
warnings.resetwarnings()and then apply ignore filter.