Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 503 by bl...@orcaware.com: 2.5.0: python unit tests fail with PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
http://code.google.com/p/protobuf/issues/detail?id=503

I'm the [http://www.macports.org/ports.php?by=library&substr=protobuf-cpp MacPorts protobuf] maintainer and I'm finally working on upgrading from 2.4.1 to 2.5.0. I had enabled PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp in the 2.4.1 packages and with Python 2.4, 2.5, 2.6 and 2.7 all the unit tests pass. Updating to 2.5.0, they now fail.

The output below is with Python 2.7.3. This line appears during the unit test:

{{{
testStringUTF8Encoding (google.protobuf.internal.reflection_test.ReflectionTest) ... ok testStringUTF8Serialization (google.protobuf.internal.reflection_test.ReflectionTest) ... [libprotobuf ERROR google/protobuf/wire_format.cc:1053] String field contains invalid UTF-8 data when parsing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.
ok
testTopLevelExtensionsForOptionalMessage (google.protobuf.internal.reflection_test.ReflectionTest) ... ok
}}}

and the errors

{{{
======================================================================
ERROR: testMakeDescriptorWithUnsignedIntField (google.protobuf.internal.descriptor_test.MakeDescriptorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python/google/protobuf/internal/descriptor_test.py", line 607, in testMakeDescriptorWithUnsignedIntField
    result = descriptor.MakeDescriptor(message_type)
File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python/google/protobuf/descriptor.py", line 708, in MakeDescriptor
    has_default_value=False)
File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python/google/protobuf/descriptor.py", line 464, in __init__
    self._cdescriptor = cpp_message.GetFieldDescriptor(full_name)
File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python/google/protobuf/internal/cpp_message.py", line 60, in GetFieldDescriptor
    return _pool.FindFieldByName(full_field_name)
TypeError: Couldn't find field Foo.uint64_field

======================================================================
FAIL: testPrintBadEnumValue (google.protobuf.internal.text_format_test.TextFormatTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python/google/protobuf/internal/text_format_test.py", line 104, in testPrintBadEnumValue
    'optional_nested_enum: 100\n'
File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python/google/protobuf/internal/text_format_test.py", line 59, in CompareToGoldenText
    self.CompareToGoldenLines(text, golden_text.splitlines(1))
File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python/google/protobuf/internal/text_format_test.py", line 65, in CompareToGoldenLines
    ''.join(difflib.ndiff(golden_lines, actual_lines)))
AssertionError: Text doesn't match golden.  Diff:
- optional_nested_enum: 100
- optional_foreign_enum: 101
- optional_import_enum: 102


======================================================================
FAIL: testPrintBadEnumValueExtensions (google.protobuf.internal.text_format_test.TextFormatTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python/google/protobuf/internal/text_format_test.py", line 115, in testPrintBadEnumValueExtensions
    '[protobuf_unittest.optional_nested_enum_extension]: 100\n'
File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python/google/protobuf/internal/text_format_test.py", line 59, in CompareToGoldenText
    self.CompareToGoldenLines(text, golden_text.splitlines(1))
File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python/google/protobuf/internal/text_format_test.py", line 65, in CompareToGoldenLines
    ''.join(difflib.ndiff(golden_lines, actual_lines)))
AssertionError: Text doesn't match golden.  Diff:
- [protobuf_unittest.optional_nested_enum_extension]: 100
- [protobuf_unittest.optional_foreign_enum_extension]: 101
- [protobuf_unittest.optional_import_enum_extension]: 102


----------------------------------------------------------------------
Ran 216 tests in 1.053s

FAILED (failures=2, errors=1)
Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-protobuf/py27-protobuf/work/protobuf-2.5.0/python" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py test
Exit code: 1
}}}


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to