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

Unicode in filenames issue with generate_css_name #206

Closed
rickybrent opened this issue Mar 5, 2016 · 1 comment
Closed

Unicode in filenames issue with generate_css_name #206

rickybrent opened this issue Mar 5, 2016 · 1 comment

Comments

@rickybrent
Copy link

generate_css_name runs into a problem when checking the filename to see if it contains the css_pseudo_class_separator if the filename is in unicode.

I've attached my error log -- the "problem file" was "Flügel Tiara_9.png"


Version: 0.11.1
Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2]
PIL version: 1.1.7
Platform: Linux-3.13.0-77-generic-x86_64-with-Ubuntu-14.04-trusty
Config: {'css_dir': '/home/ricky/dumps/sprites', 'less_dir': False, 'force': False, 'json_dir': False, 'crop': False, 'less_template': None, 'css_url': u'', 'global_template': None, 'css_namespace': u'sprite', 'html_dir': False, 'css_cachebuster': False, 'recursive': False, 'scss_template': None, 'css_pseudo_class_separator': u'__', 'enabled_formats': ['img', 'css'], 'generate_css': True, 'source': '/home/ricky/dumps/itempanel_icons', 'optipng': False, 'follow_links': False, 'imagemagick': False, 'each_template': None, 'json_format': u'array', 'watch': False, 'css_sprite_namespace': u'{sprite_name}', 'padding': u'0', 'ratio_template': None, 'ratios': u'1', 'caat_dir': False, 'optipngpath': None, 'css_cachebuster_only_sprites': False, 'scss_dir': False, 'generate_image': True, 'cocos2d_dir': False, 'imagemagickpath': None, 'algorithm': u'square', 'css_cachebuster_filename': False, 'img_dir': '/home/ricky/dumps/sprites', 'png8': False, 'quiet': False, 'project': False, 'css_separator': u'-', 'algorithm_ordering': u'maxside', 'debug': False, 'output': '/home/ricky/dumps/sprites', 'margin': u'0', 'css_template': None, 'ignore_filename_paddings': False}
Args: ['/usr/local/bin/glue', 'itempanel_icons', 'sprites']

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/glue/bin.py", line 235, in main
manager.process()
File "/usr/local/lib/python2.7/dist-packages/glue/managers/base.py", line 14, in process
self.save()
File "/usr/local/lib/python2.7/dist-packages/glue/managers/base.py", line 42, in save
format.validate()
File "/usr/local/lib/python2.7/dist-packages/glue/formats/css.py", line 142, in validate
class_names = [':'.join(self.generate_css_name(i.filename)) for i in self.sprite.images]
File "/usr/local/lib/python2.7/dist-packages/glue/formats/css.py", line 211, in generate_css_name
if css_pseudo_class_separator in filename:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in range(128)

@rickybrent
Copy link
Author

Noticed this is a duplicate of #203

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
@rickybrent and others