当我试图取消一个非unicode字符串的签名时,django抛出了DjangoUnicodeDecodeError。基本上,我尝试这样做:
from django.core.signing import Signer
signer = Signer()
signer.unsign(signer.sign(chr(248)))然后我得到了以下异常:
{DjangoUnicodeDecodeError}'utf8' codec can't decode byte 0xf8 in position 0: invalid start byte. You passed in '\xf8' (<type 'str'>)`我尝试使用utf-8编码,但没有帮助。
发布于 2015-04-10 16:27:17
试试这个:
from django.core.signing import Signer
signer = Signer()
signer.unsign(signer.sign(u'\xf8'))https://stackoverflow.com/questions/29556537
复制相似问题