Skip to content
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

print_control_identifiers() gets bytes string #309

Closed
pimail1501 opened this issue Feb 14, 2017 · 2 comments
Closed

print_control_identifiers() gets bytes string #309

pimail1501 opened this issue Feb 14, 2017 · 2 comments
Assignees
Labels

Comments

@pimail1501
Copy link

Hello,V
when i used print_control_identifiers() ,i got something like these

Control Identifiers:
b'\nNotepad - '\xce\xde\xb1\xea\xcc\xe2 - \xbc\xc7\xca\xc2\xb1\xbe' (L782, T215, R2016, B1030)\n['Notepad', '\xce\xde\xb1\xea\xcc\xe2 - \xbc\xc7\xca\xc2\xb1\xbe', '\xce\xde\xb1\xea\xcc\xe2 - \xbc\xc7\xca\xc2\xb1\xbeNotepad']\nchild_window(title="\xce\xde\xb1\xea\xcc\xe2 - \xbc\xc7\xca\xc2\xb1\xbe", class_name="Notepad")'
b' | \n | Edit - '' (L790, T265, R2008, B1022)\n | ['\xce\xde\xb1\xea\xcc\xe2 - \xbc\xc7\xca\xc2\xb1\xbeEdit', 'Edit']\n | child_window(class_name="Edit")'
b' | \n | StatusBar - '' (L790, T1000, R2008, B1022)\n | ['StatusBar \xb5\xda 1 \xd0\xd0\xa3\xac\xb5\xda 1 \xc1\xd0', '\xce\xde\xb1\xea\xcc\xe2 - \xbc\xc7\xca\xc2\xb1\xbeStatusBar', 'StatusBar']\n | child_window(class_name="msctls_statusbar32")'

I know they were about controls info ,however these texts of controls were bytes,so how can make them to be decoded?

@pimail1501
Copy link
Author

pimail1501 commented Feb 14, 2017

Thanks
I use python3

I just modify application.py about def print_identifiers():
the third line from bottom
print(output.encode(locale.getpreferredencoding(), errors='backslashreplace'))
to be
print(output)

and bytes convert to string

Control Identifiers:

Notepad - '无标题 - 记事本' (L782, T215, R2016, B1030)
['无标题 - 记事本Notepad', 'Notepad', '无标题 - 记事本']
child_window(title="无标题 - 记事本", class_name="Notepad")
|
| Edit - '' (L790, T265, R2008, B1022)
| ['无标题 - 记事本Edit', 'Edit']
| child_window(class_name="Edit")
|
| StatusBar - '' (L790, T1000, R2008, B1022)
| ['StatusBar 第 1 行,第 1 列', '无标题 - 记事本StatusBar', 'StatusBar']
| child_window(class_name="msctls_statusbar32")

@vasily-v-ryabov
Copy link
Contributor

Hi @pimail1501, thanks for reporting this!
It's easy to fix by using if six.PY3. Feel free to send pull request or I can do it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants