bpo-36015: logging: handle StreamHandler representaton of stream with int name by xrmx · Pull Request #11908 · python/cpython

Conversation

@xrmx

When debugging uwsgi logging issues with python3.7 i got this:

Traceback (most recent call last):
  File "/usr/lib/python3.7/logging/__init__.py", line 269, in _after_at_fork_weak_calls
    _at_fork_weak_calls('release')
  File "/usr/lib/python3.7/logging/__init__.py", line 261, in _at_fork_weak_calls
    method_name, "method:", err, file=sys.stderr)
  File "/usr/lib/python3.7/logging/__init__.py", line 1066, in __repr__
    name = name + ' '
TypeError: unsupported operand type(s) for +: 'int' and 'str'

https://bugs.python.org/issue36015

@nickwilliams-eventbrite

This caused us quite some confusion when we started deploying 3.7 applications to Prod two weeks ago, and there were literally zero applicable results on Google for some time, until I looked it up again today and found this PR. Glad to see that it is, as we suspected, a CPython bug, and that there's a fix in the works. Thanks!

vsajip

@bedevere-bot

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

When debugging uwsgi logging issues with python3.7 i got this:
Traceback (most recent call last):
  File "/usr/lib/python3.7/logging/__init__.py", line 269, in _after_at_fork_weak_calls
    _at_fork_weak_calls('release')
  File "/usr/lib/python3.7/logging/__init__.py", line 261, in _at_fork_weak_calls
    method_name, "method:", err, file=sys.stderr)
  File "/usr/lib/python3.7/logging/__init__.py", line 1066, in __repr__
    name = name + ' '
TypeError: unsupported operand type(s) for +: 'int' and 'str'

@xrmx

I have made the requested changes; please review again.

@bedevere-bot

Thanks for making the requested changes!

@vsajip: please review the changes made to this pull request.

nickwilliams-eventbrite

vsajip

@xrmx

@vsajip thanks for merging, would it be possible to add the label to have this backported to 3.7 please?

@miss-islington

Thanks @xrmx for the PR, and @vsajip for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 8, 2019
…er name (pythonGH-11908)

(cherry picked from commit ca87eeb)

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>

@bedevere-bot

vsajip pushed a commit that referenced this pull request

May 15, 2019
…er name (GH-11908) (GH-13183)

(cherry picked from commit ca87eeb)

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>

Labels