Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 Compatibility Variable Type long #35

Closed
tommy3001 opened this issue Jan 6, 2019 · 3 comments · Fixed by #51 or #52
Closed

Python3 Compatibility Variable Type long #35

tommy3001 opened this issue Jan 6, 2019 · 3 comments · Fixed by #51 or #52
Labels

Comments

@tommy3001
Copy link

There is an issue in
rqt_bag/plugins/raw_view.py
and
rqt_bag_plugins/plot_view.py
regarding PEP 0237.
Python 3 handles long data types as an int, long is therefore not available:

Traceback (most recent call last): File "/opt/ros/melodic/lib/python3.7/site-packages/rqt_bag/plugins/message_view.py", line 92, in event self.message_viewed(bag, msg_data) File "/opt/ros/melodic/lib/python3.7/site-packages/rqt_bag/plugins/raw_view.py", line 65, in message_viewed self.message_tree.set_message(msg) File "/opt/ros/melodic/lib/python3.7/site-packages/rqt_bag/plugins/raw_view.py", line 103, in set_message self._add_msg_object(None, '', '', msg, msg._type) File "/opt/ros/melodic/lib/python3.7/site-packages/rqt_bag/plugins/raw_view.py", line 186, in _add_msg_object if type(obj) in [int, long, float]: NameError: name 'long' is not defined

@tommy3001
Copy link
Author

I deleted long from the list in the regarding files. For me it is working now....

@dirk-thomas dirk-thomas added the bug label Jan 7, 2019
@dirk-thomas
Copy link
Contributor

dirk-thomas commented Jan 7, 2019

Please consider to provide a pull request for this which works with both Python versions. The same issue has been address in other packages, e.g.: https://github.com/ros/ros_comm/blob/fe9479cdbf0be0caa542c74c7c1fb8229ea8164d/tools/rostopic/src/rostopic/__init__.py#L67-L70

@oceanusxiv
Copy link
Contributor

@dirk-thomas #51 only fixes one file with this issue I believe, this issue still persists in raw_view.py. I'll see if I can get another PR to fix that, but in the meantime we might want to keep this open.

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

Successfully merging a pull request may close this issue.

3 participants