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

Python 3 support #18

Open
romancin opened this issue Mar 15, 2022 · 4 comments · May be fixed by #20
Open

Python 3 support #18

romancin opened this issue Mar 15, 2022 · 4 comments · May be fixed by #20

Comments

@romancin
Copy link

Hi! First of all thank you for this awesome workflow!

Yesterday, macOS 12.3 was released. As seen on the release notes (https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes) python2 support is deprecated, so the workflow stopped working :(

Is updating to python 3 present in your roadmap?

Thank you!

@romanbarczynski
Copy link

Workaround for now is:

  1. install Python 2.7.18 from Python.org: https://www.python.org/downloads/release/python-2718/
  2. update all scripts with /usr/local/bin/python2

@blaircraft
Copy link

You also need to update the location of Python at line 208 of background.py. You can find the location of background.py by turning on debugging in the workflow, attempting to use it, and examining the output for the actual path.

Change:
cmd = ['/usr/bin/python', __file__, name]
to:
cmd = ['/usr/local/bin/python2', __file__, name]

(... or whatever your path to the Python 2.7 interpreter).

@romanbarczynski romanbarczynski linked a pull request Mar 16, 2022 that will close this issue
@romancin
Copy link
Author

For the moment, I have followed this steps from Alfred:

https://www.alfredapp.com/help/kb/python-2-monterey/

@bendschs
Copy link

bendschs commented Mar 21, 2022

could it be that this stopped working for the most recent visosity 1.9.1 ?

installed python 2.7 like suggested by @romancin/alfred, updated all the path‘s including the one in background.py. the workflow seems to read the stored vpn-connections correctly but connecting or disconnecting is not possible (fails without specific error).

20:47:38 vpn.py:123 DEBUG    [Viscosity] appinfo=AppInfo(name=u'Viscosity', path=u'/Applications/3 Internet/Viscosity.app', bundleid=u'com.viscosityvpn.Viscosity')
20:47:38 vpn.py:85 DEBUG    [0.17s] fetched Viscosity VPN connections
20:47:38 workflow.py:1730 DEBUG    cached data: /Users/Benno/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.vpn.manager/_wfsess-3d35cf897280443abab114ec35362a96-viscosity-connections.cpickle
20:47:38 workflow.py:1695 DEBUG    loading cached data: /Users/Benno/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.vpn.manager/__workflow_latest_version.cpickle
20:47:38 workflow.py:2254 DEBUG    set last run version: 3.2.0
20:47:38 workflow.py:2103 DEBUG    ---------- finished in 0.540s ----------
[20:47:43.427] STDERR: VPN Manager[[Run Script](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.C7539D03-C2A6-4DE4-9689-2AC623FE4D39%3E3320B185-EABE-4399-98AB-D93EFA238B86)] .
20:47:42 workflow.py:2061 DEBUG    ---------- VPN Manager (3.2.0) ----------
20:47:42 workflow.py:1468 DEBUG    reading settings from /Users/Benno/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.vpn.manager/settings.json
20:47:42 workflow.py:2338 INFO     checking for update ...
20:47:42 background.py:233 DEBUG    [__workflow_update_check] command cached: /Users/Benno/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.vpn.manager/__workflow_update_check.argcache
20:47:42 background.py:237 DEBUG    [__workflow_update_check] passing job to background runner: [u'/opt/homebrew/bin/python', '/Users/Benno/Nextcloud/00 Admin/00 Config/B2ARCH/Alfred/Alfred.alfredpreferences/workflows/user.workflow.C7539D03-C2A6-4DE4-9689-2AC623FE4D39/workflow/background.pyc', u'__workflow_update_check']
.
20:47:43 workflow.py:2061 DEBUG    ---------- VPN Manager (3.2.0) ----------
20:47:43 background.py:243 DEBUG    [__workflow_update_check] background job started
20:47:43 vpn.py:515 DEBUG    args : {'--all': False,
 '--help': False,
 '<name>': u'ba2nas',
 '<query>': None,
 'app': False,
 'conf': False,
 'connect': False,
 'disconnect': True,
 'list': False}
20:47:43 vpn.py:123 DEBUG    [Viscosity] appinfo=AppInfo(name=u'Viscosity', path=u'/Applications/3 Internet/Viscosity.app', bundleid=u'com.viscosityvpn.Viscosity')
20:47:43 workflow.py:1695 DEBUG    loading cached data: /Users/Benno/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.vpn.manager/_wfsess-3d35cf897280443abab114ec35362a96-viscosity-connections.cpickle
20:47:43 vpn.py:154 INFO     disconnecting "ba2nas" ...
20:47:43 workflow.py:2254 DEBUG    set last run version: 3.2.0
20:47:43 workflow.py:2103 DEBUG    ---------- finished in 0.466s --------

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

Successfully merging a pull request may close this issue.

4 participants