jeppeter / extargsparse

extension for argparse package
MIT License
2 stars 1 forks source link

pkcs7.PKCS7Encoder not working in Python3 #1

Open crazyscientist opened 6 years ago

crazyscientist commented 6 years ago

Hi there,

according to PyPi this project is the correct place for the PyPi package "pkcs7"?

When installing the package in a virtualenv with Python3.6 the decrypt and encode methods do not accept byte-strings as an argument and raise

Traceback (most recent call last):
  File "client_api/client.py", line 435, in <module>
    client()
  File "client_api/client.py", line 106, in __call__
    for note in self.list_notes():
  File "client_api/client.py", line 345, in list_notes
    note["decrypted"] = aeskey.decrypt(note.get("content", ""))
  File "client_api/client.py", line 74, in decrypt
    return self.pkcs7.decode(self.aeskey.decrypt(base64.b64decode(text)))
  File "/home/andip/virtualenvs/secure-notes/lib/python3.6/site-packages/pkcs7/__init__.py", line 50, in decode
    if ord(text[textlen - i - 1]) != lastch:
TypeError: ord() expected string of length 1, but int found

Would it be feasible to add support for byte-stings?

guru-florida commented 3 years ago

Is this project still maintained or is there a suggested alternative? This is due to a breaking change in Python3 where indexing a bytes object returns an integer instead of a char.