passhole icon indicating copy to clipboard operation
passhole copied to clipboard

Windows Support?

Open azinsharaf opened this issue 2 years ago • 6 comments

Hi, I have to use ph in Windows. Would it be supported in that env? I am getting no module named readline error.

azinsharaf avatar Mar 03 '22 02:03 azinsharaf

As of right now, it's not technically supported since GNU readline doesn't exist on Windows. However you should be able to hack in a workaround pretty easily.

Just delete the import readline at the top of passhole.py, then change the editable_input() function to this:

def editable_input(prompt, prefill=None):
    return input(prompt + ': ')

Evidlo avatar Apr 22 '22 20:04 Evidlo

Thank you @Evidlo. Good workaround.

azinsharaf avatar May 02 '22 17:05 azinsharaf

I'll keep this open for now, as I could just check whether we are in Windows and programmatically use the fallback method.

Evidlo avatar May 02 '22 21:05 Evidlo

FYI, I installed WSL (Ubuntu) on my windows machine recently and I'm able to use passhole in that env. No Win headache.

azinsharaf avatar Sep 15 '22 18:09 azinsharaf

After patching the passhole.py as suggested aove, passhole v.1.10.0 fails under Windows when trying to import transitive dependency pwd. The dependency path: passhole -> pykeepass_cache -> daemon -> pwd.

pwd is a Unix-only module and does not exist on Windows, python-daemon looks Unix-only as well.

Is there any way to to make daemon requirement optional/conditional?

(edit) This was verified on Windows 10 under PowerShell, CMD and Git Bash. Under WSL everything works just fine, as mentioned in an earlier comment.

approximate avatar Feb 23 '23 14:02 approximate

@approximate Sorry for the slow response. You might try with the --no-cache option, as I'm guessing the error is being thrown inside pykeepass_cache.

python-daemon is just used to run the cache server in the background. There might be a more cross-platform way to achieve this though: https://stackoverflow.com/questions/1196074/start-a-background-process-in-python

Evidlo avatar Jan 31 '24 01:01 Evidlo