Skip to content

Instantly share code, notes, and snippets.

@raku-cat
Created August 20, 2018 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raku-cat/de5b3e9d3bca5abccaf15ac131a808cd to your computer and use it in GitHub Desktop.
Save raku-cat/de5b3e9d3bca5abccaf15ac131a808cd to your computer and use it in GitHub Desktop.
Python 2.7
--------------
>> crypt.crypt(u"流れる".encode("sjis"), "ab")
'abPIB/We4mESk'
>>>
Python 3
--------------
>>> crypt.crypt("流れる".encode("sjis"), "ab")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/crypt.py", line 47, in crypt
return _crypt.crypt(word, salt)
TypeError: crypt() argument 1 must be str, not bytes
>>> crypt.crypt("流れる", "ab")
'abyRtHwM0paQs'
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment