-1

I know this may seem a common question, yes, there are many questions similar to mine and yes, apparently there are solutions but the problem is that I tried them but they do not work. This is my code:

def testOne():
    output = subprocess.run(["htpasswd.exe", "-nb", "spock", "volerevolare"], capture_output=True)
    print( output )
    print("out: <{o}>".format(o=output.stdout.decode()))   
    print( "return code: dec {d:d}   hex {h:X}".format(d=output.returncode, h=output.returncode) ) 
#---------------------------------------------------------------------------

and this is its output:

CompletedProcess(args=['htpasswd.exe', '-nb', 'spock', 'volerevolare'], returncode=3221225781, stdout=b'', stderr=b'')
out: <>
return code: dec 3221225781   hex C0000135

so in my opinion after looking at the error code I think that my little applications does not work and htpasswd.exe is not executed. O.S. is Win 7, normal user (not admin user). What I missed? Thanks, Massimo

Massimo Manca
  • 385
  • 1
  • 2
  • 15

1 Answers1

0

OK, problem found, I have also cygwin installed so it was a problem related to PATH. Copying locally the right htpasswd.exe (Windows 10 version) solved the problem. The htpasswd windows version is already installed in Win 10, for previous release I verified it works since Win 7 it is downloadable here: https://www.exefiles.com/it/exe/htpasswd-exe/

Massimo Manca
  • 385
  • 1
  • 2
  • 15