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

Python 3.8 changes the findCaller method signature which breaks STDLibLogObserver #9668

Closed
twisted-trac opened this issue Jul 1, 2019 · 3 comments

Comments

@twisted-trac
Copy link

jeremycline's avatar @jeremycline reported
Trac ID trac#9668
Type defect
Created 2019-07-01 17:02:08Z

Python 3.8 adds a new keyword argument, stacklevel, to its findCaller function in commit dde9fdbe4539 ("bpo-33165: Added stacklevel parameter to logging APIs. (GH-7424)"). As Twisted is replacing this method with its own method, logging with STDLibLogObserver fails in Python 3.8.

This issue was discovered during Fedora's mass rebuild[0] with the Python 3.8 beta when a crochet test started failing[1].

Pull request: #1161

[0] https://bugzilla.redhat.com/show_bug.cgi?id=1724145

[1] https://github.com/itamarst/crochet/blob/8b4178efcaff6d63562c4520cfb128bb9681f9b0/crochet/tests/test_setup.py#L349

Searchable metadata
trac-id__9668 9668
type__defect defect
reporter__jeremycline jeremycline
priority__normal normal
milestone__Python_3_8_Support Python 3.8 Support
branch__ 
branch_author__ 
status__closed closed
resolution__fixed fixed
component__logger logger
keywords__None None
time__1562000528551443 1562000528551443
changetime__1563637975291902 1563637975291902
version__None None
owner__hawkowl hawkowl

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl set owner to @hawkowl

This does as it says on the tin on my Python 3.8.0b2.

@twisted-trac
Copy link
Author

Jeremy Cline's avatar Jeremy Cline set status to closed

In changeset c0ce0d7

#!CommitTicketReference repository="" revision="c0ce0d77be9152a8a3645c5bddb6e2f9cc56d98f"
Merge jeremycline:9668-jeremycline-stdlog-findCaller-38-compat: Add the stackLevel kwarg to STDLibLogObserver._findCaller

Author: jeremycline
Reviewer: hawkowl
Fixes: ticket:9668

Python 3.8 adds a new keyword argument, stacklevel, to its findCaller
function in commit dde9fdbe4539 ("bpo-33165: Added stacklevel parameter
to logging APIs. (GH-7424)"). As Twisted is replacing this method with
its own method, logging with STDLibLogObserver fails in Python 3.8. This
patch adds the argument, but does not use it as there is already a
stackDepth instance variable and the stackInfo on the method is also
ignored.

This patch fixes the logger tests that currently fail in Python 3.8.

Signed-off-by: Jeremy Cline <jcline@...>

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl commented

Thanks Jeremy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants