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

closes #11: use threading.current_thread() and name in Python versions post 2.6 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JnRouvignac
Copy link

Keep using the old names currentThread() and getName() for Python versions pre 2.6

…Python versions post 2.6

Keep using the old names currentThread() and getName() for Python
versions pre 2.6
@JnRouvignac
Copy link
Author

JnRouvignac commented Sep 14, 2022

Hello @pekkaklarck, would you have any feedback on this PR?

Sorry if I am a insistent on this, the output in our software is completely drowned into these messages. The terminal is almost entirely filled with repetitions of the following two lines (hundreds and hundreds of lines):

/home/jnr/git/mysoft/dependencies/lib/python3.10/site-packages/robotbackgroundlogger.py:83: DeprecationWarning: currentThread() is deprecated, use current_thread() instead
/home/jnr/git/mysoft/dependencies/lib/python3.10/site-packages/robotbackgroundlogger.py:83: DeprecationWarning: getName() is deprecated, get the name attribute instead

Merging this PR and releasing this code would significantly improve our use case.
Thanks!

@JnRouvignac
Copy link
Author

JnRouvignac commented Sep 30, 2022

We have found a workaround with Python's warnings.filterwarnings() method.

Adding the following line to your program stops these deprecation warnings:

warnings.filterwarnings(action='ignore', 
                        category=DeprecationWarning,
                        module='robotbackgroundlogger',
                        message='(currentThread|getName)\(\) is deprecated, use .*')

@JnRouvignac
Copy link
Author

Hello @pekkaklarck, please have a look at this PR if you get a chance. Thank you very much!

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.

1 participant