8000 If a flush level is specified as a text value in a logging configuration dictionary, `dictConfig()` does not convert it to a numeric value. · Issue #117975 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

If a flush level is specified as a text value in a logging configuration dictionary, dictConfig() does not convert it to a numeric value. #117975

New issue
8000

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

Closed
vsajip opened this issue Apr 17, 2024 · 0 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@vsajip
Copy link
Member
vsajip commented Apr 17, 2024

Bug report

Bug description:

If setting up e.g. a MemoryHandler with a flushLevel using a configuration dictionary like this:

{
  # other elements omitted
  "flushLevel": "ERROR",
  # other elements omitted
}

then you can get a TypeError when logging because the value is not converted to logging.ERROR:

logging/handlers.py", line 1384, in shouldFlush
    (record.levelno >= self.flushLevel)
TypeError: '>=' not supported between instances of 'int' and 'str'

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@vsajip vsajip added the type-bug An unexpected behavior, bug, or error label Apr 17, 2024
@vsajip vsajip self-assigned this Apr 17, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 17, 2024
…ging MemoryHandler. (pythonGH-117976)

(cherry picked from commit 6d0bb43)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
vsajip pushed a commit that referenced this issue Apr 17, 2024
@vsajip vsajip closed this as completed Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant
0