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

Cyrylic not supported #6

Open
zeridon opened this issue Jun 14, 2016 · 3 comments
Open

Cyrylic not supported #6

zeridon opened this issue Jun 14, 2016 · 3 comments

Comments

@zeridon
Copy link

zeridon commented Jun 14, 2016

Hello,

Just stumbled on this and seemed quite useful, but it does not support cyrilyc (although it should by the looks of it)

Traceback (most recent call last):
  File "labelmaker.py", line 133, in <module>
    for row in data_reader:
  File "/usr/lib/python2.7/csv.py", line 104, in next
    row = self.reader.next()
UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-7: ordinal not in range(128)
labelmaker$ pip freeze
Pillow==3.2.0
argparse==1.2.1
configparser==3.5.0
wsgiref==0.1.2

attached samples

tst.zip

@zeridon
Copy link
Author

zeridon commented Jun 14, 2016

The issue seems to stem because of csv module not being unicode (at least in python 2.7). There are some recomendations for a workaround (https://docs.python.org/2/library/csv.html#csv-examples)

@ducky64
Copy link
Owner

ducky64 commented Jun 14, 2016

Does it work on Python 3? The code was written for Python 3, that anything works under Python 2.x is just luck...

@zeridon
Copy link
Author

zeridon commented Jun 15, 2016

With python3 it works fine.

Indeed the issue is that the csv module is not unicode ready. Short solution (python2 specific) is to set default encoding (which is not good per se)

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