[equo] fix UnicodeEncodeError as per bug #3873
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user