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

Adjust for custom charset encoding of form request variables with Python 3 #43

Merged
merged 1 commit into from
May 12, 2019

Conversation

amotl
Copy link
Contributor

@amotl amotl commented May 11, 2019

Hi there,

thank you all for conceiving and maintaining mechanize. While using it that long already, we are finally happy to contribute something.

When upgrading to Python 3, we encountered the same issue as #32 when the form should be submitted in "iso-8859-1" encoding.

When sending latin-encoded form fields, "mechanize" bailed out with

TypeError: must assign a string

on Python 3 while everything worked fine on Python 2 here. This PR accounts for that by also accepting readily encoded bytes when setting form fields, which then worked flawlessly for us. An appropriate test nails the amended behavior.

Thanks a bunch already for looking at this.

With kind regards,
Andreas.

with Python 3

When sending latin-encoded form fields, "mechanize" bailed out with
"TypeError: must assign a string" on Python 3. This accounts for that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants