Skip to content
This repository was archived by the owner on Jul 11, 2022. It is now read-only.

SyntaxError in Python 3 #41

Closed
drzero42 opened this issue Apr 26, 2017 · 5 comments
Closed

SyntaxError in Python 3 #41

drzero42 opened this issue Apr 26, 2017 · 5 comments

Comments

@drzero42
Copy link

The function codecs.span_context_to_string has the following line in it:

parent_id = parent_id or 0L

This is invalid syntax in Python 3 as per PEP 237, as can be seen here:
SyntaxError: invalid syntax Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/jaeger_client/__init__.py", line 32, in <module> from .tracer import Tracer # noqa File "/usr/local/lib/python3.6/site-packages/jaeger_client/tracer.py", line 34, in <module> from .codecs import TextCodec, ZipkinCodec, ZipkinSpanFormat, BinaryCodec File "/usr/local/lib/python3.6/site-packages/jaeger_client/codecs.py", line 140 parent_id = parent_id or 0L ^ SyntaxError: invalid syntax

Instead of 0L in should just be 0. Not sure how to make in compatible with both 2 and 3 though.

@drzero42
Copy link
Author

Okay, it seems there are various Python 3 incompatibilities in here. My guess is that this is because of Thrift? From what I can see Thrift is Python 3 compatible from version 0.10.0.
What would be needed to get jaeger_client to be Python 3 compatible?

@yurishkuro
Copy link
Member

the setup.py does not pin thrift to 0.9, and if I look at the latest build from master, I can see that it is in fact thrift 0.10 that is installed. The crossdock test includes an end-to-end test where the client communicates with jaeger-agent, so I think it is safe to assume using thrift-0.10 is fine and compatible with Jaeger backend (even if jaeger-agent is using 0.9)

@xdralex
Copy link

xdralex commented May 2, 2017

@drzero42 @yurishkuro I think I have fixed most of the incompatibilities in #43 - feel free to take a look.

@I159
Copy link

I159 commented Aug 11, 2017

$ python --version
Python 3.6.1

pip freeze | grep jaeger
jaeger-client==3.5.0

$ pip freeze | grep thrift
thrift==0.10.0

And I'm still experiencing the error:
python3.6/site-packages/jaeger_client/codecs.py", line 88 parent_id = parent_id or 0L

PEP 0237: Essentially, long renamed to int. That is, there is only one built-in integral type, named int; but it behaves mostly like the old long type.

@yurishkuro
Copy link
Member

this was fixed in #57, but we haven't released a new version since the work is not finished.

There doesn't seem to be any new information in this ticket, so I am going to close it as a dupe of #59.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants