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

Decode output of fc-match in Python2 as UTF-8 #760

Merged
merged 2 commits into from Mar 10, 2019

Conversation

akrabat
Copy link
Member

@akrabat akrabat commented Mar 6, 2019

If the output of fc-match contains any unicode characters, then we need to handle this in Python 2.

Fixes #757

@@ -193,6 +194,8 @@ def get_family(query):

def get_fname(query):
data = os.popen("fc-match -v \"%s\""%query, "r").read()
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe change this to use subprocess.check_output? Just so it looks less 2010 ish :-)

@akrabat
Copy link
Member Author

akrabat commented Mar 6, 2019 via email

Copy link
Contributor

@ralsina ralsina left a comment

Choose a reason for hiding this comment

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

+1, the comment is just a nice-to-have

If the output of fc-match contains any unicode characters, then we need
to handle this in Python 2.

Fixes rst2pdf#757
@akrabat
Copy link
Member Author

akrabat commented Mar 7, 2019

subprocess.check_output now used.

@ralsina ralsina merged commit 5ef81e2 into rst2pdf:master Mar 10, 2019
@akrabat akrabat deleted the fcmatch-py2 branch March 10, 2019 11:46
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.

None yet

2 participants