Skip to content

TopicPartition_str0 broken on Mac OS X #73

@schmidtc

Description

@schmidtc

This one is minor but annoying...

On Mac OS X 10.10.5, Python 2.7.9:

>>> from confluent_kafka import TopicPartition
>>> print TopicPartition('topic')
TopicPartition{topic=topic,partition=-1,offset=%lld,error=%s}

On Ubuntu Python 2.7.6

>>> from confluent_kafka import TopicPartition
>>> print TopicPartition('topic')
TopicPartition{topic=topic,partition=-1,offset=-1001,error=None}

I tried to debug this a little and the issue seems to be that mac generates "%lld" and ubuntu generates "%ld" from "PRId64". PyUnicode_FromFormat (v2) does not support "%lld" (was added in v3.2)

mac$ /usr/bin/clang -E -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c confluent_kafka/src/confluent_kafka.c |grep "TopicPartition{"
 ret = PyUnicodeUCS2_FromFormat("TopicPartition{topic=%s,partition=%""d" ",offset=%""ll" "d"",error=%s}", self->topic, self->partition, self->offset, errstr ? PyString_AsString(PyUnicodeUCS2_AsUTF8String(errstr)) : "None");

ubuntu$ x86_64-linux-gnu-gcc -E -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c confluent_kafka/src/confluent_kafka.c|grep "TopicPartition{"
 ret = PyUnicodeUCS4_FromFormat("TopicPartition{topic=%s,partition=%""d" ",offset=%""l" "d"",error=%s}", self->topic, self->partition, self->offset, errstr ? PyString_AsString(PyUnicodeUCS4_AsUTF8String(errstr)) : "None")

Metadata

Metadata

Assignees

Labels

bugReporting an unexpected or problematic behavior of the codebase

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions