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

compatibility: RospyLogger findCaller arguments #1838

Merged
merged 1 commit into from
Nov 23, 2019
Merged

compatibility: RospyLogger findCaller arguments #1838

merged 1 commit into from
Nov 23, 2019

Conversation

Darnor
Copy link
Contributor

@Darnor Darnor commented Nov 19, 2019

In python 3.8 the findCaller() function will take an additional stacklevel argument (see: https://docs.python.org/3/library/logging.html#logging.Logger.findCaller). Since we are ignoring the stack_info argument already, we can just use *args and *kwargs to be compatible with python 3.7 and also python 3.8.

In python 3.8 the findCaller() function will take an additional `stacklevel` argument (see: https://docs.python.org/3/library/logging.html#logging.Logger.findCaller). Since we are ignoring the stack_info argument already, we can just use *args and *kwargs to be compatible with python 3.7 and also python 3.8.
@jwhendy
Copy link

jwhendy commented Nov 21, 2019

Well, dangit. I wish I hadn't suspected that this was a stale python-3.7 lib dependency and rebuilt all of ROS from scratch today. This morning I found I can no longer roslaunch anything.

I'm on arch linux, which just updated to python-3.8.

$ roslaunch turtle_tf turtle_tf_demo.launch 
... logging to /home/jwhendy/.ros/log/051227fc-0c27-11ea-a276-0024d6f9ae16/roslaunch-voltaur-2726355.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/melodic/lib/python3.8/site-packages/roslaunch/__init__.py", line 322, in main
    p.start()
  File "/opt/ros/melodic/lib/python3.8/site-packages/roslaunch/parent.py", line 273, in start
    self.logger.info("starting roslaunch parent run")
  File "/usr/lib/python3.8/logging/__init__.py", line 1434, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python3.8/logging/__init__.py", line 1565, in _log
    fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
TypeError: findCaller() takes from 1 to 2 positional arguments but 3 were given
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/__init__.py", line 1565, in _log
    fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
TypeError: findCaller() takes from 1 to 2 positional arguments but 3 were given

@jwhendy
Copy link

jwhendy commented Nov 21, 2019

If secondary input/replication helps, this patch was tested and fixed the python3.8 issue on arch linux. Thanks @Darnor !

@mikepurvis
Copy link
Member

Looks like a harmless fix, thanks for testing on Python 3.8!

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

Successfully merging this pull request may close these issues.

None yet

3 participants