2017-02-26 05:12:13

I am running some python code with python 3.6 on Mac and I'm getting the following error:

Last login: Sat Feb 25 21:05:39 on ttys000
Kyles-MBP:~ kyle$ python3
Python 3.6.0 (default, Dec 26 2016, 11:10:28)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import accessible_output2.outputs.auto
>>>
>>> reader = accessible_output2.outputs.auto.Auto()
>>> reader.output("hello world")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/accessible_output2-0.13-py3.6.egg/accessible_output2/outputs/auto.py", line 33, in output
    output = self.get_first_available_output()
  File "/usr/local/lib/python3.6/site-packages/accessible_output2-0.13-py3.6.egg/accessible_output2/outputs/auto.py", line 18, in get_first_available_output
    if output.is_active():
  File "/usr/local/lib/python3.6/site-packages/accessible_output2-0.13-py3.6.egg/accessible_output2/outputs/voiceover.py", line 32, in is_active
    return self.runAppleScript('return (name of processes) contains "VoiceOver"', 'system events').startswith('true') and not self.runAppleScript('try\nreturn bounds of vo cursor\non error\nreturn false\nend try').startswith('false')
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
>>>

is this a bug?
do I need to explicitly tell it which reader to use?
any help would be appreciated.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub

2017-02-27 02:25:28

Looks like you're using the copy from my hg, and that copy is not running on Python 3. As I did not write the output for VoiceOver for AO2 I cannot offer more information.

2017-02-27 02:45:23

I've rewritten the VoiceOver output. Please pull from hg and try again.

2017-02-27 20:01:51

It works now. thanks.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub