alfred-pwgen
alfred-pwgen copied to clipboard
Workflow broken on Monterey 12.3
Apple removed Python 2 support in Monterey 12.3, and the workflow is no longer functional. A rewrite into Python 3 is needed.
Is there any progress?
Mark, I hope it can be resolved soon.
I have the same issue, when trying to change the python path to another python2 executable that doesn't seem to fix it either.
I've tried setting all the workflow script paths to /usr/local/bin/python2
but that doesn't work either.

It's time to fully migrate to python3.
Manually running pwgen.py gives this error ./pwgen.py", line 200 os.makedirs(user_generator_dir, 0700) ^ SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
We can still install python 2 as explained here:
https://www.alfredapp.com/help/kb/python-2-monterey/
We can still install python 2 as explained here:
https://www.alfredapp.com/help/kb/python-2-monterey/
Yes but it doesnβt work unfortunately π€
Is there any update on this? or a solution being worked on?
I got it to work by installing py27 as described here on stackoverflow (Im on m1 and using conda, other ways to get py27 working should be fine, too).
Then, all the occurences of /usr/bin/python
in the workflow need to be replaced with the path to your python2 exectuable (in terminal, which python2
should give you the path).
This includes:
- the script filters
- the
bin/bash
run script actions - the hardcoded string that is located in the workflow directory: rightlick the workflow, show in finder, open the file
./workflow/background.py
and search for/usr/bin/python
. There should only be one occurence.
If I find a free weekend, I might add this as a workflow-wide variable that can be set, but for now this is a quick and dirty way to get it running again.
I think it's great that a workaround exists, but a rewrite of the workflow is probably what we need. Having to install a somewhat outdated Python version just for this workflow is not really what I want to be doing.
It's hard to believe there is not even one maintainer who might be able to migrate this to python3. As I remember, the difference is not so huge for pyhton2 and python3. Unfortunately, I'm not familiar with this kind of development. Otherwise, I'd do it even by myself.
It's hard to believe there is not even one maintainer who might be able to migrate this to python3. As I remember, the difference is not so huge for pyhton2 and python3. Unfortunately, I'm not familiar with this kind of development. Otherwise, I'd do it even by myself.
Hey, chill. The maintainer has worked on this package for years completely free, they have no real obligation to continue working on it if they do not wish to do so, or perhaps they have just not had the time yet. I'm sure you might find someone who's willing to fork it and/or submit a PR to update it to Python 3 if they're compensated π
Anyhow, I'm also a great fan of this package and needed a substitute, so I made somewhat of a port to Node (olssonm/alfred-password-generator) albeit much simpler with fewer features if anyone's interested.
@olssonm sorry if I was too direct, but I didn't mean the repo owner by "maintainer". I meant anyone who is able to make a fix (even me if I will figure out how, hehe).
By the way, your workflow works great for me, thank you!
I found a project replaced it, I hope it is useful to you. alfred-password-generator
I found a project replaced it, I hope it is useful to you. alfred-password-generator
I tried it and it works as expected. The script itself is very simple, I like it a lot.
@olssonm your Node.js workflow is quite nice, and very tidy. Well done! ππΌππΌππΌ
Thanks @ryanblock !
(Huge fan since the gdgt-days btw!)
I got the workflow running again on 12.3:
- Installed Python 2.7.18 on Homebrew/pyenv (https://www.alfredapp.com/help/kb/python-2-monterey/)
- Installed the PyObjC-package:
python -m pip install pyobjc==5.2
. The latest version for Python 2.7 of PyObjC (5.3) produced a bus error on my 12.3 installation, so I installed version 5.2, which works fine. This package is used for copying the password to the clipboard using NSPasteboard (pasteboard.py), I think this is a missing part in pSpitzners solution (https://github.com/deanishe/alfred-pwgen/issues/12#issuecomment-1087593024) - Changed the Python-paths in the Script Filters and Run Scripts to
/usr/local/bin/python
(in my case)
Works fine.
What if we add a custom env var that sets Python binary directory? This way, I could just add the var in the workflow config, and it'd be used at run time, WDYT?

π‘
What if we add a custom env var that sets Python binary directory? This way, I could just add the var in the workflow config, and it'd be used at run time, WDYT?
I did something similar in my ProxmoxControl-Workflow. Before running a Python-script, I export the PYTHON_PATH variable. Seems to be working fine.
I found a project replaced it, I hope it is useful to you. alfred-password-generator
This is great, super simple and straightforward. Thanks for creating this!
Manually running pwgen.py gives this error ./pwgen.py", line 200 os.makedirs(user_generator_dir, 0700) ^ SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
change : os.makedirs(user_generator_dir, int('0700',8))
https://github.com/alfred-workflow-collections/password