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

QueueHandler formatting affects other handlers #79907

Closed
DavidRuggles mannequin opened this issue Jan 12, 2019 · 9 comments
Closed

QueueHandler formatting affects other handlers #79907

DavidRuggles mannequin opened this issue Jan 12, 2019 · 9 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir

Comments

@DavidRuggles
Copy link
Mannequin

DavidRuggles mannequin commented Jan 12, 2019

BPO 35726
Nosy @vsajip, @ned-deily, @Zheaoli, @tirkarthi
PRs
  • bpo-35726:QueueHandler formatting affects other handlers #11537
  • bpo-35726: Add test for QueueHandler with multiple handlers #11659
  • [3.7] bpo-35726: Add test for QueueHandler with multiple handlers (GH-11659) #12714
  • [3.7] bpo-35726: Prevented QueueHandler formatting from affecting other handlers (GH-11537) #12716
  • [3.7] bpo-35726: Add test for QueueHandler with multiple handlers (GH-11659) #13061
  • Files
  • queuehandler_bug.py: Example of issue
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-05-02.17:25:02.208>
    created_at = <Date 2019-01-12.13:55:13.696>
    labels = ['3.8', '3.7', 'library']
    title = 'QueueHandler formatting affects other handlers'
    updated_at = <Date 2019-05-02.17:25:02.201>
    user = 'https://bugs.python.org/DavidRuggles'

    bugs.python.org fields:

    activity = <Date 2019-05-02.17:25:02.201>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-05-02.17:25:02.208>
    closer = 'ned.deily'
    components = ['Library (Lib)']
    creation = <Date 2019-01-12.13:55:13.696>
    creator = 'David Ruggles'
    dependencies = []
    files = ['48044']
    hgrepos = []
    issue_num = 35726
    keywords = ['patch', 'patch', 'patch']
    message_count = 9.0
    messages = ['333526', '333530', '333534', '333535', '334248', '334249', '339559', '341287', '341288']
    nosy_count = 5.0
    nosy_names = ['vinay.sajip', 'ned.deily', 'Manjusaka', 'xtreak', 'David Ruggles']
    pr_nums = ['11537', '11659', '12714', '12716', '13061']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue35726'
    versions = ['Python 3.7', 'Python 3.8']

    @DavidRuggles
    Copy link
    Mannequin Author

    DavidRuggles mannequin commented Jan 12, 2019

    ISSUE: if you add a formatter to QueueHandler any subsequently added handlers will get the formatting added to QueueHandler

    CAUSE: as best as I can tell, the code here:

    record.message = msg

    is modifying the record object so when it get passed to the next handler here:
    hdlr.handle(record)

    it includes the formatting applied by the QueueHandler's formatter.

    I worked around this issue by moving my formatter from the QueueHandler to the QueueListener

    I've attached a simple example of the issue

    NOTE: I marked this as Python 3.7 because that's what I'm using, but I looked at github and the code is in master so I assume this affects 3.8 too.

    @DavidRuggles DavidRuggles mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir labels Jan 12, 2019
    @Zheaoli
    Copy link
    Mannequin

    Zheaoli mannequin commented Jan 12, 2019

    I have already work on a PR for it

    @vsajip
    Copy link
    Member

    vsajip commented Jan 12, 2019

    Any idea why the same PR appears three times in the PR list? Is it because for some reason you've added the issue link multiple times in the PR, when it's not needed?

    @tirkarthi
    Copy link
    Member

    @vinay.sajip It's known issue discussed here python/bugs.python.org#12

    @vsajip
    Copy link
    Member

    vsajip commented Jan 23, 2019

    New changeset da6424e by Vinay Sajip (Manjusaka) in branch 'master':
    bpo-35726: Prevented QueueHandler formatting from affecting other handlers (GH-11537)
    da6424e

    @vsajip
    Copy link
    Member

    vsajip commented Jan 23, 2019

    Merged for 3.8, will add backport labels to PR in due course.

    @vsajip vsajip changed the title QueueHandler formating affects other handlers QueueHandler formatting affects other handlers Jan 23, 2019
    @vsajip
    Copy link
    Member

    vsajip commented Apr 7, 2019

    New changeset 2dad960 by Vinay Sajip (Xtreak) in branch 'master':
    bpo-35726: Add test for QueueHandler with multiple handlers (GH-11659)
    2dad960

    @ned-deily
    Copy link
    Member

    New changeset 386b6f0 by Ned Deily (Xtreak) in branch '3.7':
    [3.7] bpo-35726: Prevented QueueHandler formatting from affecting other handlers (GH-11537) (GH-12716)
    386b6f0

    @ned-deily
    Copy link
    Member

    New changeset 3f8f64e by Ned Deily (Miss Islington (bot)) in branch '3.7':
    bpo-35726: Add test for QueueHandler with multiple handlers (GH-11659) (GH-13061)
    3f8f64e

    @ned-deily ned-deily added the 3.8 only security fixes label May 2, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants