Commit 378e37d
committed
Replace use of str() with six.text_type() for Py2&3 compatibility
Version 1 of the PyQt APIs return QVariant types that must be
cast to Python strings before use. To catch this `get_window_title()`
in `backend_qt5.py` wrapped the call to `self.window.windowTitle()`
with `str()`. This fails on Python 2 if the window title contains
unicode characters.
This is replaced with `six.text_type` for Py2&3 compatibility with
unicode types.
A number of other locations in the same file were also using `str()`
for potentially unicode data. These are also fixed in this commit.
Fixes #4275.1 parent 174fc94 commit 378e37d
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
| 563 | + | |
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
| 736 | + | |
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | | - | |
| 852 | + | |
853 | 853 | | |
854 | 854 | | |
855 | 855 | | |
| |||
0 commit comments