m-click / requests_pkcs12

Add PKCS#12 support to the Python requests library in a clean way, without monkey patching or temporary files
ISC License
124 stars 33 forks source link

must ‘pkcs12_filename’ be set to a full path? #24

Closed boziyoung closed 3 years ago

boziyoung commented 3 years ago

`

` fault: Traceback (most recent call last): File "/Users/zz/PycharmProjects/SDP-test/test1.py", line 31, in ApiTest.sign_up("boziyoung@a.a", 'young', 'QQqq11!!') File "/Users/zz/PycharmProjects/SDP-test/API/api_summary.py", line 70, in sign_up sign_result = sign.send_method() File "/Users/zz/PycharmProjects/SDP-test/API/send_method.py", line 31, in send_method response = requests_pkcs12.request(method=self.method, url=self.url, data=self.payload, json=self.json, File "/Users/zz/PycharmProjects/SDP-test/venv/lib/python3.8/site-packages/requests_pkcs12.py", line 121, in request pkcs12_adapter = Pkcs12Adapter( File "/Users/zz/PycharmProjects/SDP-test/venv/lib/python3.8/site-packages/requests_pkcs12.py", line 93, in init with open(pkcs12_filename, 'rb') as pkcs12_file: FileNotFoundError: [Errno 2] No such file or directory: './cert/arpdyqrqay.p12'

vog commented 3 years ago

No, a relative path should be just fine.

I assume that you either have a typo in the filename, or something in your code that changes the current directory, or that your program is not started in the needed directory.

vog commented 3 years ago

As there was to response for several months, I assume this issue has been solved in the meantime.

@boziyoung Feel free to open a new ticket if you encounter further issues.