aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/google/protobuf/internal/type_checkers.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/google/protobuf/internal/type_checkers.py')
-rwxr-xr-xpython/google/protobuf/internal/type_checkers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/google/protobuf/internal/type_checkers.py b/python/google/protobuf/internal/type_checkers.py
index c009627f..a3bc57ff 100755
--- a/python/google/protobuf/internal/type_checkers.py
+++ b/python/google/protobuf/internal/type_checkers.py
@@ -122,8 +122,10 @@ class UnicodeValueChecker(object):
try:
unicode(proposed_value, 'ascii')
except UnicodeDecodeError:
- raise ValueError('%.1024r isn\'t in 7-bit ASCII encoding.'
- % (proposed_value))
+ raise ValueError('%.1024r has type str, but isn\'t in 7-bit ASCII '
+ 'encoding. Non-ASCII strings must be converted to '
+ 'unicode objects before being added.' %
+ (proposed_value))
class Int32ValueChecker(IntValueChecker):