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

Accept path-like objects #83

Open
madig opened this issue Mar 30, 2018 · 2 comments
Open

Accept path-like objects #83

madig opened this issue Mar 30, 2018 · 2 comments

Comments

@madig
Copy link
Collaborator

madig commented Mar 30, 2018

Currently, passing a Path (args.old_font) to e.g. Face() raises an exception:

Traceback (most recent call last):
  File ".\glyphdiff\fttest.py", line 43, in <module>
    old_font_ft = freetype.Face(args.old_font)
  File "C:\Users\nikolaus.waxweiler\AppData\Local\Python\Python36\site-packages\freetype\__init__.py", line 981, in __init__
    u_filename = c_char_p(_encode_filename(filename))
  File "C:\Users\nikolaus.waxweiler\AppData\Local\Python\Python36\site-packages\freetype\__init__.py", line 152, in _encode_filename
    encoded = filename.encode(sys.getfilesystemencoding())
AttributeError: 'WindowsPath' object has no attribute 'encode'
@rougier
Copy link
Owner

rougier commented Apr 9, 2018

Thanks for the report. Do you have a fix?

@madig
Copy link
Collaborator Author

madig commented Apr 9, 2018

Not yet, currently busy with other things. On my todo list :)

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

No branches or pull requests

2 participants