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

Workflow broken on Monterey 12.3 #12

Open
AntZoo opened this issue Feb 1, 2022 · 23 comments
Open

Workflow broken on Monterey 12.3 #12

AntZoo opened this issue Feb 1, 2022 · 23 comments

Comments

@AntZoo
Copy link

AntZoo commented Feb 1, 2022

Apple removed Python 2 support in Monterey 12.3, and the workflow is no longer functional. A rewrite into Python 3 is needed.

@ValeryP
Copy link

ValeryP commented Mar 18, 2022

Is there any progress?

@liwmj
Copy link

liwmj commented Mar 21, 2022

Mark, I hope it can be resolved soon.

@davidawad
Copy link

davidawad commented Mar 22, 2022

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.

image

@Anebrithien
Copy link

It's time to fully migrate to python3.

@stacksjb
Copy link

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

@miguelpuyol
Copy link

We can still install python 2 as explained here:

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

@teziovsky
Copy link

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 🤔

@VijendraMalhotra
Copy link

Is there any update on this? or a solution being worked on?

@pSpitzner
Copy link

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.

@chrisspiegl
Copy link

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.

@ValeryP
Copy link

ValeryP commented Apr 5, 2022

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.

@olssonm
Copy link

olssonm commented Apr 9, 2022

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.

@ValeryP
Copy link

ValeryP commented Apr 10, 2022

@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!

@FreoFreo
Copy link

I found a project replaced it, I hope it is useful to you. alfred-password-generator

@gabriel-r
Copy link

gabriel-r commented Apr 19, 2022

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.

@ryanblock
Copy link

ryanblock commented Apr 29, 2022

@olssonm your Node.js workflow is quite nice, and very tidy. Well done! 👏🏼👏🏼👏🏼

@olssonm
Copy link

olssonm commented Apr 29, 2022

Thanks @ryanblock !

(Huge fan since the gdgt-days btw!)

@purpltentacle
Copy link

purpltentacle commented May 4, 2022

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 (Workflow broken on Monterey 12.3 #12 (comment))
  • Changed the Python-paths in the Script Filters and Run Scripts to /usr/local/bin/python (in my case)

Works fine.

@cristopher-rodrigues
Copy link

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?

image

💡

@purpltentacle
Copy link

purpltentacle commented May 22, 2022

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.

python_path

script_filter

@danielhanold
Copy link

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!

@fast01
Copy link

fast01 commented Jul 6, 2023

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))

@chenyk1219
Copy link

chenyk1219 commented Dec 18, 2023

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

No branches or pull requests