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

Fix for "TypeError: write() argument must be str, not bytes" on Python 3.8+ #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dvoina
Copy link

@dvoina dvoina commented Mar 28, 2021

As the output file is created for writing text and lxml raw generates bytes objects an error is thrown.
Opening the file in binary mode solves the issue.

…n 3.8

As the output file is created for writing text and lxml raw generates bytes objects an error is thrown. 
Opening the file in binary mode solves the issue.
@Zaoliang
Copy link

cool!
However I created the service file for avahi service already and it works without issue.
I verified your change, it creates correct service file for my hp printer :)

LGTM

@davygravy
Copy link

Just confirmed this patch as a solution for the bug.

Copy link

@utopiabound utopiabound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes generation on Python 3.10

@ricardoamaro
Copy link

+1 for merging this @tjfontaine
Just tested it in python 3.8

@alehmann76
Copy link

Can confirm it as an solution for Python 3.6.8

Copy link

@cookieBerlin cookieBerlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me, with python 3.9.2

@ricardoamaro
Copy link

@tjfontaine @superna9999 @rchenzheng any chance you could merge this, please?

@rchenzheng
Copy link
Contributor

@tjfontaine @superna9999 @rchenzheng any chance you could merge this, please?

Unfortunately I do not have write access.

@lukystreik
Copy link

works for me, please merge to main

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.

10 participants