anyboxhq / anybox-alfred-workflow

45 stars 3 forks source link

Workflow fails with AttributeError: 'str' object has no attribute 'removeprefix' #5

Closed brokenarc closed 1 year ago

brokenarc commented 1 year ago

I get the stack trace below whenever I activate the Anybox workflow.

[05:59:04.443] Anybox[Script Filter] Queuing argument 'python'
[05:59:04.619] Anybox[Script Filter] Script with argv 'python' finished
[05:59:04.625] ERROR: Anybox[Script Filter] Code 1: Traceback (most recent call last):
  File "/Users/shannon/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/488BBB8C-FB6A-4713-AC4E-DA74EEDFFED4", line 211, in <module>
    links = get_links()
  File "/Users/shannon/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/488BBB8C-FB6A-4713-AC4E-DA74EEDFFED4", line 128, in get_links
    'subtitle': format_subtitle(link),
  File "/Users/shannon/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/488BBB8C-FB6A-4713-AC4E-DA74EEDFFED4", line 64, in format_subtitle
    subtitle = format_url(link['url']) + date
  File "/Users/shannon/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/488BBB8C-FB6A-4713-AC4E-DA74EEDFFED4", line 40, in format_url
    return url.removeprefix('https://')
AttributeError: 'str' object has no attribute 'removeprefix'

Environment details:

francisfeng commented 1 year ago

Can you update the /usr/bin/python3 to 3.9?

It looks like removeprefix was introduced in Python 3.9.

brokenarc commented 1 year ago

After I installed the XCode 15 Command Line Tools, the workflow works as expected.

Please consider updating the README to list the XCode 15 Command Line Tools as a dependency for these reasons:

Thanks!