Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rhbz748727 Fail 'zanata push' if unsupported charset is used

  • Loading branch information...
commit b9eff21275201cfa05f8eb410dad3b8b561186e4 1 parent 6813bf3
@seanf seanf authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 zanataclient/publicanutil.py
View
10 zanataclient/publicanutil.py
@@ -133,9 +133,11 @@ def validate_content_type(self, content_type, object_type):
if enc not in ["UTF-8", "utf-8", "utf8", "ascii", "UTF8", "ASCII"]:
if enc == 'CHARSET':
if object_type == 'po-target-header':
- self.log.warn("Please change charset of header entry to UTF-8/utf-8")
+ self.log.error("Invalid encoding CHARSET; please correct the Content-Type charset (UTF-8 recommended)")
+ sys.exit(1)
else:
- self.log.warn("Please change charset of header entry to UTF-8/utf-8")
+ self.log.error("Unsupported encoding; please change the Content-Type charset (UTF-8 recommended)")
+ sys.exit(1)
def create_extensions(self, pofile, object_type):
"""
@@ -162,8 +164,8 @@ def create_pofile(self, path):
try:
po = polib.pofile(path)
except Exception:
- self.log.error("Can not processing the po file")
- sys.exit()
+ self.log.error("Cannot process the po file")
+ sys.exit(1)
return po
Please sign in to comment.
Something went wrong with that request. Please try again.