Skip to content

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!

@JnRouvignac
Copy link
Author

Hello @pekkaklarck, I am coming back almost 3 years later.
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