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 chars are not supported #43

Open
Aliaksei-Tatarynchyk opened this issue Apr 2, 2019 · 0 comments
Open

Unicode chars are not supported #43

Aliaksei-Tatarynchyk opened this issue Apr 2, 2019 · 0 comments

Comments

@Aliaksei-Tatarynchyk
Copy link
Collaborator

If file which is read by shaper contains utf8 char, e.g. русский текст, it fails with following exception:

resolver.py:145: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if value == u'':
Traceback (most recent call last):
  File "d:\env\python\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "d:\env\python\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "d:\Env\Python\Python27\Scripts\shaper.exe\__main__.py", line 9, in <module>
  File "d:\env\python\python27\lib\site-packages\shaper\cli.py", line 144, in main
    libs.parser.write(tree, arguments.out)
  File "d:\env\python\python27\lib\site-packages\shaper\libs\parser.py", line 102, in write
    parser_class().write(data, path)
  File "d:\env\python\python27\lib\site-packages\shaper\libs\parser.py", line 186, in write
    allow_unicode=True,
  File "d:\env\python\python27\lib\site-packages\yaml\__init__.py", line 202, in dump
    return dump_all([data], stream, Dumper=Dumper, **kwds)
  File "d:\env\python\python27\lib\site-packages\yaml\__init__.py", line 190, in dump_all
    dumper.represent(data)
  File "d:\env\python\python27\lib\site-packages\yaml\representer.py", line 29, in represent
    self.serialize(node)
  File "d:\env\python\python27\lib\site-packages\yaml\serializer.py", line 54, in serialize
    self.serialize_node(node, None, None)
  File "d:\env\python\python27\lib\site-packages\yaml\serializer.py", line 108, in serialize_node
    self.serialize_node(value, node, key)
  File "d:\env\python\python27\lib\site-packages\yaml\serializer.py", line 90, in serialize_node
    style=node.style))
  File "d:\env\python\python27\lib\site-packages\yaml\emitter.py", line 115, in emit
    self.state()
  File "d:\env\python\python27\lib\site-packages\yaml\emitter.py", line 413, in expect_block_mapping_simple_value
    self.expect_node(mapping=True)
  File "d:\env\python\python27\lib\site-packages\yaml\emitter.py", line 243, in expect_node
    self.process_tag()
  File "d:\env\python\python27\lib\site-packages\yaml\emitter.py", line 474, in process_tag
    self.style = self.choose_scalar_style()
  File "d:\env\python\python27\lib\site-packages\yaml\emitter.py", line 497, in choose_scalar_style
    self.analysis = self.analyze_scalar(self.event.value)
  File "d:\env\python\python27\lib\site-packages\yaml\emitter.py", line 653, in analyze_scalar
    if scalar.startswith(u'---') or scalar.startswith(u'...'):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 434: ordinal not in range(128)
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

1 participant