Python3: fix NVDA's logging infrastructure - #9712
Merged
Merged
Conversation
…e now use logging.getLevelName.
…reamHandler and assume unicode all the way until writing the file to disk with utf8. logHandler: FunctionType.func_code is now FunctionType.__code__. # Please enter the commit message for your changes. Lines starting
LeonarddeR
approved these changes
Jun 11, 2019
feerrenrut
suggested changes
Jun 11, 2019
feerrenrut
left a comment
Contributor
There was a problem hiding this comment.
There are still a few references to func_code in this file, could you check the rest of the code-base while you are at it? Could you also check for logging._levelNames in the rest of the code-base too?
Note, there are a few review comments from Leonard as well.
Member
Author
|
I had previously grepped for any other uses of _levelNames and corrected them. There are none left. |
Member
Author
|
I have addressed review comments. Though didn't change the 'is' to an isinstance as this was existing code and I'm trying to avoid changing anything not necessary to change due to Python 3. |
feerrenrut
approved these changes
Jun 12, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
None.
Summary of the issue:
In Python3: several issues cause NVDA's logging to fail:
__code__.Description of how this pull request fixes the issue:
__code__instead of func_code.Testing performed:
Started NVDA under Python3. Info messages and tracebacks were successfully logged.
Known issues with pull request:
None.
Change log entry:
None.
Section: New features, Changes, Bug fixes