diff --git a/client/solo/commands/command.py b/client/solo/commands/command.py index ca82c576a..c69095031 100644 --- a/client/solo/commands/command.py +++ b/client/solo/commands/command.py @@ -14,7 +14,8 @@ import sys import argparse from entropy.i18n import _ -from entropy.const import const_convert_to_unicode +from entropy.const import const_convert_to_unicode, \ + const_convert_to_rawstring from entropy.output import darkgreen, teal, purple, print_error, bold, \ brown from entropy.exceptions import PermissionDenied @@ -68,6 +69,10 @@ class SoloCommand(object): # cope with broken symlinks return string msg = "%s: %s" % (_("not a valid directory"), string) + + # see bug 3873, requires raw string + msg = const_convert_to_rawstring( + msg, from_enctype="utf-8") raise argparse.ArgumentTypeError(msg) def _argparse_is_valid_entropy_package(self, string): diff --git a/client/solo/commands/pkg.py b/client/solo/commands/pkg.py index 56ffbb325..8d8a19f4d 100644 --- a/client/solo/commands/pkg.py +++ b/client/solo/commands/pkg.py @@ -16,7 +16,7 @@ import tempfile import shutil from entropy.const import etpConst, const_setup_directory, \ - const_convert_to_unicode + const_convert_to_unicode, const_convert_to_rawstring from entropy.i18n import _ from entropy.output import darkgreen, teal, brown, purple, darkred, blue @@ -81,9 +81,12 @@ Execute advanced tasks on Entropy packages and the running system. def _argparse_easygoing_valid_entropy_path(string): if os.path.isfile(string) and os.path.exists(string): return string + # see bug 3873, requires raw string msg = "%s: %s" % ( _("not a valid Entropy package file"), string) + msg = const_convert_to_rawstring( + msg, from_enctype="utf-8") raise argparse.ArgumentTypeError(msg) quickpkg_parser = subparsers.add_parser(