文章内容
2019/8/1 17:48:10,作 者: 黄兵
关于Python UUID 的一些问题
这篇文章很好的讲解了在 Python 中 UUID 的一些相关知识。
文章地址:Python 生成 UUID GUID
但是通过这篇文章的方法,在Python 3.6中出现错误,具体错误内容:
<class 'tuple'>: ("'str' object has no attribute 'bytes'",)
出现错误的原因:
Python版本不同,存在编码上的区别。
解决方案:
uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
参考资料:
1、uuid — UUID objects according to RFC 4122
2、 成功解决AttributeError: 'str' object has no attribute 'decode'
其它相关推荐:
3、AttributeError: 'AnonymousUser' object has no attribute 'id'
5、Invalid leading whitespace, reserved character(s), or returncharacter(s) in header value
黄兵个人博客原创。
转载请注明出处:黄兵个人博客 - 关于Python UUID 的一些问题
评论列表