Skip to content
Snippets Groups Projects
Commit abffb225 authored by Stefano Zacchiroli's avatar Stefano Zacchiroli
Browse files

cli.py: prefer os.fsdecode() over manual fiddling with locale.getpref...

parent 89f8d114
No related branches found
Tags v0.3.3
No related merge requests found
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
# See top-level LICENSE file for more information # See top-level LICENSE file for more information
import click import click
import locale
import os import os
import sys import sys
...@@ -107,8 +106,7 @@ def identify(obj_type, verify, show_filename, objects): ...@@ -107,8 +106,7 @@ def identify(obj_type, verify, show_filename, objects):
for (obj, pid) in results: for (obj, pid) in results:
msg = pid msg = pid
if show_filename: if show_filename:
encoding = locale.getpreferredencoding(do_setlocale=False) msg = '%s\t%s' % (pid, os.fsdecode(obj))
msg = '%s\t%s' % (pid, obj.decode(encoding))
click.echo(msg) click.echo(msg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment