Skip to content

UnicodeEncodeError: 'latin-1' codec can't encode chinese #3

@zhenzhen1022

Description

@zhenzhen1022
  • OS:Windows
  • Python 3.6
  • HttpRunner 2.0
    when the request contains chinese, I got the error massege as following. how can I fix it?

Traceback (most recent call last):
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 17-18: Body ('上海') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.


Ran 1 test in 0.004s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions