Skip to content

UnicodeEncodeError on logging.warning #61

@artkpv

Description

@artkpv

Hi, thanks for the tool!

It breaks when I do tree with some Chinese chars in names of directories and files. Please see below.

> tree 0
Rebuilding partition...
Traceback (most recent call last):
  File "main.py", line 384, in <module>
    main()
  File "main.py", line 381, in main
    interpret(cmd, arguments, parts, shorthands, args.outputdir)
  File "main.py", line 114, in interpret
    part = check_valid_part(arguments[0], parts, shorthands)
  File "main.py", line 96, in check_valid_part
    part.rebuild()
  File "/home/art/Downloads/RecuperaBit/recuperabit/fs/core_types.py", line 200, in rebuild
    parent_node.add_child(node)
  File "/home/art/Downloads/RecuperaBit/recuperabit/fs/core_types.py", line 89, in add_child
    logging.warning('Renamed {} from {}'.format(node, original_name))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u4e0b' in position 20: ordinal not in range(128)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions