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

Make RospyLogger.findCaller compatible with Python3 (also, unbreak ROS on Python3) #1121

Merged
merged 1 commit into from
Aug 11, 2017
Merged

Make RospyLogger.findCaller compatible with Python3 (also, unbreak ROS on Python3) #1121

merged 1 commit into from
Aug 11, 2017

Conversation

kartikmohta
Copy link
Contributor

Due to the change in #1043, ROS was broken on Python3. The findCaller function in Python3 logging module takes 2 arguments (including self) compared to only 1 (self) in Python2 and returns 4 values instead of 3 in Python2.

Without this patch, roscore doesn't even start:

$ roscore
... logging to /home/kartikmohta/.ros/log/30a1f112-78a5-11e7-bdaf-507b9d9f0576/roslaunch-nyx-23629.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
  File "/opt/ros/lunar_py3/lib/python3.6/site-packages/roslaunch/__init__.py", line 306, in main
    p.start()
  File "/opt/ros/lunar_py3/lib/python3.6/site-packages/roslaunch/parent.py", line 264, in start
    self.logger.info("starting roslaunch parent run")
  File "/usr/lib/python3.6/logging/__init__.py", line 1306, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python3.6/logging/__init__.py", line 1430, in _log
    fn, lno, func, sinfo = self.findCaller(stack_info)
TypeError: findCaller() takes 1 positional argument but 2 were given
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3.6/logging/__init__.py", line 1430, in _log
    fn, lno, func, sinfo = self.findCaller(stack_info)
TypeError: findCaller() takes 1 positional argument but 2 were given

The findCaller function in Python3 logging module takes 2 arguments (including self) compared to only self in Python2.
@dirk-thomas
Copy link
Member

@kartikmohta Thank you for the fix.

@asmodehn FYI

@dirk-thomas dirk-thomas merged commit 548cf9e into ros:lunar-devel Aug 11, 2017
@kartikmohta kartikmohta deleted the fix/roslogging-python3 branch August 11, 2017 23:29
@paulbovbel
Copy link
Contributor

FYI this is currently breaking ros1_bridge message generation, would kindly request a tagged release.

@dirk-thomas
Copy link
Member

A new release will be made as soon as the pending logging regression has been fixed: see #1141.

@dirk-thomas
Copy link
Member

The "broken" version should only be in the testing repo. You should be ok if you use the version available from the main repo.

@paulbovbel
Copy link
Contributor

Thanks!

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 this pull request may close these issues.

None yet

3 participants