Skip to content
Snippets Groups Projects
  • Laurent Bachelier's avatar
    0764f07c
    Fix irk for Python 3 and Unicode input · 0764f07c
    Laurent Bachelier authored
    There were several issues:
    - json.dumps does not have an encoding parameter in Python 3.
    - Forcing the json.dumps encoding to ASCII prevents any non-ASCII
      character in the message. To avoid having non-ASCII characters in the
      *dump*, the only needed parameter is ensure_ascii=True which is the
      default.
    - To coerce a str to bytes in Python 3, an encoding must be provided
      even when it only contains ASCII characters.
      The solution is to use the encode() method which is available in both
      versions.
    0764f07c
    History
    Fix irk for Python 3 and Unicode input
    Laurent Bachelier authored
    There were several issues:
    - json.dumps does not have an encoding parameter in Python 3.
    - Forcing the json.dumps encoding to ASCII prevents any non-ASCII
      character in the message. To avoid having non-ASCII characters in the
      *dump*, the only needed parameter is ensure_ascii=True which is the
      default.
    - To coerce a str to bytes in Python 3, an encoding must be provided
      even when it only contains ASCII characters.
      The solution is to use the encode() method which is available in both
      versions.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.