我正在尝试添加到上列出的一个项目中,该项目是一个使用python的文本/文件加密设置,但每次我尝试运行代码时,我都会遇到实际加密文件的代码部分,并且得到上面列出的属性错误 Traceback-/Desktop/CODE/Python/TFEncrypter/TFEncrypter.py", line 38, in encrypted_data = f.encrypt(file_data)
Attribute
crypto_serialization.PublicFormat.OpenSSH然后我按照密码学文档用RSA加密,上面写着ciphertext = private_key.encrypt但是,运行encrypt部分会出现错误"AttributeError:'bytes‘object has no attribute 'encrypt'“。
我该如何解决这个问题呢?
'>{'mode': 'r'}
因此,从上面的代码片段和输出中,我可以看到name是表示sys.stdin的_io.TextIOWrapper实例的属性。但是a.name行抛出了错误:AttributeError: '_io.BytesIO' object has no attribute 'name';我期望的AttributeError,但我没想到会说它是一个_io.BytesIO对象<
sklearn\feature_extraction\text.py", line 195, in <lambda>AttributeError: '_io.TextIOWrapper' object has no attribute 'lower'
file1.txt和file2.txt是输入文本文件。