Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding handling in XML-RPC testing infrastructure seems to be broken on Python 3 #11

Closed
icemac opened this issue Apr 17, 2020 · 1 comment · Fixed by #12
Closed

Encoding handling in XML-RPC testing infrastructure seems to be broken on Python 3 #11

icemac opened this issue Apr 17, 2020 · 1 comment · Fixed by #12
Assignees
Labels

Comments

@icemac
Copy link
Member

icemac commented Apr 17, 2020

ZopeTestTranport does a decode of the body with utf-8 to convert it from bytes to str:

if not isinstance(body, str):
# Python 3
body = body.decode("utf-8")

Later on FakeSocket converts the body str back to bytes using latin-1:

if not isinstance(data, bytes):
data = data.encode('iso-8859-1')

This breaks inside the expat parser because it is not able to handle chars outside ASCII which are latin-1 encoded as the default encoding for XML-RPC seems to be utf-8.

I propose to omit converting of the HTTP body and instead using the raw data to feed the parser.

@icemac icemac added the bug label Apr 17, 2020
@icemac icemac self-assigned this Apr 17, 2020
@d-maurer
Copy link

d-maurer commented Apr 17, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants